Thread: PHP mysql error
View Single Post
Old 09-03-2012, 03:03 PM   PM User | #19
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,505
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Yes and even the php manual confirms that its ok to do what I showed:

PHP Code:
// The following is okay, as it's inside a string. Constants are not looked for
// within strings, so no E_NOTICE occurs here
print "Hello $arr[fruit]";      // Hello apple 
For some reason a few of you in this thread seem to think that I had missed out the single quotes inside the square brackets despite being an sql query wrapped in double quotes. I'm perplexed as to why you all seem to think I've got it so dreadfully wrong when as shown above, the php manual clearly shows this technique is 'okay'.

To quote:
Quote:
as it's inside a string. Constants are not looked for within strings
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.

Last edited by tangoforce; 09-03-2012 at 03:08 PM..
tangoforce is offline   Reply With Quote