foreach tutorial

Thread Solved

Join Date: Dec 2007
Posts: 53
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training

foreach tutorial

 
0
  #1
28 Days Ago
I have be struggling to turn the below while loop into a foreach loop with no result, so I am asking for help here on how to do this.
  1. $query = "Select * from TIME_TABLE Where
  2. Extract(month from DATE_FIELD ) = DATE_FORMAT(NOW(), '%c')
  3. and
  4. Extract(day from DATE_FIELD ) = DATE_FORMAT(NOW(), '%e')
  5. order by DATE_FIELD, DESCRIPTION";
  6. $result = $mysqli->query($query);
  7.  
  8. while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
  9. $dbItems .= "<item> <record_num>" . $row['RECORD_NUM'] . "</record_num>" .
  10. "<date_field>" . $row['DATE_FIELD'] . "</date_field>" .
  11. "<description>" . $row['DESCRIPTION'] . "</description> </item>";
  12. }
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 53
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training
 
0
  #2
28 Days Ago
I placed this in the wrong group. I am moving this to PHP.
Sorry!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,185
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 482
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer
 
0
  #3
27 Days Ago
Originally Posted by rouse View Post
I placed this in the wrong group. I am moving this to PHP.
Sorry!
Next time please click on "Flag Bad Post" and write message like "Please move to PHP" and assign moderator will take care of it.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC