Jump to content

INSERT INTO ACESS DB


contraboybish

Recommended Posts

I'm trying to INSERT a new record into an ACCESS DB using PHP from a form, this is the code l have so far........

 

$heading = $_POST['heading']; 
$story = $_POST['story'];

        $odbc = odbc_connect ('logisticsdb', 'root', '') or die('Could Not Connect to ODBC Database!');
    
$sql = "INSERT INTO Search (sHeading, sDescription) VALUES ('$heading', '$story')";

odbc_exec($odbc_connection, $sql) or die();

    odbc_close($odbc);

 

But i'm getting the following error.......

Warning: odbc_exec() expects parameter 1 to be resource, null given in C:\xampp\htdocs\lbm\searchupdate.php on line 8

 

What a l missing?

Link to comment
https://forums.phpfreaks.com/topic/184825-insert-into-acess-db/
Share on other sites

It works fine on localhost but now that i have downloaded it to my server i get this error.......

 

Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in d:\inetpub\....com\web\content\searchupdate.php on line 9

 

Any thoughts :-(

Link to comment
https://forums.phpfreaks.com/topic/184825-insert-into-acess-db/#findComment-975890
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.