need help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
krvmanoj
Forum Newbie
Posts: 4
Joined: Tue Aug 11, 2009 6:50 am

need help

Post by krvmanoj »

Code: Select all

$result1 = mysql_query("SELECT id,name,email,dob,DAYOFYEAR(dob + INTERVAL YEAR(NOW()) -YEAR(dob) YEAR) -           
                       DAYOFYEAR(NOW()) as days FROM tcemcac_tcemca.personal order by days");
                while($row = mysql_fetch_array($result1))
            {
            if($row['days']== 0 && $row['dob'] != 0000-00-00 )
        { 
               $na = $row['name'];
                       $em=  $row['email'];
                       $dat= $row['dob'];
                       list($month, $day, $year) = split('[/.-]', $dat);
                       $dates= $day;
        }
}
I need to have these values in an array. ie when there are more than one record set that satisfy the if condition then i am getting the last record set value alone.so help me to get all those values either by using array or any other logic.
thanks in advance
ct_lee
Forum Newbie
Posts: 12
Joined: Wed Aug 05, 2009 3:15 pm

Re: need help

Post by ct_lee »

A good example you may want to look at and adapt would be:
http://uk3.php.net/list

Look at example 2. I would think that's a way to do it.
Post Reply