PDA

View Full Version : MySQL data


Serge
05-24-2003, 10:25 PM
Ok if I run a query like so


$result = mysql_query("SELECT sectionid, sectionname, sectiondes, artnumber FROM section") or
die (mysql_error());


And then said something like...


$sectionid=$section


Could I then echo out section whereever I wanted.

The only way I really know how to echo out something is to use an while statement

filburt1
05-24-2003, 10:35 PM
$result = mysql_query("SELECT sectionid, sectionname, sectiondes, artnumber FROM section");
if (!$result) die(mysql_error());

while ($section = mysql_fetch_array($result))
{
echo "<pre>";
print_r($section);
echo "</pre>";
}
mysql_free_result($result);