In message <[email protected].
org>, Charlie Markwick <[email protected]> writes
>Given:-
>
>$strFields = 'Gender=%s, UserName=%s';
>$strValues = '"Male","charlie","nhy01"';
>
>why does:-
>
>$strUpdateSQL = sprintf('UPDATE UserTable SET ' . $strFields . ' WHERE
>ID=%s', "Male","charlie","nhy01"); 
>
>work, while:-
>
>$strUpdateSQL = sprintf('UPDATE UserTable SET ' . $strFields . ' WHERE
>ID=%s', $strValues);  
>
>doesn't?
>
>Charlie

Because no matter what you put into $strValues, it is still only a
single string, no matter how many quotes it contains.

And you need 2 strings 
(or is it 3? $strFields says 2, $strValues says 3)


-- 
Pete Clark

Hot Costa - Local Spain
http://www.hotcosta.com

Reply via email to