Re: mysql_fecth_array() and function call as parameter

From: Date: Mon, 03 Apr 2006 18:55:07 +0000
Subject: Re: mysql_fecth_array() and function call as parameter
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-233142@lists.php.net to get a copy of this message
Paul Goepfert wrote:
function determineDay () { $return = ""; $query1 = mysql_query("SELECT months FROM Month WHERE m_id = month(curdate())"); $query2 = mysql_query("SELECT dayNum FROM Days WHERE dayNum = day(curdate())"); $query3 = mysql_query("SELECT year FROM Year WHERE year = year(curdate())");
always Always ALWAYS check the error return!!! $query1 = mysql_query("SELECT months FROM Month WHERE m_id = month(curdate())") or die("query1 failed: " . mysql_error()); do this religiously on every single mysql_query. in fact, write a wrapper function to do it for you - that's what i do.
If anyone can find my error please let me know. I have looked at this for about an hour and I can't figure it out.
you probably could have saved an hour by checking the error code. -jsd-

« previous php.general (#233142) next »