NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Inserting data into Access from PHP

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 02-22-2004, 12:51 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Nov 2003
Location: houston
Posts: 234
rambo6376 is an unknown quantity at this point
 



Inserting data into Access from PHP


I am trying to insert form data into an Access database in PHP. The code is as follows :
PHP Code:
$query "insert into Transfer (Date,Rep,DL,Name,Contact,Issue,Comments) VALUES (\"".$date."\",\"".$rep."\",\"".$dl."\",\"".$contact."\",\"".$issue."\",\"".$comments."\");";
????: NamePros.com http://www.namepros.com/programming/21477-inserting-data-into-access-from-php.html

//$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 Code:
$conn = new COM('ADODB.connection');
$connstring "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath('C:/apache2/htdocs/ddo/db2.mdb');
$conn->open($connstring); 
????: NamePros.com http://www.namepros.com/showthread.php?t=21477
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 Code:
$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?
__________________
www.seriousdiscussion.com
Serious talk forum for serious people.
AOL is like the best written virus I've ever seen...
For Sale Cheap! buybook.biz codingheaven.com phpxpert.com cityOfBerlin.info sedp.us
rambo6376 is offline  
Old 02-22-2004, 02:57 PM   #2 (permalink)
Raf
Senior Member
 
Raf's Avatar
Join Date: Feb 2004
Location: Canada
Posts: 1,746
Raf is a jewel in the roughRaf is a jewel in the roughRaf is a jewel in the rough
 



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.
Raf is offline  
Old 02-26-2004, 10:24 PM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: Nov 2003
Location: houston
Posts: 234
rambo6376 is an unknown quantity at this point
 



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
__________________
www.seriousdiscussion.com
Serious talk forum for serious people.
AOL is like the best written virus I've ever seen...
For Sale Cheap! buybook.biz codingheaven.com phpxpert.com cityOfBerlin.info sedp.us
rambo6376 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:21 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger