monkeypaw201 Posted July 28, 2008 Share Posted July 28, 2008 I am getting these errors Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public_html/human-resources/confirm.php on line 55 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public_html/human-resources/confirm.php on line 58 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public_html/human-resources/confirm.php on line 61 No recipient addresses found in header when i run this code: mysql_select_db("database", $connection); $user = mysql_query("SELECT * FROM `users` WHERE `activation_key` = '" . $_POST['key'] . "' AND `email` = '" . $_POST['email'] . "'") or die(mysql_error()); $row_user = mysql_fetch_array($user); $user_count = mysql_num_rows($user); and im not sure what it means Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/ Share on other sites More sharing options...
revraz Posted July 28, 2008 Share Posted July 28, 2008 Means your query is failing and not providing a result. Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/#findComment-601679 Share on other sites More sharing options...
monkeypaw201 Posted July 28, 2008 Author Share Posted July 28, 2008 Ok, thanks, this is the code for the form ... i checked th variables.. but did i miss something? <form name="form1" method="post" action="confirm.php"> <table width="100%" border="0"> <tr> <td>Activation Key:</td> <td><label> <input type="text" name="key" id="key" <?php if(isset($_GET['key'])){ echo "value=\"" . $_GET['key'] . "\" disabled"; } ?> /> </label></td> </tr> <tr> <td>E-Mail Address:</td> <td><label> <input type="text" name="email" id="email" /> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2"><label> <div align="center"> <input type="submit" name="submit" id="button" value="Activate Account & Log-In"> </div> </label></td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/#findComment-601684 Share on other sites More sharing options...
samshel Posted July 28, 2008 Share Posted July 28, 2008 1) always use mysql_escape_string to avoid mysql injection. 2) you have already used mysql_error(), so it should some error before these warnings if query is failing. 3) echo your query to check if key and email are passed properly. 4) Try to check if there are any records returned before fetching them mysql_select_db("database", $con); $user = mysql_query("SELECT * FROM `users` WHERE `activation_key` = '" . $_POST['key'] . "' AND `email` = '" . $_POST['email'] . "'") or die(mysql_error()); $user_count = mysql_num_rows($user); if($user_count>0) { $row_user = mysql_fetch_array($user); } Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/#findComment-601689 Share on other sites More sharing options...
revraz Posted July 28, 2008 Share Posted July 28, 2008 Let's see the code from 50 to 65 Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/#findComment-601690 Share on other sites More sharing options...
monkeypaw201 Posted July 28, 2008 Author Share Posted July 28, 2008 @samshel : I tried that and it turns out that the POST variable key is not posting correctly. I'm not sure why though... @revraz : problem is now in the form Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/#findComment-601700 Share on other sites More sharing options...
samshel Posted July 28, 2008 Share Posted July 28, 2008 try removing disbale...i think it will not submit value of input which is disabled... if you want to keep it disabled..use a hidden field and assign the same value to it and use its value in $_POST. Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/#findComment-601704 Share on other sites More sharing options...
monkeypaw201 Posted July 28, 2008 Author Share Posted July 28, 2008 Alright, I removed the disabled, and replaced it with read-only and added css to grey it out... and it works. thanks! Link to comment https://forums.phpfreaks.com/topic/116994-solved-what-do-these-errors-mean/#findComment-601711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.