简体   繁体   中英

Unknown column 'tr' in where clause

I have this MySQL query, which is failing every time:

update exp_companies set company = 'Some Intermodal Container Company', auth_user = 'Some User', c_code = 'SICC', contact = 'Somes Boss', ph = '012-555-1234' where uid = 3

The error I get is:

mySQL Error 1054: Unknown column 'tr' in 'where clause'

I have never encountered this before. I have expressed this query many ways, omitting parts, etc. But nowhere in the query there is column 'tr', mentioned in error, yet it fails.

if($opi == "exp_commit") {

   $dbi = sql_connect($dbhost, $dbuname, $dbpass, $mydb);

   $query = "select * from wmd_companies where uid = $new_scac";

   $result = sql_query($query, $dbi);

    if(!$result) { mydb_error($dbi, $query); }
      $scac_row = mysql_fetch_row($result);
      $scac_company = $scac_row[1];  
      $scac_code = $scac_row[2];   
      $scac_contact = $scac_row[3];
      $scac_ph = $scac_row[4];
      $scac_email = $scac_row[5];

      $exp_query = "update exp_companies set company = '$scac_company', auth_user = '$dr_name', c_code = '$scac_code', contact = '$scac_contact', ph = '$scac_ph', company_email = '$scac_email' where uid = $exp_id"; 

   $result = sql_query($exp_query, $dbi);


  if (!$result) { mydb_error($dbi, $exp_query); }
     echo "Success! <meta http-equiv=refresh content=\"2;      URL=admin.php?opi=admin&what=list\"> $b";

  }

使用 '$new_scac' 使用字符串来修复它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM