Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP & mySQL question

Status
Not open for further replies.

vr76413

Programmer
Feb 26, 2002
65
US
When i did a SQL query i get a bunch of records....now i want to display these records , one record per row on screen in my php page...

Can anyone help me ....

thanks and any help is appreciated...
 
<?
$result = mysql_query($sql, $conn);

echo &quot;<table>&quot;;
while $row = mysql_fetch_array($result){
$someValue = $row[&quot;someDBField&quot;];
$anotherValue = $row{&quot;anotherfield&quot;];

echo &quot;<tr><td>$someValue</td><td>$anothervalue</td>&quot;;
}
echo &quot;</table>&quot;;

?>

hth Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Beastien:

How about:

<?
$result = mysql_query($sql, $conn);

echo &quot;<table>&quot;;
while $row = mysql_fetch_array($result){
$someValue = $row[&quot;someDBField&quot;];
$anotherValue = $row{&quot;anotherfield&quot;];

echo &quot;<tr><td>$someValue</td><td>$anothervalue</td></tr>&quot;;
}
echo &quot;</table>&quot;;

?> Arlequín
arlequin@montevideo.com.uy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top