?

Log in

No account? Create an account
Databases in PHP - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Databases in PHP [Nov. 17th, 2002|09:47 pm]
LiveJournal Client Discussions

lj_clients

[inpotentia]
Thanks to all your help I now have my SMS2lj client written and working as well as I can tell without actually having access to test it with a SMS yet.

I've hit a snag though on writing the page where people can enter their details into a ddatabase. I can not get the script to update the database. It's not throwing up any errors.


The code I am using in PHP is:
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("user.mdb"));
$conn->Execute ("INSERT INTO user VALUES ('${mobile}', '${user}', '${pass}',' ${GMT}')");
$conn->Close;
Can anyone see anything obviously wrong with this?
linkReply

Comments:
[User Picture]From: codedragon
2002-11-17 01:59 am (UTC)
Your braces in the $conn->execute statement are a) unnecessary and b) in the wrong place.

You should either put {$mobile} etc, which isn't really necessary, or put $mobile, which would make more sense.

Sorry if that sounded a bit terse, I've got a headache...
(Reply) (Thread)
[User Picture]From: inpotentia
2002-11-17 11:25 pm (UTC)
Thanks, I've taken them out which does the make look a lot nicer.
(Reply) (Parent) (Thread)
[User Picture]From: codedragon
2002-11-18 08:12 am (UTC)

Re:

NP. Glad it worked.
(Reply) (Parent) (Thread)
[User Picture]From: inpotentia
2002-11-17 11:26 pm (UTC)
I figured it out.
$conn->Close(); <- was missing the brackets.

Oddest thing is PHP didn't complain at all.
(Reply) (Thread)