Page 1 of 1

SQL REPLACE INTO ODBC help

Posted: Fri Oct 12, 2007 9:28 am
by wegreenall
I'm developing system for my company (im pretty much a beginner at php)

and basically i want to replace using sql from a php page into a visual foxpro table using ODBC drivers (6.01.8629.01) and i'm completely completely frustrated.

Code: Select all

$valsinsertsql="REPLACE into 'wtran' (wr_ref,wr_tempval,wr_trncde) VALUES ('$empref','$mysqlref','$code')";
$hoursinsertsql="REPLACE into 'wtran' (wr_ref,wr_units,wr_trncde) VALUES ('$empref','$mysqlref','$code')";
if ($valuetype=="V"){
	   $valsinsert=odbc_exec($linkodbc,$valsinsertsql);
} else if ($valuetype="H"){
	   $hoursinsert=odbc_exec($linkodbc,$hoursinsertsql);
}
I am repeating this to insert multiple records, depending on whether each one is either an "H" or a "V" (hours, value, but that's irrelevant)

the problem i get is:

Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Visual FoxPro Driver]Command contains unrecognized phrase/keyword., SQL state 37000 in SQLExecDirect in C:\wamp\www\PHPTESTING\action.php on line 62



(and line 60 if it is a "V")

repeated across the page.

what should i do!?

i'm so stuck.

this is my first post and i'm sorry if i've violated any rules or something, but i can't find anything on this anywhere and i figured here'd be a good place to ask!

thanks,

Will