phpretard Posted May 12, 2008 Share Posted May 12, 2008 I knoe I Made A Slight Mistake When I Named A Batabase Table With A Space In The Name. Isn't there a work around for that. It's kind of too late for me o go and change the whole thing around. $row="No Good"; $result = mysql_query("SELECT * FROM $row "); Thank you for your help. Quote Link to comment Share on other sites More sharing options...
Fadion Posted May 12, 2008 Share Posted May 12, 2008 Rename the table and run a batch replace of "No Good" with "No_Good" in all your script files. Whats so much of a problem with that? Quote Link to comment Share on other sites More sharing options...
phpretard Posted May 12, 2008 Author Share Posted May 12, 2008 I really didn' want it to display an underscore. Quote Link to comment Share on other sites More sharing options...
phpretard Posted May 12, 2008 Author Share Posted May 12, 2008 Or maybe I don't know what a batch replace is. Quote Link to comment Share on other sites More sharing options...
947740 Posted May 12, 2008 Share Posted May 12, 2008 What is the problem with displaying an underscore? Are you displaying the tablename on the page? Quote Link to comment Share on other sites More sharing options...
phpretard Posted May 12, 2008 Author Share Posted May 12, 2008 Yes It Goes on the page and doesn't look right. Quote Link to comment Share on other sites More sharing options...
947740 Posted May 12, 2008 Share Posted May 12, 2008 You could do a string replace. Quote Link to comment Share on other sites More sharing options...
radar Posted May 12, 2008 Share Posted May 12, 2008 A little tip for databases: database, table names, and column names should NOT have a space in them.. so in that case the column name should be No_Good... if its a row you are looking to find that has a space in it, you would then say insert a row where No_Good = No Good or whatever... then your query would theoretically work. as it would get everything inside the table No_Good the information from there would then be shown with no spaces... make sense at all? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted May 12, 2008 Share Posted May 12, 2008 use back-ticks. $result = mysql_query("SELECT * FROM `$row` "); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.