CRO8 Posted April 22, 2004 Posted April 22, 2004 Hello All I must say I am impressed with TCH. Very nice. I am using php/mysql. My question involves the sql query in my .php file receiving the info passed from html file. Now this query works >$result = mysql_query ("SELECT column_1 FROM table_1 WHERE id LIKE '".$id."'"); This works fine. I pass an id of 1 and the correct table row prints. Now, if I am using multiple tables (see below)- I get error messages. Below is based off of what I am trying to do. I tried to replicate the code I am using as best I could- w/o actually revealing names of tables, etc. >$result = mysql_query ("SELECT column 1, column 2, column 3 FROM table 1, table 2, table 3 WHERE id = '".$id.2"' AND id = '".$id.3."' AND id.3 = '".$1."' ORDER BY column 1"); Can PHP read spaces in table names? Quote
MikeJ Posted April 22, 2004 Posted April 22, 2004 It's generally a bad idea to have spaces in your tables names, but I believe it can be done by using back ticks (`) in the query. >$result = mysql_query ("SELECT `column 1`, `column 2`, `column 3` FROM `table 1`, `table 2`, `table 3` WHERE id = '".$id.2"' AND id = '".$id.3."' AND id.3 = '".$1."' ORDER BY `column 1`"); You could give that a try. Quote
CRO8 Posted April 22, 2004 Author Posted April 22, 2004 nice- thanks Mike J. I'll give that a shot and see what I can do. Quote
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.