Dynadot โ€” .com Transfer

Inserting data into Access from PHP

SpaceshipSpaceship
Watch

rambo6376

Established Member
Impact
0
I am trying to insert form data into an Access database in PHP. The code is as follows :
PHP:
$query = "insert into Transfer (Date,Rep,DL,Name,Contact,Issue,Comments) VALUES (\"".$date."\",\"".$rep."\",\"".$dl."\",\"".$contact."\",\"".$issue."\",\"".$comments."\");";

//$query = "insert into [Transfer] ([Transfer].[Date],[Transfer].[Rep],[Transfer].[DL],[Transfer].[Name],[Transfer].[Contact],[Transfer].[Issue],[Transfer].[Comments]) VALUES (\"".$date."\",\"".$rep."\",\"".$dl."\",\"".$contact."\",\"".$issue."\",\"".$comments."\");";

$result = $conn->execute($query);

Neither of the above two queries work!

The page is parsed without any errors (i have e_all turned on in php.ini) but it does not insert the data into the database! The database contains a single table called "Transfer" and I'm connecting to the database using the following code:

PHP:
$conn = new COM('ADODB.connection');
$connstring = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath('C:/apache2/htdocs/ddo/db2.mdb');
$conn->open($connstring);

I have a different PHP script I had written to read from an access database and I set up the connection for it in the exact same way and the query was:
PHP:
$query = "select * from 2002 where [2002].[Last Name]='$searchkey' order by [2002].[First, Middle];";
where 2002 is the table name and "Last Name" and "First, Middle" are columns.

Anyone have any idea what I could do?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hi there rambo6376, I've done things with MDB databases however not in PHP. I would suggest that you look around Google for some answer. If I find something I'll post here.
 
0
•••
unable to find anything on google for this problem. secretly logged in under admin account to see if maybe if server was running under admin it might work but it didnt :(
 
0
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back