| | |
foreach tutorial
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Dec 2007
Posts: 53
Reputation:
Solved Threads: 1
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.
MySQL Syntax (Toggle Plain Text)
$query = "Select * from TIME_TABLE Where Extract(month from DATE_FIELD ) = DATE_FORMAT(NOW(), '%c') and Extract(day from DATE_FIELD ) = DATE_FORMAT(NOW(), '%e') order by DATE_FIELD, DESCRIPTION"; $result = $mysqli->query($query); while ($row = $result->fetch_array(MYSQLI_ASSOC)) { $dbItems .= "<item> <record_num>" . $row['RECORD_NUM'] . "</record_num>" . "<date_field>" . $row['DATE_FIELD'] . "</date_field>" . "<description>" . $row['DESCRIPTION'] . "</description> </item>"; }
0
#3 27 Days Ago
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
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- JSP database connectivity according to Model View Controller (MVC) Model 2 (JSP)
- C++ Tutorial (C++)
- [Revised] vBulletin Mod_rewrite Tutorial (PHP)
Other Threads in the MySQL Forum
- Previous Thread: php mysql
- Next Thread: Problems restoring mysql database backups
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop legal license licensing linux maintenance mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization






