display data

How do you display data from mysql to a html table?i can display it as jst html,but not in a table.is dis correct?

still it has errors…can anyone help?
[php]

Untitled Document <?php include ("sd/forms/connect.php"); // connect file resides in a folder called "sd" $query = mysql_query("SELECT * FROM sd");// database table called "sd" while($showrow = mysql_fetch_assoc($query)){ echo ''.''; } ?>
'.$showrow['ClientID'].''.$showrow['ClientName'].'
[/php]

What errors are you recieving?

it shows these errors …
Warning: include(sd/forms/connect.php) [function.include]: failed to open stream: No such file or directory in E:\xampp\htdocs\SD\Forms\content.php on line 14

Warning: include() [function.include]: Failed opening ‘sd/forms/connect.php’ for inclusion (include_path=’.;E:\xampp\php\PEAR’) in E:\xampp\htdocs\SD\Forms\content.php on line 14

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\SD\Forms\content.php on line 18

i fix the 2 errors.(the path name was wrong)in line 14 but still cant fix the error in line 18…Help

theres something going wrong with your query. do you have phpmyadmin or anyway to manually que the database? If so go in and try running the query and see what kind of error/s you get from the database, it seems really weird with such a simple query. In connect.php you are connecting and selecting the db that the ‘sd’ table is located in right?

i found the mistake.sd is my database name.my table name is client.thanks for showing it :slight_smile:

[php]$query = mysql_query(“SELECT * FROM client”);// database table called “client” // i changed it
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service