Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 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
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    worked, thanks a lot,

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

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •