Jump to content

mysql_fetch trouble.


dubc07

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.