Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

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

0
deanlee17
Asked:
deanlee17
1 Solution
 
sam2912Commented:

<?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
 
deanlee17Author Commented:
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
unclebackpackCommented:
As sam2912 stated, which might not be clear by looking at the code directly. You are missing a { in your WHILE statement
0
 
sivagnanam chandrakanthCommented:
<?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
 
deanlee17Author Commented:
Thanks guys.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now