Hi,
So far the best way to troubleshoot mysql+php for me has been to add an "or die" after 
the sql exec.
$crdate = date("Y-m-d");
$result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'") or die ('CAN NOT EXEC SQL');

Or you can do 

$sql = "SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'";

echo $sql;

$result = mysql_query($sql) or die .....;

and try to run your sql against mysql directly to make sure your sql is fine.

one thing to always check is your connection to the database..... did you connect?


 

  Simon Kimber <[EMAIL PROTECTED]> wrote: Does anyone have any idea why this is giving 
me a "Warning: Supplied
argument is not a valid MySQL result resource in..." error?

The funny thing is that apart from that error message it works perfectly!!

---------------------------

$crdate = date("Y-m-d");
$result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'");

while ($sitedata = mysql_fetch_array($result)) {

echo $sitedata['name'] . "
";

}

---------------------------

Cheers

Simon


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Mehmet Erisen
http://www.erisen.com


---------------------------------
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.

Reply via email to