ee, je to starsia verzia phprs 265SK
zmenil som script takto:
[
http://www.ova.sk/comments_recount.php]
<?php
################################################################################
#
# Uprava poctu komentarov v tabulke clankov
# po ich hromadnom vymazani z tab. komentare
#
################################################################################
define('IN_CODE',true);
include_once('config.php');
################################################################################
echo '
<html>
';
$sql = ' SELECT COUNT( idk ) as spravnypocetkom, clanek
FROM `'.$GLOBALS['rspredpona'].'komentare`
GROUP BY clanek';
$result = mysql_query($sql,$GLOBALS["dbspojeni"]);
while ($zaznam = mysql_fetch_assoc($result))
{
echo '
<br>
pre clanok: '.$zaznam['clanek'].'
nastavujem pocet komentarov:'.$zaznam['spravnypocetkom'].'
';
@mysql_query
('
UPDATE '.$GLOBALS["rspredpona"].'clanky
SET kom='.$zaznam['spravnypocetkom'].' where link="'.$zaznam['clanek'].'"'
,$GLOBALS["dbspojeni"]
);
}
echo '
</html>
';
?>
a tu su hlasenia:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /httpd/html/ovask/www/comments_recount.php on line 22
($result = mysql_query($sql,$GLOBALS["dbspojeni"]);)
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /httpd/html/ovask/www/comments_recount.php on line 25
(while ($zaznam = mysql_fetch_assoc($result)) )
Celkem upraveno 1×. Poslední úprava yard v 03.09.2006 13:33.