Web Analytics Made Easy -
StatCounter Got an "Unknown system variable 'companies_registered'" error message - CodingForum

Announcement

Collapse
No announcement yet.

Got an "Unknown system variable 'companies_registered'" error message

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Got an "Unknown system variable 'companies_registered'" error message

    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

    PHP Code:
    $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~

  • #2
    replace

    PHP Code:
    $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
    PHP Code:
    $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'"
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

    Comment


    • #3
      worked, thanks a lot,

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

      Comment


      • #4
        you're welcome.

        when in doubt, check the manual...
        Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

        Comment

        Working...
        X