Can anyone tell me what the problem, is with this?
Here is my output for:
tenant for Deletion: 1
Tenant ID: 00054
tenant for Deletion: 2 Tenant ID: 00054
(with 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 '00054'' at line 1
for this code:
include('dbconnect.php');
echo "tenant for Deletion: 1" . $tenant_name . "<BR>Tenant ID: " . $tenant_ID . "<BR><BR>";
$query = ("SELECT * FROM `tenant_profile` WHERE `tenant_ID` = `$tenant_ID`");
echo "tenant for Deletion: 2 " . $tenant_name . "Tenant ID: " . $tenant_ID . "<BR><BR>";
$result = mysql_query($query) or die (mysql_error());
Query Not working?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Backticks are reserved for table and column names
Code: Select all
$query = ("SELECT * FROM `tenant_profile` WHERE `tenant_ID` = '$tenant_ID'");Oh, ok, thanks
Had been having troulbe between that, and now I get this with that correction:
Unknown column 'tenant_ID' = '00057'' in 'where clause'
Here is part of the table structure that involves that.
tenant_ID int(5) UNSIGNED ZEROFILL No auto_increment
client_ID varchar(4) latin1_swedish_ci No
client_name varchar(30) latin1_swedish_ci No
client_email varchar(20) latin1_swedish_ci No
month_filed char(2) latin1_swedish_ci
Had been having troulbe between that, and now I get this with that correction:
Unknown column 'tenant_ID' = '00057'' in 'where clause'
Here is part of the table structure that involves that.
tenant_ID int(5) UNSIGNED ZEROFILL No auto_increment
client_ID varchar(4) latin1_swedish_ci No
client_name varchar(30) latin1_swedish_ci No
client_email varchar(20) latin1_swedish_ci No
month_filed char(2) latin1_swedish_ci