473,395 Members | 1,872 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,395 software developers and data experts.

~error,insert query failed....AND undefined index~

hi...
i'm new to the php and now i'm getting an error to insert my data inside the form..and also undefined index in latest_updated......
Now,i'm having trouble catching what i'm doing wrong....Here's my code to the query entry...

<?php

include 'config.php';

$pili_id=$_POST['pili_id'];
$branch=$_POST['branch'];
$zone=$_POST['zone'];
$location=$_POST['location'];
$type=$_POST['type'];
$subtype=$_POST['subtype'];
$alamat=$_POST['alamat'];
$latest_updated=$_POST['latest_updated'];

$query = "INSECT INTO pili VALUES (pili_id, branch, zone, location, type, subtype, alamat, latest_updated)
('$pili_id', '$branch', '$zone', '$location', '$type', '$subtype', '$alamat', '$latest_updated')";

mysql_query($query) or die('Error, insert query failed');
echo " '$pili_id' <b> '$branch' </b> ,'$zone', '$location', '$type', '$subtype', '$alamat','$latest_updated'";



?>

Can anyone give me a clue..?
thanks...!!!!
Oct 2 '06 #1
3 2427
LaoDe
9
why do you want to put INSECTs into your DB ???
Oct 2 '06 #2
opps....sorry....actually it is "INSERT",not "INSECT"!!!!wrong typing...

but after i change it to "INSERT"...it doest working too....
Oct 2 '06 #3
samui
8
I am having somewhat of a similar problem, but the following should help out a bit... I can elaborate more once I get an answer to my own problem, lol.

[php]
<?php

include 'config.php';

$pili_id=$_POST['pili_id'];
$branch=$_POST['branch'];
$zone=$_POST['zone'];
$location=$_POST['location'];
$type=$_POST['type'];
$subtype=$_POST['subtype'];
$alamat=$_POST['alamat'];
$latest_updated=$_POST['latest_updated'];

$query = "INSERT INTO pili (pili_id, branch, zone, location, type, subtype, alamat, latest_updated)
VALUES ('$pili_id', '$branch', '$zone', '$location', '$type', '$subtype', '$alamat', '$latest_updated')";

mysql_query($query) or die('Error, insert query failed');
echo " '$pili_id' <b> '$branch' </b> ,'$zone', '$location', '$type', '$subtype', '$alamat','$latest_updated'";

?>
[/php]
Oct 2 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
2
by: george | last post by:
This is like the bug from hell. It is kind of hard to explain, so please bear with me. Background Info: SQL Server 7.0, on an NT box, Active Server pages with Javascript, using ADO objects. ...
7
by: Bercin Ates via SQLMonster.com | last post by:
I?m getting an error when I execute a stored procedure which is try to insert a row to a table. The error is: Server: Msg 1934, Level 16, State 1, Procedure SRV_SP_IS_EMRI_SATIRI_EKLE, Line 32...
2
by: JNariss | last post by:
Hello, I have created a connection to one of my databases using DreamWeaver and created a form. When I go to preview the form in a browser I can see it and fill out fields. However when I click...
2
by: technocraze | last post by:
Hi guys, I have encountered this error when updating the values to the MS Acess table. Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and...
4
by: yogesh | last post by:
mysql in c++ initialize error occurs a simple program is executed in redhat9.0 , using gcc 3.2.2 compiler version ... #include <stdio.h> #include <mysql.h> #include <string.h> int main() {
4
by: wizard | last post by:
Hello dear friends, I am writing a small program to test transactions in php. But when I try to simulate an error condition during transaction, my php script aborts. It does rollback work, but...
1
anfetienne
by: anfetienne | last post by:
i take information from a database and then have the collected values entered into a form with hidden fields. <input type="hidden" name="returnURL" id="returnURL" value="<?php print...
3
by: alexdavies82 | last post by:
I am having a problem producing a relatively simple PHP code. Whenever I run it it gives the following fault message:
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.