|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I'd like to output some query results in a table, each result in it's own column and row. Here's an example -- *********************************** IF ($result){ echo "<center><table><tr><td>"; while ($r = mysql_fetch_array($result)) { $number = $r["stock_number"]; $description = $r["item_description"]; echo "$number<br></td>"; echo "<td>$description<br>"; } echo "</td></tr></table>"; } else { echo "No data."; ********************************* Except it doesn't work correctly. What is the proper way to accomplish this? Thanks |
|
#2
|
|||
|
|||
|
Hello,
please try this out : You've got to make once a table and you got to embed for each productnr. and description a own row and column. I hope this will help you out ! *********************** echo "<center><table>"; IF ($result) { while ($r = mysql_fetch_array($result)) { $number = $r["stock_number"]; $description = $r["item_description"]; echo "<tr><td>$number<br></td>"; echo "<td>$description</td></tr>"; } echo "</table>"; } else { echo "No data."; ********************************* |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Output into table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|