Hi to all,
How to use insert query in php?
I m using ODBC connection with access database.I want to save data in table.
I m using database 'PHPDB1'.
Table Name 'EDETAIL'.
There r two fields in table: 'ENO' & 'ENAME'.
I want to take to text box and one submit button.
I want to save the value of text box in table when i click on submit button.
How to do all this process using PHP?
I had already create connection
I m using Below code to fetch data from this table.
It works properly.
"
[PHP]$conn=odbc_conn ect('phptest1', '','');
if (!$conn)
{exit("Connecti on Failed: " . $conn);}
//$sql="INSERT INTO edetail(eno)val ues('$_POST[name]')";
$sql="SELECT * FROM edetail";
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr >";
echo "<th>ECode</th>";
echo "<th>EName</th></tr>";
while (odbc_fetch_row ($rs))
{
$eno=odbc_resul t($rs,"eno");
$ename=odbc_res ult($rs,"ename" );
echo "<tr><td>$e no</td>";
echo "<td>$ename </td></tr>";
}
odbc_close($con n);
echo "</table>";
?>[/PHP]"
But i want to save data through form....So plz help me...I Want to learn more about PHP.
Thanx In Advance.....
How to use insert query in php?
I m using ODBC connection with access database.I want to save data in table.
I m using database 'PHPDB1'.
Table Name 'EDETAIL'.
There r two fields in table: 'ENO' & 'ENAME'.
I want to take to text box and one submit button.
I want to save the value of text box in table when i click on submit button.
How to do all this process using PHP?
I had already create connection
I m using Below code to fetch data from this table.
It works properly.
"
[PHP]$conn=odbc_conn ect('phptest1', '','');
if (!$conn)
{exit("Connecti on Failed: " . $conn);}
//$sql="INSERT INTO edetail(eno)val ues('$_POST[name]')";
$sql="SELECT * FROM edetail";
$rs=odbc_exec($ conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr >";
echo "<th>ECode</th>";
echo "<th>EName</th></tr>";
while (odbc_fetch_row ($rs))
{
$eno=odbc_resul t($rs,"eno");
$ename=odbc_res ult($rs,"ename" );
echo "<tr><td>$e no</td>";
echo "<td>$ename </td></tr>";
}
odbc_close($con n);
echo "</table>";
?>[/PHP]"
But i want to save data through form....So plz help me...I Want to learn more about PHP.
Thanx In Advance.....
Comment