php+mysql
Posted: Sat Mar 26, 2011 8:20 pm
Hi can some on tell where i am wrong
and error is
Parse error: syntax error, unexpected ',' in /home/****.php on line 16
can tell any one where i am wrong
o and yes i am new in programming so don't bee ruff
Code: Select all
<?php
$db = mysql_connect(' ****** ',' ****** ',' ****** ') or die();
mysql_select_db(' ****** ', $db);
$result = mysql_query("set names 'utf8'");
$query = "select * from table ORDER BY id";
$result = mysql_query($query);
$userrow = mysql_fetch_array( $result );
while($userrow = mysql_fetch_array($result)){
echo $userrow['id']. " - ". $userrow['username']. " - ". $userrow['currenthp']. " - ". $userrow['maxhp']. " - ". $userrow['gold'];
echo "<br />";
if($userrow["currenthp"] != ($userrow["maxhp"])){
$result2 =mysql_query("UPDATE table SET `currenthp` = `currenthp` + '1'
WHERE `id` = '".$userrow["id"]."'", "users");
}
else {
echo "NEW HP-";
echo $userrow['id']. " - ". $userrow['username']. " - ". $userrow['currenthp']. " - ". $userrow['maxhp']. " - ". $userrow['gold'];
echo "<br />";
}
}
?>Parse error: syntax error, unexpected ',' in /home/****.php on line 16
can tell any one where i am wrong
o and yes i am new in programming so don't bee ruff