Code:
$sql="SELECT * FROM forum_question WHERE id='$id', forums_id='$forums_id'";
$result=mysql_query($sql);
Error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a5886547/public_html/view_topic.php on line 46
How can I solve the problem? (How can I use multiple WHERE conditions?)
New Error!!
Moderator: General Moderators
Re: New Error!!
1. Ask in the correct forum (Code or Database, not Theory and Design)Monopoly wrote:How can I solve the problem?
2. Use a descriptive subject
3. Demonstrate that you've made some effort in solving the problem yourself, usually these things really work out when you try to shake them a bit AND it works faster for you, rather than waiting for someone to answer on a forum.
How would you do a similar thing in PHP, in an "if" for example (Hint: &&). Check the MySQL documentation on the equivalent of && in SQL.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: New Error!!
WHERE [condition], [condition] <-- WrongMonopoly wrote:How can I use multiple WHERE conditions?
WHERE [condition] AND [condition] <-- Right
WHERE [condition] OR [condition] <-- Right