Log in

View Full Version : Connecting to MS Access via Dreamweaver PHP



jolicious
06-25-2008, 01:53 AM
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

<form method="post" action="update.php">
<input type="text" name="FName" size="30" /> <br/>
<input type="submit" name="Submit" value="Submit to database">

</form>


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

jolicious
06-26-2008, 01:16 AM
Please feel free to make any suggestions or comment.

tfit
07-27-2008, 08:29 AM
Is this the problem you're describing?
http://bugs.php.net/16812