Page 1 of 1

help with query

Posted: Tue Sep 07, 2010 2:18 am
by cybershot
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?

Re: help with query

Posted: Tue Sep 07, 2010 11:34 am
by social_experiment
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
} ?>

Re: help with query

Posted: Tue Sep 07, 2010 11:42 am
by cybershot
Thank you. That did the trick.