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";
}
use '$new_scac' use the string to fix it.