I think Tobie was just spamming the list.  He's been moderated. :)

Charlie Markwick wrote:
>  
>
> Ok Tobie
>
> I'm not sure what should have been here?
>
> Charlie
>
> -----Original Message-----
> From: php_mysql@yahoogroups.com <mailto:php_mysql%40yahoogroups.com> 
> [mailto:php_mysql@yahoogroups.com 
> <mailto:php_mysql%40yahoogroups.com>] On Behalf Of Tobie Hillier
> Sent: 21 July 2009 20:56
> To: php_mysql@yahoogroups.com <mailto:php_mysql%40yahoogroups.com>
> Subject: Re: [php_mysql] Usng variables and sprintf
>
> Tobie Hillier
>
>
> --- On Tue, 21/7/09, Pete <c...@hotcosta.com 
> <mailto:cgrp%40hotcosta.com>> wrote:
>
> From: Pete <c...@hotcosta.com <mailto:cgrp%40hotcosta.com>>
> Subject: Re: [php_mysql] Usng variables and sprintf
> To: php_mysql@yahoogroups.com <mailto:php_mysql%40yahoogroups.com>
> Date: Tuesday, 21 July, 2009, 8:18 PM
>
>  
>
> In message <CB70B5CCE4319D4ABEA 54BB12D3117CFE45 2...@southcotpdc. 
> southcot.
>
> org>, Charlie Markwick <c...@southcot. com> 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
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
> The php_mysql group is dedicated to learn more about the PHP/MySQL web 
> database possibilities through group learning. Yahoo! Groups Links
>
> 

Reply via email to