homepage Welcome to WebmasterWorld Guest from 54.211.7.174
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
"SHOW TABLES FROM $database" doesn't work with underscores?workaround?
carsten888




msg:4109668
 7:41 am on Apr 4, 2010 (gmt 0)

SHOW TABLES FROM '".$database_name."'
I need to test for the existence of a table in the database. This query works fine as long as there are no underscores in the database-name.

Is there a workaround so that this script could deal with underscores in database-names?

 

Readie




msg:4109704
 11:35 am on Apr 4, 2010 (gmt 0)

Backticks, not quotes :)

$sql = 'SELECT TABLES FROM `' . $database_name . '`';

Readie




msg:4109716
 12:55 pm on Apr 4, 2010 (gmt 0)

SHOW TABLES FROM**

Typo sorry, I was a little hung over when I wrote that :)

bizminder




msg:4111245
 8:01 am on Apr 7, 2010 (gmt 0)

Just enter a row into the table assuming it exists, if the row is successfully added then it exists else it does not exist.

Matthew1980




msg:4111249
 8:06 am on Apr 7, 2010 (gmt 0)

This is the trouble with duplicates:-

[webmasterworld.com ]

Solved.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved