Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2139 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

need some help - froms from mysql db

Thread title: need some help - froms from mysql db
Closed Thread  
Page 2 of 4 < 1 2 3 4 >
    Thread tools Search this thread Display Modes  
09-05-2007, 08:52 PM
#11
pixelgod is offline pixelgod
Status: Member
Join date: Jul 2007
Location: 127.0.0.1
Expertise:
Software:
 
Posts: 110
iTrader: 4 / 100%
 

pixelgod is on a distinguished road

Send a message via MSN to pixelgod

  Old

What should I use instead then?

09-05-2007, 09:04 PM
#12
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Originally Posted by pixelgod View Post
What should I use instead then?
I dont know of a better alternative, your need is very bizare

09-05-2007, 09:27 PM
#13
pixelgod is offline pixelgod
Status: Member
Join date: Jul 2007
Location: 127.0.0.1
Expertise:
Software:
 
Posts: 110
iTrader: 4 / 100%
 

pixelgod is on a distinguished road

Send a message via MSN to pixelgod

  Old

A quick google search turned up nothing, I guess I'll use it then. Why would it be disliked?

09-05-2007, 09:29 PM
#14
Immersion is offline Immersion
Status: Senior Member
Join date: Dec 2005
Location:
Expertise:
Software:
 
Posts: 918
iTrader: 5 / 100%
 

Immersion is on a distinguished road

  Old

print_r it to see what you get to check what kind of array it returns?

If anything...

09-05-2007, 09:37 PM
#15
pixelgod is offline pixelgod
Status: Member
Join date: Jul 2007
Location: 127.0.0.1
Expertise:
Software:
 
Posts: 110
iTrader: 4 / 100%
 

pixelgod is on a distinguished road

Send a message via MSN to pixelgod

  Old

Okay, well, I did find "show tables;"

09-05-2007, 09:49 PM
#16
Wildhoney is offline Wildhoney
Wildhoney's Avatar
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
 
Posts: 1,648
iTrader: 18 / 95%
 

Wildhoney is on a distinguished road

Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney

  Old

Code:
SHOW TABLES
Will give you back an array. Treat it as a standard query.

09-05-2007, 09:50 PM
#17
pixelgod is offline pixelgod
Status: Member
Join date: Jul 2007
Location: 127.0.0.1
Expertise:
Software:
 
Posts: 110
iTrader: 4 / 100%
 

pixelgod is on a distinguished road

Send a message via MSN to pixelgod

  Old

EDIT:



Code:

SHOW TABLES

Will give you back an array. Treat it as a standard query.
thanks


this statement does exactly what I want it to do, except I only want it to show the ones with CMS_ in front, and if possible, remove CMS_.

Code:
<select>
   $result = mysql_list_tables(memem);
     if(mysql_num_rows($result)) {
       while($row = mysql_fetch_array($result))
       {
          echo"<option value=\"$row[0]\">$row[0] $row[category]</option>";
       }
     } 
</select>

09-05-2007, 10:10 PM
#18
Wildhoney is offline Wildhoney
Wildhoney's Avatar
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
 
Posts: 1,648
iTrader: 18 / 95%
 

Wildhoney is on a distinguished road

Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney

  Old

PHP Code:
<select>
    <?php
    
          $szSQL 
"SHOW TABLES LIKE 'cms_%'";
          
$pResult mysql_query($szSQL);
          
          while(
$aRow mysql_fetch_array($pResult))
          {
              
$szTableName preg_replace('/^cms_/i'''$aRow[0]);
              
?><option value="<?php echo $szTableName?>"><?php echo $szTableName?></option><?php
          
}
        
     
?>
</select>

09-05-2007, 10:43 PM
#19
pixelgod is offline pixelgod
Status: Member
Join date: Jul 2007
Location: 127.0.0.1
Expertise:
Software:
 
Posts: 110
iTrader: 4 / 100%
 

pixelgod is on a distinguished road

Send a message via MSN to pixelgod

  Old

Thanks, but I can't get that code to work, it just displays an empty drop down, do I have to change something?

09-05-2007, 11:10 PM
#20
Wildhoney is offline Wildhoney
Wildhoney's Avatar
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
 
Posts: 1,648
iTrader: 18 / 95%
 

Wildhoney is on a distinguished road

Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney

  Old

Nope. It works perfectly for me.

Closed Thread  
Page 2 of 4 < 1 2 3 4 >


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed