Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Inser Values In Ms-Access (http://www.go4expert.com/forums/inser-values-ms-access-t18320/)

itsys 3Jul2009 11:00

Inser Values In Ms-Access
 
Code:

<html>
</head>
<body>

<?php
//create an instance of the  ADO connection object
$conn = new COM ("ADODB.Connection")
  or die("Cannot start ADO");
//define connection string, specify database driver
$connStr = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= C:\\wamp\www\\insertvalue\\database\\bestonlinediremaildb.mdb";
$conn->open($connStr); //Open the connection to the database
$query1="insert into " . $books . " (url, sitetitle, description, gifurl, cat1, email, creator, id, entdate, sitetype) values (\"" . $url . "\",\"" . $title . "\",\"" . $description . "\",\"" . $gifurl . "\",\"" . $category . "\",\"" . $email . "\",\"" . $uname . "\"," . $i2 . ", CURDATE()," . $stype . ")";
//mysql_db_query($dbname, $query1) or die("Failed Query of " . $query1);
$rs = $conn->execute($query1) or die("Failed Query of " . $query1);
Enter a book url:<br />
<input type="text" name="url"><br />
Enter the sitetitle:<br />
<input type="text" name="sitetitle"><br />
Enter the description<br />
<input type="text" name="description"><br />
Enter gifurl:<br />
<input type="text" name="gifurl"><br>
Enter the email:<br />
<input type="text" name="email"><br>
Enter the creator:<br />
<input type="text" name="creator"><br>
Enter the id:<br />
<input type="text" name="id"><br>
Enter the entdate:<br />
<input type="text" name="entdate"><br>
Enter the sitetype:<br />
<input type="text" name="sitetype"><br>
 ?>
</body>
</html>

what's wrong abow code. Pls helap me..................


All times are GMT +5.5. The time now is 07:09.