₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,326,856 members, 8,428,383 topics. Date: Wednesday, 17 June 2026 at 10:59 AM

Toggle theme

Problems With Mysql - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersProblems With Mysql (758 Views)

1 Reply (Go Down)

Problems With Mysql by dammy009(op): 2:46pm On Jan 28, 2009
hello,
i want to echo out the tables in a database, my code is:

mysql_connect("localhost", "tables", ""wink or die(mysql_error());
echo "connected to database";

mysql_select_db("today"wink or die(mysql_error());
echo "Connected to database<br>";
$tables=mysql_list_tables("today"wink;

if ($tables ==""wink{
echo "this database does not have a table";
exit;
}else {
echo $tables;
}

the result i am getting is

connected to database

Connected to database

Resource id #3
the last line is the problem, please can anyone help me sort out what the problem is?
i am using phpmyadmin to connect php to mysql.
pleasee
Re: Problems With Mysql by kehers(m): 3:38pm On Jan 28, 2009
$tables=mysql_list_tables("today"wink;
The function mysql_list_tables returns a resource identifier to the result. And that is why you are getting what you are getting. You still need a couple of code lines to draw up the resource result.
Here:
,
$tables=mysql_list_tables("today"wink;
while(list($tbl) = mysql_fetch_array($tables)){
echo $tbl;
}
,
I didnt test that (stole just some minutes to come around NL) but I hope it works.
Re: Problems With Mysql by Nobody: 6:41pm On Jan 28, 2009
*** I think i need some sleep before these guys scatter my head with codes, DHTML yawns and fell asleep dreaming of php & mysql
Re: Problems With Mysql by Nobody: 9:15am On Jan 29, 2009
been long i seen u here kehers, whats happening?
Re: Problems With Mysql by kehers(m): 5:18pm On Jan 30, 2009
@webdezzi
Been busy wt a lot of sku work and hardly come online ds days. Hopefully, I will b fully back real soon
Re: Problems With Mysql by Nobody: 9:08pm On Jan 31, 2009
no problem, we see wen we see
1 Reply

Please Help Me Out With Mysql DistinctHaving Problems With Graphcard?Building Dynamic Websites With MySQL And PHP234

Bulk Text Messaging WebsiteDomain Names For SaleProblem Buying Foreign Domain Name