Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,157,940 members, 7,835,132 topics. Date: Tuesday, 21 May 2024 at 05:33 AM

Problems With Mysql - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Problems With Mysql (710 Views)

Please Help Me Out With Mysql Distinct / Having Problems With Graphcard? / Building Dynamic Websites With MySQL And PHP (2) (3) (4)

(1) (Reply) (Go Down)

Problems With Mysql by dammy009: 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)

hello / Can Any Body Host 1gb For Me For 5k I Need It Now / How Do I Remove Mcafee Anti Virus

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.