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);

Link to comment
Share on other sites

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..?

Edited by sagisgirl
Link to comment
Share on other sites

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... :(

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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..?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.