Thanks for your reply,

i am doing a fitnerss site and i want to display the muscle of the month.
This works fine with the  following code:

function get_muscle(){
  $month = date(F);
  $query =  "SELECT * FROM Table_Muscle WHERE Muscle_Month = '$month'";
  $result = mysql_query($query);
  $muscle_id = mysql_result($result, 0, Muscle_ID);
  $muscle_name = mysql_result($result, 0, Muscle_Name);
  $muscle_actions = mysql_result($result, 0, Muscle_Actions);
  $muscle_exercises = mysql_result($result, 0, Muscle_Exercises);

  echo   "<p><strong>Month:</strong> $month</p>
    <p><strong>Muscle:</strong> $muscle_name</p>

however, i want to add a link at the bottom of the page to view previous
months (i.e. Previous Month or Next Month) and this is where it gets tricky.
I could increment $muscle_id but what heppens when i get to tweleve and want
to revert back to january?

Thanks for your input

"Dl Neil" <[EMAIL PROTECTED]> wrote in message
> Hi Shaun,
> > please could someone tell me how i can return a month in text from an
> ie
> > getMonth(12)
> > returns Decmber. Is this possible?
> No. If you want to stick with this, write your own function to look up a
> text array.
> If the "12" is part of more data coming in from a form or db (for
> then give us the wider picture and a 'built-in' solution may become
> possible.
> =dn

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to