SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What does "090 Error on query" mean?

    I'm trying to configure the Phorm script so that all form entries will be logged to a database (table named "customers").

    I'm getting this error when I submit the form:

    090 - Error on query: insert into customers (name, email, companyname, street, zip, city, country, phone, fax) values ('Marina','whatever@host.com','MyCompany','','','','','','')

    Does anyone know what's causing this error?

  2. #2
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My configuration file contains the following variable definitions:
    PHP Code:
    $DHost "localhost";
    $DUser "my_username";
    $DPass "mypassword";
    $DBase "marina_customers";
    $PHORM_MYTABLE "customers";
    $PHORM_MYVARS  "name=name, email=PHORM_FROM, companyname=companyname, street=street, zip=zip, city=city, country=country, phone=phone, fax=fax"
    The code that's supposet to write to database:
    PHP Code:
    /*  Log to MySQL Database */
      
    $ph_section "db log";
      if (
    $ph_dbOpen && $lPHORM_MYTABLE && $lPHORM_MYVARS && !$ph_Abort) {
        if (
    $ph_debug2) echo "<B>JS:</B> MySQL Logger.<BR>";
        while (
    $lPHORM_MYTABLE && $lPHORM_MYVARS) {
          
    $ph_CVPairs explode(","$lPHORM_MYVARS);
          
    $ph_idx = -1;
          
    $ph_Vals "'";
          
    $ph_Cols "";
          while (list(,
    $ph_CVPair) = each($ph_CVPairs)) {
            list(
    $ph_Col$ph_Var) = explode("="$ph_CVPair);
            if (
    strlen($ph_Cols) > 1$ph_Cols.= ",";
            if (
    strlen($ph_Vals) > 1$ph_Vals.= ",'";
    //      If $$ph_Var is an array, break it down
            
    ereg("^([A-Za-z0-9_]*)((\[[A-Za-z0-9_]*\])*)$"$ph_Var$ph_regs);
            
    $ph_Var $ph_regs[1];
            
    $ph_indices split("\]\["ereg_replace("^\[|\]$"""$ph_regs[2]));
            
    $ph_Value = $$ph_Var$ph_idx 0;
            while (
    is_array($ph_Value))
              
    $ph_Value $ph_Value[$ph_indices[$ph_idx++]];
            if (
    CheckVers("3.0.6")) {
              if (!
    get_magic_quotes_gpc()) $ph_Value AddSlashes($ph_Value);
            }
            else
              if (
    $PHORM_QUOTES$ph_Value AddSlashes($ph_Value);
            
    $ph_Vals.= $ph_Value."'";
            
    $ph_Cols.= $ph_Col;
          }
          
    $ph_LOGQString "insert into $lPHORM_MYTABLE ($ph_Cols) values ($ph_Vals)";
          if (
    $ph_debug72) echo "<B>Log:</B> $ph_LOGQString<BR>";
          
    $ph_Result MySQL_Query($ph_LOGQString$ph_ID);
          
    $ph_LOGMyErr ereg_replace("[^A-z0-9'., ]","",MySQL_Error());
          if (!
    $ph_Result$ph_Alerts['090'] = "### - Error on query:\n   $ph_LOGQString\n MySQL says: $ph_LOGMyErr";
          else 
    $ph_dbLogged true;
          if (
    is_array($PHORM_MYTABLE) && is_array($PHORM_MYVARS)) {
            
    $PHORM_MYSQLID[] = MySQL_Insert_ID($ph_ID);
            list(
    $ph_nul$lPHORM_MYTABLE) = each($PHORM_MYTABLE);
            list(
    $ph_nul$lPHORM_MYVARS) = each($PHORM_MYVARS);
          }
          else {
            
    $PHORM_MYSQLID MySQL_Insert_ID($ph_ID);
            
    $lPHORM_MYTABLE "";
            
    $lPHORM_MYVARS "";
          }
        }
        
    $ph_GotData = ($ph_GotData || $ph_dbLogged);
      } 

  3. #3
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now it works!
    I just changed email=PHORM_FROM to email=email...

    That took me about a week to figure out...


Bookmarks

Posting Permissions

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