Re: mysql_fecth_array() and function call as parameter

From: Date: Tue, 28 Mar 2006 00:58:54 +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-232689@lists.php.net to get a copy of this message
according to my SQL the month name ois going to be returned not the month number. m_id is the number equivlent to the month. months is the full name of the month. In my month method I did not change the case values to the month number and the function returns correctly. All I had to do was add the column name to $query1_data[] or $query2_data[] But in this method it didn't work. I can't figure it out. I've even checked my column name to be sure I spelled it right. It was. On 3/27/06, Brady Mitchell <bradym@ext.usu.edu> wrote: > > -----Original Message----- > > I finally got the function to work. However I have a problem with > > another function. It is almost exactly like the origional function > > but in this function I am determining the days instead of the month. > > I made the same changes to the days function as I did to the month > > function. However no value is being set to be returned. I can't find > > my error. My function is below: > > <snip> > > > switch ($query1_data["months"]) > > { > > case "January": > > case "March": > > case "May": > > case "July": > > case "August": > > case "October": > > case "December": > > Once again, in your switch statement you are checking for the full name > of the > month, but your query will be returning the month number. Since you > don't have a default case on your switch statement, $return is never > being set, so " $day = $this->determineDay(); " is not setting > $month to anything, which is why you are getting error messages. > > > http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html > > Brady >

« previous php.general (#232689) next »