Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win XP, SQL 2000 and PHP5

Status
Not open for further replies.

storm197

MIS
Oct 9, 2002
55
CA
Hi,

I have an application working fine on a Win2K machine, SQL7 client, and PHP5.

I Try (for internal reasons) to switch it to a WinXP, SQL2000, PHP5.

After the switch, everything works fine except for one thing. When I make a INSERT or UPDATE query, the query runs, but I always get the OR DIE message. Here is a sample or code:

$result_add_users_history = mssql_query("
INSERT INTO tbl_users_history (users_history_id_users, login_date)
SELECT
'$id_users',
'$now_date'
;")
or die ("Invalid query");

If I check in the database, the data is entered in, but I still get the INVALID QUERY message.

Should I get rid of all OR DIE in my code ?
 
If you get rid of the or die() clause you will need to handle a failure in a different way. I would remove it from a test query and output the result that is returned. Is it FALSE, is it NULL?
Maybe you should add the resource link identifier to rule that out as a cause for the failure.
 
I looked at the output of the Query and it is Null (not false).

I also tried to put the resource link identifier and it still doesn't work.

What is strange is the fact that it does only that to INSERT and UPDATE Queries, not for SELECT.

Another strange thing is the fact everything works fine on another WIN2K machine. I Checked my queries in query analyser and they are Ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top