MySQL Forums
Forum List  »  PHP

problem to insert
Posted by: moktar mhani
Date: July 20, 2008 10:09AM

hello every body
am new php user am working on my project i have probleb to add to database the operate done and every thing ok but when igo th my database ifaund the feild embty
this the code
====================================================================
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("libyabook", $con);$sql="INSERT INTO guide (t_name, c_name,p_name,g_pho,g_fax,g_box,g_mail,g_Add,g_act,g_name)
VALUES
('$_POST[g_name]','$_POST[t_name]','$_POST[c_name]','$_POST[p_name]','$_POST[g_pho]','$_POST[g_fax]','$_POST[g_box]','$_POST[g_mail]','$_POST[g_add]','$_POST[g_act]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "تمت الاضافة بنجاح";
mysql_close($con)
?>
===============================================================
and the second q? how ican dspilya the data from database to compo box(drop down list}

thanx for help

Options: ReplyQuote


Subject
Written By
Posted
problem to insert
July 20, 2008 10:09AM
July 21, 2008 12:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.