dubc07 Posted July 18, 2008 Share Posted July 18, 2008 How can i make this work. <?php $month ="july"; $day ="29"; //display all the news $result = mysql_query('SELECT * FROM `rentem` WHERE month="'.$month.'" day="'.$day.'"' ); ?> Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted July 18, 2008 Share Posted July 18, 2008 Is this a joke? Make what work? What doesn't work? What would you like it to do? Quote Link to comment Share on other sites More sharing options...
dubc07 Posted July 18, 2008 Author Share Posted July 18, 2008 I'm trying to call from the database where month = july & day = 29 $result = mysql_query('SELECT * FROM `rentem` WHERE month="'.$month.'" day="'.$day.'"' ); ////does not work/// error message = Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Just trying to see if it is possible to get data like this. By the way I'm pretty new to php stuff so give me a break. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 18, 2008 Share Posted July 18, 2008 I don't see a mysql_fetch_array() in the quoted code, but you should do: <?php $q = "SELECT * FROM `rentem` WHERE month='".$month."' day='".$day."'"; $result = mysql_query($q) or die("Problem with the query: $q on line " . __LINE__ . '<br>' . mysql_error()); ?> so you can see whether the query actually worked. Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.