...

View Full Version : Got an "Unknown system variable 'companies_registered'" error message



pinch
09-28-2006, 10:55 AM
Hi All,

i got this

Unknown system variable 'companies_registered'

message when i execute the page.

this is where i have 'companies_registered' in the source codes


$c_name = $row_User['c_name'];
$c_reg = $row_User['c_reg'];
$update_score_sql = "SET companies_registered (bee_rating, o_score, sr_score, ee_score,";
$update_score_sql .= " sd_score, pp_score, ed_score, si_score, ind_spec_score) VALUES";
$update_score_sql .= " ('$total_bee_score', '$ownership_score', '$sr_score', '$ee_score',";
$update_score_sql .= " '$sd_score', '$pp_score', '$ed_score', '$si_score', '$ind_spec_score')";
$update_score_sql .= " WHERE tbc_product_serial = '$v_serials'";
$insert_score_sql = "INSERT INTO companies_registered VALUES ('$total_bee_score',";
$insert_score_sql .= " '$ownership_score', '$sr_score', '$ee_score', '$sd_score', '$pp_score',";
$insert_score_sql .= " '$ed_score', '$si_score', '$ind_spec_score', '$c_name', '$c_reg',";
$insert_score_sql .= " '$v_serials')";

mysql_select_db($database_MySQL, $MySQL);
$query_list = "SELECT * FROM companies_registered WHERE tbc_product_serial = '$v_serials'";

if (mysql_query($query_list, $MySQL)){
$update_result = mysql_query($update_score_sql) or die(mysql_error());
echo "Your BEE Score have been updated";
}
else{
$update_result = mysql_query($insert_score_sql) or die(mysql_error());
echo "Your BEE Score have been uploaded";
}


'companies_registered' is a table name for a table in the mysql database.

i have no idea how this happened, please help, thanks~

raf
09-28-2006, 12:11 PM
replace



$update_score_sql = "SET companies_registered (bee_rating, o_score, sr_score, ee_score,";
$update_score_sql .= " sd_score, pp_score, ed_score, si_score, ind_spec_score) VALUES";
$update_score_sql .= " ('$total_bee_score', '$ownership_score', '$sr_score', '$ee_score',";
$update_score_sql .= " '$sd_score', '$pp_score', '$ed_score', '$si_score', '$ind_spec_score')";
$update_score_sql .= " WHERE tbc_product_serial = '$v_serials'";

by


$update_score_sql = "UPDATE companies_registered SET
bee_rating='$total_bee_score',
o_score='$ownership_score',
sr_score='$sr_score',
ee_score='$ee_score',
sd_score='$sd_score',
pp_score='$pp_score',
ed_score='$ee_score',
si_score='$si_score',
ind_spec_score='$ind_spec_score'
WHERE tbc_product_serial = '$v_serials'";

pinch
09-28-2006, 12:47 PM
worked, thanks a lot,

so stupid of me, i forgot how to use sql syntax for update

raf
09-28-2006, 12:53 PM
you're welcome.

when in doubt, check the manual...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum