Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
- New php-forum User
- Posts: 13
- Joined: Mon Mar 31, 2014 1:15 pm
I have the following code which is giving the following error:
( ! ) Parse error: syntax error, unexpected ';' in C:\wamp\www\process-6.php on line 18 (the select from line)
Its a simple code, Name comes from a posted form field, user-name is the field name in the table.
Clearly simple but not simple enough for me. Any help gratefully appreciated.
Code: Select all
mysql_select_db($database) or die("Error connecting to database: ".mysql_error());
$username = $_POST['Name'];
$query = ("SELECT * FROM Users WHERE User-Name = '$username'";
- php-forum Fan User
- Posts: 973
- Joined: Mon Oct 01, 2012 12:32 pm
also, User-Name is a bad field name. if you're going to do compound words use underscore. Otherwise, you have to quote the names so that it's not interpreted to be user minus name.
Who is online
Users browsing this forum: Baidu [Spider] and 5 guests