I know it is something easy to fix. This is a "forgot password" form for my website. the error i get is Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ... on line 12. what is the problem and how can i fix it so it sends?
<?php
$outputForUser = "";
if ($_POST[' ... y>
</html>
Warning: mysql_num_rows(): supplied argument is not a valid
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Warning: mysql_num_rows(): supplied argument is not a va
Code: Select all
<?php
$sql = mysql_query("SELECT * FROM members WHERE email='$email' AND email_activated='1'");
echo $sql;
?>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: Warning: mysql_num_rows(): supplied argument is not a va
it's the same thing...
Re: Warning: mysql_num_rows(): supplied argument is not a va
Am i missing a myql form entry?
Re: Warning: mysql_num_rows(): supplied argument is not a va
Try printing the query from the PHP script. Then run the same query in MySQL manually and see if it returns any results. Faults could be:
1. Miss-typed argument names
2. Miss-typed table name
3. $email containing bad characters e.g. '
/Johan
1. Miss-typed argument names
2. Miss-typed table name
3. $email containing bad characters e.g. '
/Johan
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Warning: mysql_num_rows(): supplied argument is not a va
social_experiment wrote:What is displayed if you print the query
If you print the query you will see what the query looks like when it is passed to the database, from there it will be easier to find an answer to your question. Paste the results herebeetree wrote:Try printing the query from the PHP script.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering