i have this query
$query = mysql_query("SELECT * FROM archive WHERE user=$user"); $number = mysql_num_rows($query);
it says that the num rows isnt a valid resource. i tried to echo the query and nothing came out. i echoed $user and that was fine.
Use [man]mysql_error[/man].
$query = mysql_query("SELECT * FROM archive WHERE user=$user") or die(mysql_error());
i get
You have submitted Unknown column 'Tagger' in 'where clause'
try putting single quotes around it:
"SELECT * FROM archive WHERE user=' " . $user . " ' ";
I'm assuming you're passing in the variable 'user' from a form...
If you're still stuck, give this a shot:
"SELECT * FROM archive WHERE user=' " . $_POST['user'] . " ' ";