Results 1 to 3 of 3

Thread: Connecting to MS Access via Dreamweaver PHP

  1. #1
    Join Date
    May 2008
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Inserting data into Access database via php

    I've created 2 simple codes to try out how to insert data in Access but they don't seem to work. Here are the codes
    Code:
    <form method="post" action="update.php">
    <input type="text" name="FName" size="30" /> <br/>
    <input type="submit" name="Submit" value="Submit to database">
    
    </form>
    Code:
    <?php
    $_POST['FName'] = $FName;
    $odbc = odbc_connect('FYP', '', '') or die('Could not connect to ODBC database!');
    $start = odbc_prepare($odbc, "INSERT INTO fyp (Name) Values ('$FName')");
    $insert = odbc_exec($start,$odbc);
    
    ?>
    The error that is displayed is : PHP Warning: odbc_exec(): supplied resource is not a valid ODBC-Link resource in C:\Inetpub\wwwroot\update.php on line 16
    Last edited by jolicious; 07-01-2008 at 08:31 AM.

  2. #2
    Join Date
    May 2008
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Please feel free to make any suggestions or comment.
    Last edited by jolicious; 07-01-2008 at 08:47 AM.

  3. #3
    Join Date
    Mar 2008
    Posts
    218
    Thanks
    7
    Thanked 19 Times in 19 Posts

    Default

    Is this the problem you're describing?
    http://bugs.php.net/16812

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •