Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> An Sql Problem In Php, returnin the name of the tables
spy_charly
post Dec 17 2005, 04:04 AM
Post #1


Premium Member
********

Group: Members
Posts: 195
Joined: 18-November 05
Member No.: 14,521



hello again guys!, i was wondering if there is a way to get the table names from my database using php. Well what i want to do is to get the name of the tables returned as an array or something similar...
thanx in advance
Go to the top of the page
 
+Quote Post
rvalkass
post Dec 17 2005, 11:22 AM
Post #2


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,153
Joined: 28-May 05
From: Devon, England
Member No.: 7,593
Spam Patrol



You can use an SQL command to list all of the table names in a database.

For example:
CODE

<?php
mysql_connect(localhost,username,password);
$query = "SHOW TABLES FROM database";
$tables = mysql_query($query);
?>


The variable $tables will then contain all of the names of the tables.

Hope this helps you.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Billing Problem. Plz Help(2)
  2. Problem With My Pc(2)
  3. Problem Concerning Credits Reduced(12)
  4. Problem With Hosting(4)
  5. Firefox 3 Cookies Problem(4)
  6. What Is My (power) Problem?(4)
  7. Did You Face Problem Opening Pdf With Firefox?(15)
  8. Attachment Problem In Pmwiki(0)
  9. Pop-up Virus / Trojan Problem(10)
  10. Problem With The Trap17 Forum(4)
  11. Remote Assistance Problem(9)
  12. Counter Strike Problem(2)
  13. Laptop Keyboard Problem(8)
  14. Upload Component - Failed(6)
  15. Hosting Credits Problem? [resolved](9)
  1. Dandruff Problem(29)
  2. 60 Seconds Countdown That Shutdown The Pc(15)
  3. Sharing Files And Printer Between Windows Vista And Xp(9)
  4. Problem Installing Sims 2 Nightlife(26)
  5. I Have A Girl Problem Here(27)
  6. Problem With My Girlfriend Family, Need Suggestions For Action(2)
  7. Problem With Page Redirect(8)
  8. Terminating Hosting Problem(1)
  9. Browser Compatibility Problem With Firefox - Javascript + Css(3)
  10. How Many More Times Will I Have To Post About This?(11)
  11. Domain Problem : This Is Important..(0)
  12. Skype / Xampp Port Conflict(5)
  13. Php Header Problem(11)
  14. A Problem With Ftp Clients(9)
  15. Youtube People That Do Not Respect Other Opinions(7)


 



- Lo-Fi Version Time is now: 12th October 2008 - 07:30 AM