Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Technical Support » Other » PHP issue
Re: PHP issue [message #438948 is a reply to message #438943] Fri, 05 November 2010 17:18 Go to previous messageGo to previous message
Crimson is currently offline  Crimson
Messages: 7429
Registered: February 2003
Location: Phoenix, AZ
Karma:
General (5 Stars)
ADMINISTRATOR
The problem was that you need to put curly braces around an array reference when it's in a string like that.

"SELECT * FROM books WHERE bookid = {$_POST['bookid']}"

The curly braces tell the PHP parser where the variable starts and ends because when you start adding symbols, it gets confused.

The $var way works, too, but it creates messier, harder-to-read code.

(Of course, since you're a beginner, I won't point out the XSS flaws.)


I'm the bawss.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GameSpy
Next Topic: Generals... AGAIN
Goto Forum:
  


Current Time: Fri Nov 22 19:46:48 MST 2024

Total time taken to generate the page: 0.01131 seconds