help with query
Moderator: General Moderators
help with query
I made a table, inserted values from the form, now I want to display that data. I tried echo "SELECT * FROM tblBills" ; but that just displays the query. How do I get it to actually display the table data?
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: help with query
Try this :
Code: Select all
<?php
// your query
$query = "SELECT * FROM tblBills";
$sql = mysql_query($query);
while ($display_array = mysql_fetch_array($sql)) {
// you use the field names of the table here
echo $display_array['field1'];
// etc
} ?>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: help with query
Thank you. That did the trick.