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.'"' ); ?> Link to comment https://forums.phpfreaks.com/topic/115493-mysql_fetch-trouble/ 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? Link to comment https://forums.phpfreaks.com/topic/115493-mysql_fetch-trouble/#findComment-593745 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. Link to comment https://forums.phpfreaks.com/topic/115493-mysql_fetch-trouble/#findComment-593785 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 Link to comment https://forums.phpfreaks.com/topic/115493-mysql_fetch-trouble/#findComment-593789 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.