Lokolo Posted November 16, 2007 Share Posted November 16, 2007 http://pastebin.com/m66e4c3a0 I pasted it on there. Now I have counted the {'s brackets and its not that, but I cannot see anything else. I just thought 2+ heads is better than 1. Its line 14 btw. (although my actual page is a lot larger but I thought I only needed that part). Thanks for any help Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted November 16, 2007 Share Posted November 16, 2007 You can't have a quoted array index inside a double quoted string. Change this: <?php $buildingnameDB = mysql_query("SELECT name FROM buildings WHERE ID = $_POST['BuildingID']"); ?> to one of the following: <?php $buildingnameDB = mysql_query("SELECT name FROM buildings WHERE ID = " . $_POST['BuildingID']); $buildingnameDB = mysql_query("SELECT name FROM buildings WHERE ID = {$_POST['BuildingID']}"); $buildingnameDB = mysql_query("SELECT name FROM buildings WHERE ID = $_POST[buildingID]"); ?> My preferences is the first format. Other people like the second. Ken Quote Link to comment Share on other sites More sharing options...
Lokolo Posted November 16, 2007 Author Share Posted November 16, 2007 Ok I have been told this before, but in such a way that it just goes right over my head. (I have always learn that " " for strings, ' ' for ints, but I can't use " " so I went for ' ' but this also doesn't work in this case). So for things like SESSION and POST, inside the square brackets, should I always try and use quotes of some sort, but why? Thanks if you can explain in simple Lokolo terms p.s. omg why did i not see it, the lines below have the quotes taken out of them ARGH Quote Link to comment Share on other sites More sharing options...
revraz Posted November 16, 2007 Share Posted November 16, 2007 Not sure who told you about Quotes, but that really is not correct. Quotes have more to do with Variables than Strings or Int data types. Double Quotes will let you display a String that includes Variables. Single Quotes will let you display a String that is exactly as shown, ie. $variable="Hello" echo "This will print Hello: $variable"; echo 'This will print $variable: $variable'; Ok I have been told this before, but in such a way that it just goes right over my head. (I have always learn that " " for strings, ' ' for ints, but I can't use " " so I went for ' ' but this also doesn't work in this case). Quote Link to comment Share on other sites More sharing options...
brendan6 Posted November 16, 2007 Share Posted November 16, 2007 Wow...i didnt even know you could carry if/else structures over multiple php blocks....heh happy i looked at this post 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.