Jump to content

[SOLVED] Strange Errors I Can't Get Rid Of..


monkeypaw201

Recommended Posts

I posted the code below, i personally can't find anything wrong with it and have triple-checked spelling and the form names etc...

 

$user = mysql_query("SELECT * FROM `users` WHERE `activation_key` = '$_POST[key]' AND `email` = '$_POST[email]'");
$row_user = mysql_fetch_array($user);
$user_count = mysql_num_rows($user);

 

the errors:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in public_html/human-resources/confirm.php on line 45

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in public_html/human-resources/confirm.php on line 46

Link to comment
https://forums.phpfreaks.com/topic/116935-solved-strange-errors-i-cant-get-rid-of/
Share on other sites

the real problem is with the query, try changing the first line to

 

$user = mysql_query("SELECT * FROM `users` WHERE `activation_key` = '$_POST[key]' AND `email` = '$_POST[email]'") or die(mysql_error());

 

that should tell you what is wrong with your query (I haven't looked to see if I see anything wrong)

the query should be like this....

 

$user = mysql_query("SELECT * FROM `users` WHERE `activation_key` = '" . $_POST['key'] . "' AND `email` = '" . $_POST['email'] . "'") or die(mysql_error());

 

You just needed to insert the $_POST's correctly.

 

Regards ACE

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.