OT: MySQL Error #1064

I used phpMyAdmin to insert several new rows in a database
table, then I
suddenly hit a brick wall with this error message:
MySQL said:
#1064 - You have an error in your SQL syntax; check the
manual that
corresponds to your MySQL server version for the right syntax
to use
near '(`Key2`, `ID`, `Site2`, `Articles`, `Contents`,
`Links`) VALUES
('19', 'China'' at line 1
I think this is the same error message I used to get on my PC
every now
and then. It doesn't offer any clues as to the nature of the
problem,
and it isn't easy to track down via Google.
I think I either fixed it or found a workaround once before,
but I can't
recall the solution. I don't know if it was a related problem
or
something entirely different, but I think I recall a
situation where my
database table's cardinality was limited to a certain number,
and it
wouldn't allow me to insert any additional rows for some
reason. But I
don't know if that's the problem in this case or not.
Does anyone have any suggestions?

David Powers wrote:
> David Blomstrom wrote:
>> I used phpMyAdmin to insert several new rows in a
database table, then
>> I suddenly hit a brick wall with this error message:
>>
>> MySQL said:
>> #1064 - You have an error in your SQL syntax; check
the manual that
>> corresponds to your MySQL server version for the
right syntax to use
>> near '(`Key2`, `ID`, `Site2`, `Articles`,
`Contents`, `Links`) VALUES
>> ('19', 'China'' at line 1
>>
>> I think this is the same error message I used to get
on my PC every
>> now and then. It doesn't offer any clues as to the
nature of the problem,
>
> The error message has nothing to do with PC or Mac. It's
a MySQL error
> message, and it's very precise. It not only tells you
that you have a
> syntax error in your SQL query; it tells you exactly
where the error is:
> near '(`Key2`, `ID`,...'
>
> In other words, the syntax error immediately precedes
(`Key2`, `ID`,...
>
> You need to examine the SQL itself to determine the
nature of the syntax
> error.
>
Thanks for the tip, though I'm still confused. I simply used
phpMyAdmin
to insert a new row, then began by typing "19" into the first
available
space. There is nothing before that. I don't know how to
examine the
"SQL itself," as there is none that I'm aware of.
I simply inserted a few values, as I had done on several
previous
occasions. I then experimented by NOT inserting certain
values and by
inserting different values, but nothing worked.
I tracked "1064" through Google, and the problems appear to
be all over
the map. One guy said his database table was too big, and he
solved the
problem by breaking it up into several smaller tables.
At any rate, I finally created a new table and imported a CSV
file that
automatically filled a few fields for several hundred rows.
That
automatically created the rows I need, and I was then able to
insert
articles where needed.
Thanks.

Similar Messages

  • Problems with java and mysql error: 1064

    Hello,
    I have been struggling with the following java code for a day. I ALWAYS get the following error code : 1064 and I just can't figure out why. I am trying to insert data into a mysql table.
    Can anyone please help?
    Thanks in advance,
    Julien.
    package com.newedgegroup.pnr.misc;
    import java.sql.BatchUpdateException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    * @author Julien Martin
    public class RunDataCopy {
        public static void main(String[] args) throws ClassNotFoundException, Exception , ParseException {
            Class.forName("com.ibm.as400.access.AS400JDBCDriver");
            String url_source = "jdbc:as400://as400a.calyonfinancial.com";
            Connection con_source = DriverManager.getConnection(url_source, "upload", "upload");
            Class.forName("com.mysql.jdbc.Driver");
            String url_target = "jdbc:mysql://localhost:3306/pnr";
            Connection con_target = DriverManager.getConnection(url_target, "root", "");
            Statement stat_source = con_source.createStatement();
    //        ResultSet rs_source = stat_source.executeQuery("select * from QS36F.GMIST4F1 po");
            String query = "SELECT " +
                    " sum (po.PGROSS) AS OPTION_PREMIUM, " +
                    "po.PFIRM, " +
                    "po.POFFIC, " +
                    "po.PACCT, " +
                    "po.PTDATE, " +
                    "po.PRR, " +
                    "po.PEXCH, " +
                    "po.PSUBEX, " +
                    "po.PFC, " +
                    "po.PSYMBL, " +
                    "po.PCLASS, " +
                    "po.PSUBCL, " +
                    "po.PSUBTY, " +
                    "po.PSDSC1, " +
                    "po.PCTYM, " +
                    "po.PSTRIK, " +
                    "po.PCLOSE, " +
                    "po.PUNDCP, " +
                    "po.PCURSY, " +
                    "po.PEXPDT, " +
                    "po.PLTDAT, " +
                    "po.PMULTF, " +
                    "po.PPTYPE, " +
                    "po.PBS " +
                    "FROM QS36F.GMIST4F1 as po " +
                    "WHERE " +
                    "0              = 0 " +
                    "AND po.PFIRM   = 'I' " +
                    "AND po.POFFIC  = '349' " +
                    "AND po.PRECID in ('T','B','Q') " +
                    "AND po.PSUBTY != ' ' " +
                    "AND po.PCMNT1 != ' E' " +
                    "AND po.PCMNT1 != ' A' " +
                    "GROUP BY " +
                    "po.PFIRM, " +
                    "po.POFFIC, " +
                    "po.PACCT, " +
                    "po.PTDATE," +
                    "po.PRR, " +
                    "po.PEXCH, " +
                    "po.PSUBEX," +
                    "po.PFC, " +
                    "po.PSYMBL, " +
                    "po.PCLASS, " +
                    "po.PSUBCL, " +
                    "po.PSUBTY, " +
                    "po.PSDSC1, " +
                    "po.PCTYM, " +
                    "po.PSTRIK, " +
                    "po.PCLOSE, " +
                    "po.PUNDCP, " +
                    "po.PCURSY, " +
                    "po.PEXPDT, " +
                    "po.PLTDAT, " +
                    "po.PMULTF, " +
                    "po.PPTYPE, " +
                    "po.PBS ";
            // System.out.println(query);
            ResultSet rss = stat_source.executeQuery(query);
            StringBuffer sb = new StringBuffer("");
            SimpleDateFormat df_s = new SimpleDateFormat("yyyyMMdd");
            SimpleDateFormat df_t = new SimpleDateFormat("yyyy-MM-dd");
            con_target.setAutoCommit(false);
            Statement stat_target = con_target.createStatement();
            int i = 0;
            try {
                while (rss.next()) {
                    i++;
                    sb.append("INSERT INTO `pnr`.`pnr_transaction` (").append("\n");
                    sb.append("`FIRM_ID`,").append("\n");
                    sb.append("`OFFICE_NUMBER`,").append("\n");
                    sb.append("`ACCOUNT_NUMBER`,").append("\n");
                    sb.append("`SALESMAN`,").append("\n");
                    sb.append("`EXCHANGE_CODE`,").append("\n");
                    sb.append("`SUBEXCHANGE`,").append("\n");
                    sb.append("`FUTURES_CODE`,").append("\n");
                    sb.append("`SYMBOL`,").append("\n");
                    sb.append("`ACCOUNT_CLASS_CODE`,").append("\n");
                    sb.append("`SUB_CLASS_CODE`,").append("\n");
                    sb.append("`SECURITY_SUB_TYPE`,").append("\n");
                    sb.append("`SECURITY_DESCRIPTION_LINE`,").append("\n");
                    sb.append("`CONTRACT_YR_MON`,").append("\n");
                    sb.append("`STRIKE_PRICE`,").append("\n");
                    sb.append("`CLOSING_MARKET_SETTLEMENT_PRICE`,").append("\n");
                    sb.append("`UNDERLYING_CLOSE_PRICE`,").append("\n");
                    sb.append("`PRODUCT_CURRENCY_SYMBOL`,").append("\n");
                    sb.append("`EXPIRATION_DATE`,").append("\n");
                    sb.append("`LAST_TRADING_DATE`,").append("\n");
                    sb.append("`MULTIPLICATION_FACTOR`,").append("\n");
                    sb.append("`PRODUCT_TYPE_CODE`,").append("\n");
                    sb.append("`CATEGORY_ID`,").append("\n");
                    sb.append("`MARKET_TYPE_ID`,").append("\n");
                    sb.append("`TAX_STATUS_ID`,").append("\n");
                    sb.append("`AMOUNT`").append("\n");
                    sb.append(") VALUES (").append("\n");
                    sb.append("'").append(rss.getString("PFIRM")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("POFFIC")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PACCT")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PRR")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PEXCH")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PSUBEX")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PFC")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PSYMBL")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PCLASS")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PSUBCL")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PSUBTY")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PSDSC1")).append("'").append(",").append("\n");
                    sb.append("'").append(rss.getString("PCTYM")).append("'").append(",").append("\n");
                    sb.append(rss.getString("PSTRIK")).append(",").append("\n");
                    sb.append(rss.getString("PCLOSE")).append(",").append("\n");
                    sb.append(rss.getString("PUNDCP")).append(",").append("\n");
                    sb.append("'").append(rss.getString("PCURSY")).append("'").append(",").append("\n");
                    sb.append("'").append(df_t.format(df_s.parse(rss.getString("PEXPDT")))).append("'").append(",").append("\n");
                    sb.append("'").append(df_t.format(df_s.parse(rss.getString("PLTDAT")))).append("'").append(",").append("\n");
                    sb.append(rss.getString("PMULTF")).append(",").append("\n");
                    sb.append("'").append(rss.getString("PPTYPE")).append("'").append(",").append("\n");
                    //sb.append(rss.getString("PBS")).append(",");
                    sb.append("1").append(",").append("\n");
                    sb.append("1").append(",").append("\n");
                    sb.append("1").append(",").append("\n");
                    sb.append(rss.getString("OPTION_PREMIUM")).append("").append("\n");
                    // sb.append(df_t.format(df_s.parse(rss.getString("PTDATE")))).append(",");
                    sb.append(") ").append("\n");
                    System.out.println(sb.toString());
                    //     stat_target.executeUpdate(sb.toString());
                    stat_target.addBatch(sb.toString());
    //        stat_target.executeUpdate(sb.toString());
                    if (i == 2) {
                        break;
                stat_target.executeBatch();
                con_target.commit();
            } catch (BatchUpdateException be) {
                System.out.println("be: "+be.getErrorCode());
                System.out.println("be: "+be.getMessage());
                be.printStackTrace();
                System.out.println("be: "+i);
            } catch (SQLException se) {
                System.out.println("se: "+se.getErrorCode());
                System.out.println("se: "+i);
    }

    What is the error message?
    I advice you to use prepared statement for batch inserting.

  • MySQL database 1064 ERROR

        CREATE TABLE 'geodata' (
          'Id' char(16) NOT NULL,
          'Type' smallint(6) DEFAULT NULL,
          'Description' varchar(200) DEFAULT NULL,
          'Url' varchar(400) DEFAULT NULL,
          'Location' point DEFAULT NULL,
          PRIMARY KEY ('Id')
    ERROR 1064:
          'Id' char(16) NOT NULL,
          'Type' smallint(6) DEFAULT NULL, at line1.
    i dont know whats wrong with the table i created.

    Hi,
    This is a forum for MS SQL Server. You should ask this question on a MySQL forum to get better answer to your question.
    I haven't worked with MySQL, but I think SMALLINT does not need length to be specified. Try using below:
    'Type' SMALLINT DEFAULT NULL,
    - Vishal
    SqlAndMe.com

  • LKM for MySQL Error

    Hi,
    Can someone help me please.
    I am new to ODI and trying to work with it.
    My source DB = MS SQL 2005 Server
    Target DB = MySQL5.1
    I created a new project and models. I have the physical and logical architecture and all the connections are working.
    I brought a source table in the diagram ara and a target table(its a empty table in mysql)
    for the source, the LKM is : LKM SQL to SQL
    and for target lKM is : lKM SQL Append
    I am able to execute fine, when I go to operator, in the Integration step, I get the below error:
    1050 : 42S01 : com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'tbl_dim_store' already exists
    com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'tbl_dim_store' already exists
         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Can someone please help me. I have been trying to solve this error for more than a week now.
    Thank you

    Hi,
    Yes, the create target table option was set to true and the target table exists in the target DB. So, I made the create target table option to default No. Now during execution it I see:
    1) Drop table - done
    2) create table - done
    3) load data - done (but i dont see any data in the table)
    *4) Integration - Fails with error:*
    1064 : 42000 : com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from     testingodi.C$_0tbl_dim_store where          (1=1)' at line 1
    com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from     testingodi.C$_0tbl_dim_store where          (1=1)' at line 1
         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    When I go the description column of step 4 I see the following:
    insert into     testingodi.tbl_dim_store
         Store_Num,
         Order_Status,
         Store_Desc,
         Merch_Div_Num,
         Status,
         Status_Desc,
         Open_Date,
         Close_Date,
         Division_Num,
         Division,
         Region_Num,
         District_Num,
         Market_Area_Num,
         Market_Type,
         Ad_Area_Num,
         Ad_Area_Desc,
         Center_Desc,
         City,
         Zip_Code,
         State,
         Mgr_Name,
         FRP_Flag,
         LTA_Days,
         LTA_Ship_Day,
         PI_Inventory_Date,
         FLR_Flag,
         Add_DTime,
         UPD_DTime,
         UPD_User_ID,
         Replen_Type,
         Store_Phone,
         Square_Feet,
         Addr_Line1,
         Addr_Line2,
         Callout_Ind,
         Close_Reason_Code,
         County_Name,
         Demograph_Mkt_Seq,
         Fax,
         Fin_Dist_Num,
         Fin_Div_Num,
         Fin_Inventory_Date,
         Fixture_Type,
         FRP_Invntry_Date,
         Grand_Open_Date,
         Latitude,
         Linear_Ft,
         Longitude,
         Manual_Order_Date,
         Market_Locn_Code,
         Merch_Dist_Num,
         Office_Phone,
         On_Hand_Upd_Date,
         Open_Code,
         Proj_Sales_Amt,
         Project_Code,
         Prototype_Ind,
         Remodel_Date,
         Sales_Qty,
         San_ID,
         Sign_Color,
         Time_Card_Code,
         Trade_Convsn_Num,
         Vacate_Date,
         Vol_Class_Code,
         Wage_Plan_Code,
         Zip_Code_Ext,
         PI_Schedule_Date,
         PI_Music_Inv_Date,
         PI_Music_Schd_Date,
         Last_Modified_Date
    select     
         C1_STORE_NUM,
         C2_ORDER_STATUS,
         C3_STORE_DESC,
         C4_MERCH_DIV_NUM,
         C5_STATUS,
         C6_STATUS_DESC,
         C7_OPEN_DATE,
         C8_CLOSE_DATE,
         C9_DIVISION_NUM,
         C10_DIVISION,
         C11_REGION_NUM,
         C12_DISTRICT_NUM,
         C13_MARKET_AREA_NUM,
         C14_MARKET_TYPE,
         C15_AD_AREA_NUM,
         C16_AD_AREA_DESC,
         C17_CENTER_DESC,
         C18_CITY,
         C19_ZIP_CODE,
         C20_STATE,
         C21_MGR_NAME,
         C22_FRP_FLAG,
         C23_LTA_DAYS,
         C24_LTA_SHIP_DAY,
         C25_PI_INVENTORY_DATE,
         C26_FLR_FLAG,
         C27_ADD_DTIME,
         C28_UPD_DTIME,
         C29_UPD_USER_ID,
         C30_REPLEN_TYPE,
         C31_STORE_PHONE,
         C32_SQUARE_FEET,
         C33_ADDR_LINE1,
         C34_ADDR_LINE2,
         C35_CALLOUT_IND,
         C36_CLOSE_REASON_CODE,
         C37_COUNTY_NAME,
         C38_DEMOGRAPH_MKT_SEQ,
         C39_FAX,
         C40_FIN_DIST_NUM,
         C41_FIN_DIV_NUM,
         C42_FIN_INVENTORY_DATE,
         C43_FIXTURE_TYPE,
         C44_FRP_INVNTRY_DATE,
         C45_GRAND_OPEN_DATE,
         C46_LATITUDE,
         C47_LINEAR_FT,
         C48_LONGITUDE,
         C49_MANUAL_ORDER_DATE,
         C50_MARKET_LOCN_CODE,
         C51_MERCH_DIST_NUM,
         C52_OFFICE_PHONE,
         C53_ON_HAND_UPD_DATE,
         C54_OPEN_CODE,
         C55_PROJ_SALES_AMT,
         C56_PROJECT_CODE,
         C57_PROTOTYPE_IND,
         C58_REMODEL_DATE,
         C59_SALES_QTY,
         C60_SAN_ID,
         C61_SIGN_COLOR,
         C62_TIME_CARD_CODE,
         C63_TRADE_CONVSN_NUM,
         C64_VACATE_DATE,
         C65_VOL_CLASS_CODE,
         C66_WAGE_PLAN_CODE,
         C67_ZIP_CODE_EXT,
         C68_PI_SCHEDULE_DATE,
         C69_PI_MUSIC_INV_DATE,
         C70_PI_MUSIC_SCHD_DATE,
    from     testingodi.C$_0tbl_dim_store
    where     
         (1=1)
    There is a "," before from clause. I am not sure how it came, but I tried to manually delete it here and restart session, it still fails.
    Please help me understand and solve the problem.
    Thank you.

  • ERROR 1064 (42000): You have an error in your SQL syntax;

    Folks,
    I stucked here while granting the permissions.
    could you please throw any ideas why this...
    mysql> GRANT SELECT, INSERT, DELETE ON database TO prod@localhost IDENTIFIED BY
    'Welcome1'
    -> FLUSH PRIVILEGES;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near 'datab
    ase TO prod@localhost IDENTIFIED BY 'Welcome1'
    FLUSH PRIVILEGES' at line 1
    mysql> \q

    wrong forum mate ! need to post in SQL forums

  • Dreamweaver CS5 mysql error

    Hi Im using the new Dreamweaver CS5, apache and php that the in the mac and mysql and I find a problem trying to make a connection in dreamweaver to the database the error is:
    MySQL Error: # 2002
    no such file or directory
    does anyone knows what could happening?

    Thanks for your time Ken and I have uninstalled and reinstalled but its still the same.  The only thing I can think of is I installed zone alarm and since then its not work.

  • [Help] Replace MySQL error message

    In insert form, I want to post a especial error message, instead of mysql_error
    here an example:
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "insert_form")) {
      $insertSQL = sprintf("INSERT INTO stuff (title, numbers) VALUES (%s, %s)",
                           GetSQLValueString($_POST['titla'], "text"),
                           GetSQLValueString($_POST['numbers'], "int") );
      mysql_select_db($database_connection, $connection);
      $Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());
    cause i get an error like cannot be null
    Thanks.
    [Subject line edited by moderator to make it more meaningful]

    If you want to replace the MySQL error message, you can put your own error message in quotes in the die() command. Change this:
    $Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());
    to this:
    $Result1 = mysql_query($insertSQL, $connection) or die('Database error');
    However, that's not very helpful to a user, because all that will be displayed is "Database error" with no indication of what caused the error or any way of returning to the page, except by using the browser back button.
    A better way of handling things is to remove the or die(mysql_error()) section of code altogether and replace it with a PHP conditional statement that sends the user to an error page if the SQL fails for any reason. However, making these changes will prevent you from making further edits to the server behavior through the Server Behaviors panel.
    $Result1 = mysql_query($insertSQL, $connection);
    if (!$Result1) {
      $insertGoTo = 'error.php';
    } else {
      $insertGoTo = 'another_page.php' // <-- this is the original $insertGoTo line

  • MySQL error (2002) in Windows

    I'm using Dreamweaver 9 in Windows with a Apache, PHP5 and
    MySQL4.1. My webserver works fine. But Dreamweaver can't create
    database connection to MySQL. It gives me a MySQL error 2002 and
    referes to that /tmp/mysql.sock is missing.
    What should I do to get this to work? Am I missing something
    here? MySQL Query tool etc all work fine. But Dreamweaver can't
    connect to MySQL for some reason.

    chunkeung wrote:
    > When I login into
    > PHPMyAdmin I see that the Server is "Localhost via UNIX
    socket" so I put that
    > into my setting in dreamweaver for the "MySQL server"
    but on the hosting that
    > giving me that #2002 error message their Server is
    "127.0.0.1 via TCP/IP" and I
    > tried to put in 127.0.0.1 instead of localhost but it
    still doesn't work and
    > gives me this error message.
    localhost and 127.0.0.1 are the same thing. All you need is
    "localhost"
    or "127.0.0.1" (without the quotes). The "via UNIX socket"
    and "via
    TCP/IP" are simply descriptions of the type of connection.
    They are NOT
    part of the server address.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • MySQL Error#: 2002 Dreamweaver CS5

    HI
    Never had this problum before so not sure why now.  
    MySQL Error#:2002
    A connection attempt faild because the connected party did not properly respond after a period of time, or established connection faild because connected host has failed to respond
    Any help please?

    Thanks for your time Ken and I have uninstalled and reinstalled but its still the same.  The only thing I can think of is I installed zone alarm and since then its not work.

  • MS Services error 1064 when trying to start Oracle BI Scheduler service

    I am trying to configure Oracle BI Scheduler. After working through the config routines the Oracle BI Scheduler Service needs to be re-started. The Microsoft error message I get in the Services dialog is both consistent and persistent: "Could not start the Oracle BI Scheduler on local computer. Error 1064: An exception occurred in the service when handling the control request." This error seems to be well-known among users of this product, but the solution - if there is one - is not at all well-known... at least to me. Any help?

    Follow this article and make sure you defined all the steps. If any of these steps are wrong, the service throws the error.
    http://oraclebizint.wordpress.com/2007/09/13/oracle-bi-ee-10133-configuring-delivers-ibots/
    and also check is scheduler database is up and running.
    - Madan

  • How do I resolve mysql error 1129 in dreamweaver?

    I have setup a database on my server and was trying to make connection using dreamweaver but I can across this error mysql error 1129. How do I resolve this?

    If your Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

  • Mysql error / install problems

    after following the wiki entry: LAMP
    I get error:
    $ mysql
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    I'm out of luck here, does anyone have suggestions for where to look?
    .murkus

    How do you try to connect? Seems root is not allowed to connect from host "localhost" without the passwd..
    This fails:
    mysql -u root
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    But this does well:
    mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 2 to server version: 4.1.14
    Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
    mysql>

  • MySQL Error!

    MySQL Error!
    The Error returned was:
    Data too long for column 'useragent' at row 1
    Error Number:
    1406

    The SQL query that you quote is garbage. At best it looks like the where clause of a select statement. From what you describe, it sounds like phpmyadmin has some issues, since that's probably the program issuing the SQL statement(s).
    I have little MySQL experience and no php experience, so I can't get into more detail.
    Roger

  • When connecting to a database, dreamweaver gives the error message [MySQL Error

    When I try to connect my MySQL database into dreamweaver, I insert all of the information (name, server, username, password), and when i click on select database, it reads:
    MySQL Error#:1045
    Access denied for user 'mresnik_mresnik'@'192.185.5.169' (using password: YES)
    I am 100% sure that The details entered including username and password are correct, as I have contacted hostgator.com and they have stated that they can connect, and they advised that it may be an issue with either my files or dreamweaver.
    Any help would be very much appreciated.

    Login.php code:
    <?php require_once('Connections/drama_database.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['UserName'])) {
      $loginUsername=$_POST['UserName'];
      $password=$_POST['Password'];
      $MM_fldUserAuthorization = "userlevel";
      $MM_redirectLoginSuccess = "home.php";
      $MM_redirectLoginFailed = "loginfail.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_drama_database, $drama_database);
      $LoginRS__query=sprintf("SELECT username, password, userlevel FROM users WHERE username=%s AND password=%s",
      GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $drama_database) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        $loginStrGroup  = mysql_result($LoginRS,0,'userlevel');
        if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;         
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;  
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <html>
    <title>Drama Database - Login</title>
    <head>
        <link href="images/favicon.ico" rel="icon" />
    </head>
    </html>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <form ACTION="<?php echo $loginFormAction; ?>" id="loginform" name="loginform" method="POST">
    <!--visual -->
    <br>
    <br>
    <br>
    <div align="center">
      <!--ACS Logo -->
      <img src="images/logo_acs_egham.gif" width="387" height="59" /><br>
    <!--Drama Logo -->
    <br>
    <img src="images/bglogin.jpg" alt="Acs-Egham International School" width="246" height="153">
    <br>
    <!--Title -->
    <h2>Drama Database Login</h2>
    </center>
      </div>
      <table width="154" border="0" align="center">
        <tr>
          <td width="148">Username:<br />
            <span id="sprytextfield1">
            <label for="UserName"></label>
            <input type="text" name="UserName" id="UserName" />
          <span class="textfieldRequiredMsg">A value is required.</span></span></td>
        </tr>
        <tr>
          <td> </td>
        </tr>
        <tr>
          <td>Password:<span id="sprytextfield2"><br />
            <label for="Password"></label>
            <input type="password" name="Password" id="Password" />
          <span class="textfieldRequiredMsg">A value is required.</span></span></td>
        </tr>
        <tr>
          <td> </td>
        </tr>
        <tr>
          <td align="center"><input type="submit" name="LoginButton" id="LoginButton" value="Login" /></td>
        </tr>
        <tr>
          <td> </td>
        </tr>
      </table>
    </form>
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    </script>

  • Error 1064 while starting the Oracle BI Scheduler in Windows 7 - 32 bit

    Hi Everyone,
    When starting the OBIEE Version 10.1.3.3.3 's BI Scheduler, the following error has been retreived. ( I have installed newly and the rpd and the webcat has been placed in the corresponding folders newly. Before placing the rpd newly , when i started the Oracle BI Server , the same error has been retreived. But after replacing, its coming only for the Oracle BI Scheduler.
    Error 1064 : An exception Occurred in the service when handling the control request
    Please let me know your points to fix it in my local machine. ( The server mentioned above are installed in my local windows 7 operating system)
    Thanks,
    Madasamy M.

    Well first of all, Oracle 8 is 15 years old, so im not surprised at all it doesnt work properly on a much newer OS.
    %windir%/SYSWOW64/odbcad32.exe is for 32-bit drivers
    %windir%/system32/odbcad32.exe is for 64-bit drivers and this is the one being executed when running from control panel
    (logical, isnt it?...)
    The registry keys containing information about these are:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC
    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC
    in /ODBC/ODBCINST.INI/"ODBC Drivers" key, there is a list of the drivers, while ODBC/ODBCINST.INI/<driver_name> contains the details
    for example:
    [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Oracle in OraDb11g_home2]
    "APILevel"="1"
    "CPTimeout"="60"
    "ConnectFunctions"="YYY"
    "Driver"="C:\\oracle\\base\\product\\db11202\\BIN\\SQORA32.DLL"
    "DriverODBCVer"="03.51"
    "FileUsage"="0"
    "Setup"="C:\\oracle\\base\\product\\db11202\\BIN\\SQORAS32.DLL"
    "SQLLevel"="1"based on this info, you can try to repair it in the registry manually as according to the error it doesnt have the correct path specified, however i would just install a newer, supported version

Maybe you are looking for