SQL Error

From: Date: Sat, 04 Nov 2000 03:20:25 +0000
Subject: SQL Error
Groups: php.general 
Request: Send a blank email to php-general+get-23673@lists.php.net to get a copy of this message
W2K, SQL Server 7, PHP4. I had this working then I changed one field and I don't know what I did wrong but now I get this error: Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 's'., SQL state 37000 in SQLExecDirect in D:\Live Sites\www.bloodykisses.com\phptest\moviedb_add.php on line 28 My function starting from Line 20 reads: 20 function add_to_database($Title,$Year,$Synopsis,$Also_titled,$Sequel1,$Sequel2,$Actor 1,$Actor2,$Actor3,$Actor4,$Actor5,$Actor6,$Director,$Length,$Personal_rating ,$dberror){ 21 // connect to a DSN called bkcontent 22 $db=odbc_pconnect("bkcontent","user","password"); 23 if(!$db){ 24 $dberror="Couldn't connect to SQL server"; 25 return false; 26 } 27 $query="INSERT INTO movies (Title,Year,Synopsis,Also_titled,Sequel1,Sequel2,Actor1,Actor2,Actor3,Actor4 ,Actor5,Actor6,Director,Length,Personal_rating) values('$Title','$Year','$Synopsis','$Also_titled','$Sequel1','$Sequel2','$A ctor1','$Actor2','$Actor3','$Actor4','$Actor5','$Actor6','$Director','$Lengt h','$Personal_rating')"; 28 $result=odbc_exec($db,$query); 29 return true; 30 } Does anyone know what is causing this error? TIA, jb

« previous php.general (#23673) next »