1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Inser Values In Ms-Access

Discussion in 'PHP' started by itsys, Jul 3, 2009.

  1. itsys

    itsys Banned

    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..................
     

Share This Page