database update

hi im new to this forum and i need some help

my database doesnt update and the echo doesnt show up i just get a blank page yes errors are on plz help

[code]<?
include “config2.php”;
?>

<? $name=mysql_real_escape_string($name);

if ($rec=mysql_num_rows(mysql_query(“SELECT name FROM accounts WHERE name=’$name’”))) {
if (($rec[‘name’]==$name)) {
if(mysql_query(“update accounts set loggedin=‘1’ WHERE name=’$name’”)){
echo “Your account has been fix try to log in the game now!”;
}
}
}

?>

[/code]

Need to know what the errors are… Either turn on displaying errors or get them from your error log.

Also your assignment of $rec is all wrong…

You are assigning the value from mysql_num_rows to $rec then in the next line you are looking for the name from the query…

To get the NAME you need to use a “Fetch” (assoc or array) to get the data.

Sponsor our Newsletter | Privacy Policy | Terms of Service