Jump to content

Invalid query, syntrax error


jeff5656

Recommended Posts

Thnkx for all help so far.  I have this error message can someone help me?

Invalid query: 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 '1, dos 2 WHERE 1.id_incr = 2.pt_id and id_incr = '8'' at line 1

 

$consultsq1 = "SELECT 1.id_incr, 2.pt_id, 1.rm_loc FROM icu 1, dos 2
					WHERE 1.id_incr = 2.pt_id and id_incr = '" . $_GET['id'] . "'";

Link to comment
https://forums.phpfreaks.com/topic/136264-invalid-query-syntrax-error/
Share on other sites

it could be that the icu 1, dos 2 need to be quoted, otherwise the database will interpret the space as a delimiter instead of just a space.

 

$consultsq1 = "SELECT 1.id_incr, 2.pt_id, 1.rm_loc FROM 'icu 1', 'dos 2' WHERE 1.id_incr = 2.pt_id and id_incr = '" . $_GET['id'] . "'";

 

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.