Hi everyone,
I am a newbie at programming so I would appreciate any help I can get! I'm sure its very simple but I don't have enough knowledge to fix it:
For some reason, I get an unexpected T_STRING error for the following code: (I am trying to extract information from a database)
$sql = “SELECT user_name FROM Valid_User
WHERE user_name = ‘$user_name’
AND password = md5(‘$user_password’)”;
Does anyone know what is wrong?
Thanks!
Parse error "unexpected T_STRING "
Moderator: General Moderators
First, you must show us exactly what the full error message was and then the code on the exact line number that was in the error message.
What you showed us just the assignment of a string that should be an SQL statement. That's almost surely not the line that contains the error. Oh, unless it's actually broken up into several lines, as you have shown. That would give you an error, because you can't break a PHP string with line breaks. You would need to concatenate several strings or do it all on one line.
What you showed us just the assignment of a string that should be an SQL statement. That's almost surely not the line that contains the error. Oh, unless it's actually broken up into several lines, as you have shown. That would give you an error, because you can't break a PHP string with line breaks. You would need to concatenate several strings or do it all on one line.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: