note 106386 added to language.variables.variable
| From: | info at loginetsolutions dot com | Date: | Thu, 03 Nov 2011 18:41:39 +0000 |
| Subject: | note 106386 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184282@lists.php.net to get a copy of this message | ||
I was searching for a database loop example and based on info on this page I was capable to
implemented it. Hopefully it will save 5 minutes to somebody.
Here is the example:
//database connect info
......
$sql = mysql_query("SELECT containers.Container_Description, containers.Container_Order,
container_types.Container_Type_Name, container_types.Container_Size FROM containers
LEFT JOIN container_types ON containers.Container_Type = container_types.ID_Container_Type
WHERE containers.ID_Waybill ='".$_REQUEST['wno']."' ORDER BY
containers.Container_Order");
while($row = mysql_fetch_array($sql)){
${'container_size'.$row['Container_Order']} =
$row['Container_Type_Name']."-".$row['Container_Size'];
${'container_description'.$row['Container_Order']} =
$row['Container_Description'];
}
echo $container_size1." ".$container_description1."<br/>";
echo $container_size2." ".$container_description2."<br/>";
echo $container_size3." ".$container_description3."<br/>";
This will print out:
DV-20 First container
OT-20 Second container
OT-20 Third container
----
Server IP: 69.147.83.197
Probable Submitter: 173.179.187.67
----
Manual Page -- http://www.php.net/manual/en/language.variables.variable.php
Edit -- https://master.php.net/note/edit/106386
Del: integrated -- https://master.php.net/note/delete/106386/integrated
Del: useless -- https://master.php.net/note/delete/106386/useless
Del: bad code -- https://master.php.net/note/delete/106386/bad+code
Del: spam -- https://master.php.net/note/delete/106386/spam
Del: non-english -- https://master.php.net/note/delete/106386/non-english
Del: in docs -- https://master.php.net/note/delete/106386/in+docs
Del: other reasons-- https://master.php.net/note/delete/106386
Reject -- https://master.php.net/note/reject/106386
Search -- https://master.php.net/manage/user-notes.php