473,387 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

SQL Insert - Weird Error

Ok - has anyone ever had this happen before?

I have a SQL Insert statement. When I build the SQL and execute it in PHP I
get the following error:

Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft
JET Database Engine Description: Syntax error in INSERT INTO statement. in
c:\phpweb\commit.php on line 81

So then I echo the SQL statement and this is what it looks like:
INSERT INTO
Cards(active,division,province,filetitle,air,water ,sewage,pttw,partVIII,part
46) VALUES ('1','ob','Ontario','0 0 0 0','0','0','0','0','0','0')

Everything is formatted correctly - column names format ect.

So then I take the echo'd sql and copy it into the PHP code as the sql
statement. When I re-run the SQL code with static sql statement it inserts
the record!!!!!

So basically if I build the SQL dynamically it won't execute. But if I echo
the dynamic sql then copy it into a sql variable it executes!

This is driving me nuts....please help!

Thanks,
Matt
Jul 17 '05 #1
1 1776
Hi Matt,

I once had the same problem with JET (ACCESS)

The reason was I used a RESERVED WORD for columnname. *sigh*
Is it possible you do the same?
Maybe active is reserved, I am not sure though..

You could check by giving all your coloumnnames an extra XXX on the end and
retry.

Good luck,
Erwin Moller

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: J. Muenchbourg | last post by:
The block of code below shows how I am inserting field values into my dbase table: strSQLStatement = "INSERT INTO tblArticles (handid,ArticleDate,sport,articleheader, fpick,articleText) "_ &...
12
by: Martin_Hurst | last post by:
Has some one come up with a similar type script that could be used in a Postgresql database? The script below was created for a SQLServer database. Thx, -Martin ...
2
by: Bill | last post by:
I'm having what seems to me to be an odd problem. Perhaps there is some explanation, but don't know at this point. Basically I have a form that tracks memberships and donations. The main form...
1
by: Mike John | last post by:
I am receiving the following error when insert into the table. "String or binary data would be truncated. The statement has been terminated." the following error had occured recently the...
3
by: teddysnips | last post by:
I need a trigger (well, I don't *need* one, but it would be optimal!) but I can't get it to work because it references ntext fields. Is there any alternative? I could write it in laborious code...
10
by: teddysnips | last post by:
SQL Server 2000 (DDL below) If I try to run this code in QA: SET IDENTITY_INSERT tblAdminUsers ON INSERT INTO tblAdminUsers (fldUserID, fldUsername, fldPassword, fldFullname,
3
by: weird0 | last post by:
I have two tables accounts and ATM and i am trying to insert a tuple in ATM with accountId as foreign key. But even this simple work,I encounter the following error: The INSERT statement...
6
by: TheRealDan | last post by:
Hi all. I'm having a problem with a special characters. I have php script that reads from an xml file and writes to a mysql db. It's a script called phptunest that I found on the net, although the...
2
by: =?Utf-8?B?Y2F0?= | last post by:
We recently moved an older ASP.NET 1.1 code base on to ASP.NET 2.0, .NET 3.0 and Windows 2003 Server SP2. We started experiencing the following issue with the web cache (the code is straightforward...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.