Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Shawn McKenzie
Jim Lucas wrote: > Jay Moore wrote: >> Shawn McKenzie wrote: >>> Jay Moore wrote: Jim Lucas wrote: > Jay Moore wrote: >> Greetings list. >> >> Say I have a function that escapes a string before being passed to >> MySQL >> like so: >> >> function escape($id, &$st

Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Jim Lucas
Jay Moore wrote: > Shawn McKenzie wrote: >> Jay Moore wrote: >>> Jim Lucas wrote: Jay Moore wrote: > Greetings list. > > Say I have a function that escapes a string before being passed to > MySQL > like so: > > function escape($id, &$string) > { > $strin

Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Jay Moore
Shawn McKenzie wrote: Jay Moore wrote: Jim Lucas wrote: Jay Moore wrote: Greetings list. Say I have a function that escapes a string before being passed to MySQL like so: function escape($id, &$string) { $string } Use an array as an alternate method of sending/returning data to the seco

Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Shawn McKenzie
Jay Moore wrote: > Jim Lucas wrote: >> Jay Moore wrote: >>> Greetings list. >>> >>> Say I have a function that escapes a string before being passed to MySQL >>> like so: >>> >>> function escape($id, &$string) >>> { >>> $string } >> >> Use an array as an alternate method of sending/returning dat

Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Jay Moore
Jim Lucas wrote: Jay Moore wrote: Greetings list. Say I have a function that escapes a string before being passed to MySQL like so: function escape($id, &$string) { $string } Use an array as an alternate method of sending/returning data to the second argument. function escape($id, &$d

Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Jay Moore
Ashley Sheridan wrote: On Wed, 2009-02-04 at 14:02 -0600, Jay Moore wrote: Greetings list. Say I have a function that escapes a string before being passed to MySQL like so: function escape($id, &$string) { $string = mysql_real_escape_string($string, $id); } I'm passing $string as a

Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Jim Lucas
Jay Moore wrote: > Greetings list. > > Say I have a function that escapes a string before being passed to MySQL > like so: > > function escape($id, &$string) > { > $string > } Use an array as an alternate method of sending/returning data to the second argument. function escape($id, &$data

Re: [PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Ashley Sheridan
On Wed, 2009-02-04 at 14:02 -0600, Jay Moore wrote: > Greetings list. > > Say I have a function that escapes a string before being passed to MySQL > like so: > > function escape($id, &$string) > { > $string = mysql_real_escape_string($string, $id); > } > > I'm passing $string as a referen

[PHP] Passing an undetermined amount of arguments by reference

2009-02-04 Thread Jay Moore
Greetings list. Say I have a function that escapes a string before being passed to MySQL like so: function escape($id, &$string) { $string = mysql_real_escape_string($string, $id); } I'm passing $string as a reference so I don't have to reassign it like so: $foo = escape($id, $foo);