Jump to content

Query Failed: Unknown Column 'tenantid' In 'where Clause'


sagisgirl

Recommended Posts

I am getting the following error and can not figure out why:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

 

so, i made a bit changes to my code here

$rs_recTuser = mysql_query($query_recTuser)

 

to this

 

$rs_recTuser = mysql_query($query_recTuser) or die ('Query failed: ' . mysql_error(). "<br />\n$query_recTuser");

 

then a new error came :

 

Query failed: Unknown column 'tenantID' in 'where clause'

SELECT * FROM u_user WHERE tenantID = 9

 

here is my code:

 

$query_recTuser = "SELECT * FROM u_user WHERE tenantID = ".$tenantID;
$rs_recTuser = mysql_query($query_recTuser) or die ('Query failed: ' . mysql_error(). "<br />\n$query_recTuser");
$totalRows_recTuser = mysql_num_rows($rs_recTuser);

thank you..it worked fine now..thanks...

 

but i got another error.:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

 

here is the code

 

$query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID;
$rs_recTenantID = mysql_query($query_recTenantID);
$recTenantID = mysql_fetch_array($rs_recTenantID);

 

why is that error occur..?

is it like this

 

$query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID;
$rs_recTenantID = mysql_query($query_recTenantID);
echo mysql_error();
$recTenantID = mysql_fetch_array($rs_recTenantID);

 

still got the error..

 

im new in php..so please do understand me... :(

i already create column for tenantID... the error is still the same even after i add

 

echo mysql_error();

 

here are 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

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

If you echo out the SQL query as well, you should notice what's missing from it. From there you should be able to determine what the problem is, and by tracing the problem upwards in the code you should find the cause.

ok...i did that echo like this..

 

$query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID;
$rs_recTenantID = mysql_query($query_recTenantID);
while($recTenantID = mysql_fetch_array($rs_recTenantID))
{ echo $recTenantID['tenantID']; }

 

but still i got the same error...

ok i change my code to this..

 

$query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID;
$rs_recTenantID = mysql_query($query_recTenantID) or die ('Query failed: ' . mysql_error(). "<br />\n $query_recTenantID");
while($recTenantID = mysql_fetch_array($rs_recTenantID))
{ echo $recTenantID['tenantID']; }

 

then it give an error :

 

Parse error: syntax error, unexpected ')'

 

why..?

suddenly it give me a new error :

 

Query failed: 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

SELECT * FROM md_tenant WHERE tenantID =

 

why...??

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.