| Newbie | | Join Date: Jun 2008
Posts: 1
| |
I'm doing an online registration form and using ODBC to connect to my database. I'm new to programming thus I do not know most of the advance features for php and Access. I need help in inserting data into the table in Access. I created a .php file to insert the code but it does not work. Here is the code - <?php
-
$name = $_POST['name'];
-
$admin = $_POST['admin'];
-
$gender = $_POST['gender'];
-
$address = $_POST['address'];
-
$hometel = $_POST['hometel'];
-
$hp = $_POST['hp'];
-
$email = $_POST['email'];
-
$course = $_POST['course'];
-
$year = $_POST['year'];
-
$path = $_POST['path'];
-
$title = $_POST['title'];
-
$supervisor = $_POST['supervisor'];
-
$odbc = odbc_connect('FYP', '', '') or die('Could not connect to ODBC database!');
-
$query = "INSERT INTO fyp (Name, AdminNumber, Gender, Address, Hometelephone, MobilePhone, Email, AcadCourse, Year, Path ,Projecttitle, ProjectSupervisor) VALUES ("$name","$admin","$gender","$address","$hometel","$hp","$email","$course", "$year","$path","$title","$supervisor")";
-
$result = odbc_exec($odbc, $query) or die (odbc_errormsg());
-
odbc_close($odbc);
-
?>
If its required, I can post my registration form here. Thanks.
|