1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Inser Values In Ms-Access

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

  1. itsys

    itsys Banned

    Joined:
    May 2, 2009
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    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