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>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 16Code:<?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); ?>



Reply With Quote

Bookmarks