PHP mySQL display output in Tabular format
Moderator: General Moderators
-
James Ecker
- Forum Newbie
- Posts: 3
- Joined: Sat Dec 20, 2003 8:03 am
PHP mySQL display output in Tabular format
I would like to retrieve data from multiple tables and display them in tabular format. Any ideas?
Do you have any PHP - SQL experience at all?
This gives a table with all of the results from the query...
This gives a table with all of the results from the query...
Code: Select all
$result=mysql_query($query);
echo "<table width='90%' border='0'><tr>";
for ($i=0;$i<mysql_num_fields($result);$i++){
echo "<td><b>".mysql_field_name($result,$i)."</b></td>";
}
echo "</tr>";
while ($row=mysql_fetch_array($result)){
echo "<tr>";
for ($i=0;$i<count($row);$i++){
echo "<td>".stripslashes($row[$i])."</td>";
}
echo "</tr>";
}
echo "</table>";-
James Ecker
- Forum Newbie
- Posts: 3
- Joined: Sat Dec 20, 2003 8:03 am
PHP mySQL display output in Tabular format
I am looking for the output to look like this:
Make/Model Honda Ford Chevy
LX $12,000 $13,000 $12,500
DX $11,500 $12,000 $11,000
EX $13,000 $12,500 $13,500
Where the make, model, and dollar amounts are dynamic from user input.
Make/Model Honda Ford Chevy
LX $12,000 $13,000 $12,500
DX $11,500 $12,000 $11,000
EX $13,000 $12,500 $13,500
Where the make, model, and dollar amounts are dynamic from user input.
-
James Ecker
- Forum Newbie
- Posts: 3
- Joined: Sat Dec 20, 2003 8:03 am
PHP mySQL display output in Tabular format
Can you point me in the right direction as to where I might the information needed?
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA