Computing.Net > Forums > Programming > PHP with Access

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

PHP with Access

Reply to Message Icon

Name: Click_er
Date: August 25, 2003 at 14:16:45 Pacific
OS: Win 2K Pro
CPU/Ram: 2GHz/512Megs
Comment:

Hi,
i've posted this before, but doing it again to see if i can get some more help than last time
i'm writing a PHP script with MS Access 2000 as backend database
i'm having a problem inserting data in the DB.

here is what i'm doing

$abc = $HTTP_POST_VARS("data1");
$def = $HTTP_POST_VARS("data2");

$sql = "INSERT INTO DB_TABLE ('Table Col 1', 'Table Col 2') Values ('$abc',
'$def')";

odbc_exec($odbc, $sql);

where $odbc is the connection to the database and its successful

the problem is that if you look at the attributes Table Col 1 and Table Col
2...you'll notice the spaces..and cuz of that the Insert command does not
work

i've tried variations of single quote and double quote...but no help

i would changed the Attribute to be a signle word, but their is another
application written in C++ uses the same database...and i don't have the
source code for it

i'm using PHP 4.2.3

any help or suggestion are really appreciated

thanks

-Clicker



Sponsored Link
Ads by Google

Response Number 1
Name: zeroguy
Date: August 25, 2003 at 20:45:51 Pacific
Reply:

Just letting you know that I'm not ignoring you (don't know about the others), it's just that I have no idea what the problem is. Maybe that's why nobody was posting an answer.


0

Response Number 2
Name: Infinite Recursion
Date: August 25, 2003 at 21:20:08 Pacific
Reply:

I'm not ignorin' ya either :)

I hammered on your inquiry on the first pass... my guess was the ' vs the " but you have since tested for that factor.

I'm not sure about the multi-word feature you are trying to find a workaround for. If it is not too much of a task, i would suggest correcting the database to a single word fieldname, then modifying the C++ code... it may be as easy as a search and replace... just a thought.

Infinite Recursion


0

Response Number 3
Name: Click_er
Date: August 27, 2003 at 10:09:00 Pacific
Reply:

thanks for the replies

I would modify the C++ code but i don't have it.

Its a propritory software by a thrid company that uses Access as a backend DB. So if i went ahead and made a single word out of the attributes the $3000 software becomes compeletely useless

looks like i'll have to leave PHP and look into JSP or ASP to help me with this

thanks for everything


0

Response Number 4
Name: Niklas Frost
Date: September 14, 2003 at 01:52:34 Pacific
Reply:

Hi! I've been on php for one day so this may be of the roof but in my book I read that
$abc = $HTTP_POST_VARS("data1");
$def = $HTTP_POST_VARS("data2");

is for php versions earlier than 4.1.x. Can´t u use $_POST instead? (Thats the new name for HTTP_POST_VARS)
Niklas


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


POP before SMTP Advice on digital logic c...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: PHP with Access

Help with Access www.computing.net/answers/programming/help-with-access/10168.html

How to connect VB6 with Access www.computing.net/answers/programming/how-to-connect-vb6-with-access/8818.html

Crystall report with access xp www.computing.net/answers/programming/crystall-report-with-access-xp/13811.html