Problem showing tables using PHP

Hi Experts,

Trying to display table names in a database and im getting this error.....

http://www.deans-place.co.uk/view_bookings.php

Code attached.

Thanks,
Dean.
<?php
mysql_connect("localhost", "XXX", "XXX") or die(mysql_error());
mysql_select_db("deano_database") or die(mysql_error());


$showtablequery = " SHOW TABLES FROM [deano_database] ";
 
$showtablequery_result	= mysql_query($showtablequery);

while($showtablerow = mysql_fetch_array($showtablequery_result)) 

	echo $showtablerow[0]."<br />";

	
}

 ?>

Open in new window

deanlee17Asked:
Who is Participating?
 
sivagnanam chandrakanthTechnical LeadCommented:
<?php
mysql_connect("localhost", "XXX", "XXX") or die(mysql_error());
mysql_select_db("deano_database") or die(mysql_error());


$showtablequery = " SHOW TABLES FROM deano_database";
 
$showtablequery_result      = mysql_query($showtablequery);

while($showtablerow = mysql_fetch_array($showtablequery_result)) {

      echo $showtablerow[0]."<br />";

      
}

 ?>

check this, will surely work
0
 
Samuel LiewCommented:

<?php
mysql_connect("localhost", "XXX", "XXX") or die(mysql_error());
mysql_select_db("deano_database") or die(mysql_error());


$showtablequery = " SHOW TABLES FROM [deano_database] ";
 
$showtablequery_result	= mysql_query($showtablequery);

while($showtablerow = mysql_fetch_array($showtablequery_result)) {

	echo $showtablerow[0]."<br />";

	
}

 ?>

Open in new window

0
 
Loganathan NatarajanLAMP DeveloperCommented:
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
deanlee17Author Commented:
0
 
unclebackpackCommented:
As sam2912 stated, which might not be clear by looking at the code directly. You are missing a { in your WHILE statement
0
 
deanlee17Author Commented:
Thanks guys.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.