[MSSQL] WHERE AND oder ,?

06/28/2010 13:39 _FightZ_#1
Hello.


I have a problem in MSSQL.

Code:
<?php


		$msconnect = mssql_connect("localhost");
		$msdb = mssql_select_db("kal_db", $msconnect);
		$query = "UPDATE Skill SET Level = '55' WHERE Index = '32', PID = '610'";
	
		mssql_query($query);
?>
I defined 2 WHERE clause by putting a ", " betwen both values. but yea it allways gives me an error

Code:
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near the keyword 'Index'. (severity 15) in
if i seperate them with AND i get the same error -.-

Please help ;D.
06/28/2010 17:37 Bot_interesierter#2
Code:
$query="UPDATE Skill SET Level = 55 WHERE Index = 32 && PID = 610";
müsste gehen und für Integer Konstanten kann man die ' auch weglassen soweit ich weiß.
06/28/2010 23:09 Fratyr#3
ya know, "Index" is a Statement in MySQL ;D
Read the manual and lern to escape your SQL Strings!
Quote:
$query = "UPDATE `Skill` SET `Level` = '55' WHERE `Index` = '32', `PID` = '610'";