Jump to content

[SOLVED] SQL Quickie


eits

Recommended Posts

Hi I am using:

$query_conn = "SELECT * FROM tblcustomer WHERE clientname = 'zoe'";   

 

It works to get user zoe details out of DB - however, if I try and get data from a selectbox using:

 

$query_conn = "SELECT * FROM 'tblcustomer' WHERE 'clientname' = " . $_POST['clientdd'];

 

I get the 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 '' at line 1

Link to comment
https://forums.phpfreaks.com/topic/68215-solved-sql-quickie/
Share on other sites

This still gives me:

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 ''tblcustomer' WHERE 'clientname' = ' '' at line 1

 

It may be worth noting that the code that works:

//$query_conn = "SELECT * FROM tblcustomer WHERE clientname = 'zoe'";

 

doesn't work if i put  ' and ' either side of tblcustomer.

Link to comment
https://forums.phpfreaks.com/topic/68215-solved-sql-quickie/#findComment-342935
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.