Forum Moderators: coopster

Message Too Old, No Replies

MS-Access database connections using php

Php-Ms access

         

courtyard

6:37 pm on Apr 3, 2007 (gmt 0)

10+ Year Member



can anyone help me how to set up a MS access database using php...

eelixduppy

7:02 pm on Apr 3, 2007 (gmt 0)



Welcome to WebmasterWorld, courtyard!

There are many threads here that address the issue. A simple search [google.com] will produce some good ones. Here's a recent one: [webmasterworld.com...]

Good luck!

courtyard

7:32 pm on Apr 3, 2007 (gmt 0)

10+ Year Member



<?

$surveys = odbc_connect("webform","","");

$sql = "INSERT INTO survey VALUES( '";

$sql=$sql.$submit1."','".$submit2."','".$submit3."','".$submit4."','";

$chk = odbc_exec($surveys, $sql);

odbc_close($surveys);
?>

this is my php code and i have set up my database in this way,

control panel-->administrative tools-->ODBC-->microsoft access database--> select"microsoft access driver.mdb"

then gave DATASOURCE NAME AS "webform" and selected it's path..

but I could not enter the values into the database.Can anyone help me in this?
Thanks in advice.

eelixduppy

7:38 pm on Apr 3, 2007 (gmt 0)



Check your error logs to see if any errors are coming up from this script. Also, look at some of the user-contributed notes [us.php.net] at php.net. That might help get you where you want to go :)

courtyard

2:15 am on Apr 5, 2007 (gmt 0)

10+ Year Member



<?
$surveys = odbc_connect("webform","","");

$sql = "INSERT INTO survey VALUES( '";

$sql=$sql.$submit1."','".$submit2."','".$submit3."','".$submit4."','";

$chk = odbc_exec($surveys, $sql);

odbc_close($surveys);
?>

can somebody help telling whether this is the correct code to insert values to the Ms access database..