By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,602 Members | 1,533 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,602 IT Pros & Developers. It's quick & easy.

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

P: 4
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
Share this Question
Share on Google+
3 Replies


P: 9
why do you want to put INSECTs into your DB ???
Oct 2 '06 #2

P: 4
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

P: 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

Post your reply

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