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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.