|
-
Senior Member
mysql_query returns false when it cannot connect with the database or when the query contains an error. However, it does not throw an error itself. When you pass that false query $result to mysql_result(), mysql_fetch_array(), etc. those functions will throw the error you've received.
Either the db has not been properly selected, or the query is not working (one thing that jumps out at me is at ID=$sender_id ... the POST might not be coming through, or the name of the column might be `id` instead of `ID` and depending on your mysql settings, this may be caps sensitive, which is the default for mysql 5).
Suggested steps to resolution would be to add a tracer into your code, before it hits the error point, e.g.
PHP Code:
$errorfile = fopen("error.txt","w"); fwrite($errorfile,"SELECT naam_verzender, tekst1, tekst2 FROM Ecards WHERE ID=$sender_id");
Then look at the file generated and try to test the query as it appears using phpMyAdmin or on the mysql command line to see if it works. If the query does work, then the problem is that the db is not properly selected.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|