Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error not inserting data in database

1 view
Skip to first unread message

amina

unread,
Nov 22, 2011, 9:35:07 AM11/22/11
to
<?php
//connection with database//
$con = mysql_connect("localhost","root","");
//selection of db//
$db = mysql_select_db('test');
mysql_query($db,$con);
$insert = "INSERT INTO data SET
name=".$_POST[name].",
father=".$_POST[father].",
home=".$_POST[home].",
phone=".$_POST[phone].",
address=".$_POST[address].",
zone=".$_POST[zone].",
date=".$_POST[date].",
day=".$_POST[day].",
code=".$_POST[code]."";
$ins = mysql_query($insert);
if ($ins == true) {
echo "ok";
}
else {
echo "sorry";
}
?>
i want post my data in database but i cant do this
data base is connection ok
datbase selection ok
but where is mistake way my data cant insert in database plz help me
thanks
0 new messages