Jump to content

Syntax error help


mishasoni

Recommended Posts

PHP newbie here -

 

I am getting the following sql syntax error:

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'begins with B ORDER BY NameLast ASC LIMIT 0, 30' at line 1"

 

I believe this error is referring to the below section of code:

 

if (isset($_GET['firstletter'])) {

  $firstletter = $_GET['firstletter'];

}

 

$query_rsParticipants = "SELECT * FROM Contacts WHERE ContactType = 'Scientist' AND ContactID_pk <> 0 AND NameLast begins with $firstletter ORDER BY NameLast ASC";

 

 

 

Can anyone tell me what the error is? 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/127791-syntax-error-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.