Re: mysql_fecth_array() and function call as parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx> 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
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux