[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 09-02-2003, 01:33 PM   #1 (permalink)
Senior Member
 
Join Date: May 2003
Posts: 2,211
6,170.25 NP$ (Donate)

adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough

Breast Cancer
php and phpmyadmin and a database full of tables

hey people

anyone use phpmyadmin?

u see on the left frame once you selected a database it shows links to the tables


how would i selelect them

i looked at the phpmyadmin code and its all confusing


cheers
adam_uk is offline  
Old 09-02-2003, 07:25 PM   #2 (permalink)
Senior Member
 
Join Date: Aug 2002
Posts: 1,300
2.85 NP$ (Donate)

deadserious has a spectacular aura aboutdeadserious has a spectacular aura about


You can click on the table you want to work with, then up at the top you should see some links like:

[ Browse ] [ Select ] [ Insert ] [ Empty ] [ Drop ]

You can then select the field you want to work with and click one of them links and go from there to insert data, select data, etc..

Optionally you can run queries directly by typing them in the text area where it says:

Run SQL query/queries on database DbName :

For example, if you have a table named friends and type the following in the text area:

select * from friends;

It will select everything from that table and present it in a nicely formatted table for you.
deadserious is offline  
Old 09-03-2003, 08:14 AM   #3 (permalink)
Senior Member
 
Join Date: May 2003
Posts: 2,211
6,170.25 NP$ (Donate)

adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough

Breast Cancer
ahhhhhh sorry you have mis understood me


i want to create my own version (or at leaslest select the tables and then add them to a drop down box)

i know how to use phpmy admin


i just dont know how to select the names of the tables from a database in php
adam_uk is offline  
Old 09-03-2003, 01:20 PM   #4 (permalink)
Senior Member
 
Join Date: May 2003
Posts: 2,211
6,170.25 NP$ (Donate)

adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough

Breast Cancer
ive sussed it now cheers

PHP Code:
<?

echo "<select name='adasd'>";
$dbname="contentsystem";
$result = mysql_list_tables($dbname);
while(
$row = mysql_fetch_row($result)){
echo
"<option value='$row[0]<br>n'>$row[0]<br>n";
    }
mysql_free_result($result);
echo
"</select>";
?>
this will display the tables that are in a database
adam_uk is offline  
Old 09-03-2003, 02:37 PM   #5 (permalink)
Senior Member
 
Join Date: Aug 2002
Posts: 1,300
2.85 NP$ (Donate)

deadserious has a spectacular aura aboutdeadserious has a spectacular aura about


Quote:
Originally posted by adam_uk
ahhhhhh sorry you have mis understood me
I don't think I misunderstood you, but rather you didn't ask your question very well. You can't just expect someone to read your mind. It's really a waste of time for others to help you when you ask questions that really say nothing about what you're actually wanting to do and they try to help you out and you come back with what you should have said in the first place. If you read your original question I think you'll see that I did in fact answer exactly what you asked. You need to put a little thought and effort into your questions.
Quote:
Originally posted by adam_uk
i want to create my own version (or at leaslest select the tables and then add them to a drop down box)

i know how to use phpmy admin


i just dont know how to select the names of the tables from a database in php
And you see with a little thought and effort on your part you could have came up with that in the first place.

I believe I have told you this before and I'm not saying you do this intentionally or anything, but I think you should be aware of it because you do it often and I think it will help you and others that may be trying to help.

By the way, here's my version:
PHP Code:
echo "<select name=tables size=1>n";

    
$result = mysql_query("SHOW tables");
    while(
$row = mysql_fetch_row($result)){
        print
"<option>$row[0]n";
  }
echo
"</select>n";
:beer:
deadserious is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 08:10 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85