Seems to me you'd be better off then writing code to handle all of
these, with is_array() doing the walk, and erroring out for Object and
Resource
Actually, an object should get type-casted to a string, and there's
even that nifty thing in PHP 5 where you can control what string it
gets changed to
Richard Lynch wrote:
On Wed, May 30, 2007 9:55 pm, Jim Lucas wrote:
Greg Donald wrote:
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
You want to use mysql_escape_string, and NOT addslashes and NOT
Magic
Quotes.
function slashes( $var )
{
if( is_array( $var ) )
{
return array_map(
On Wed, May 30, 2007 9:55 pm, Jim Lucas wrote:
> Greg Donald wrote:
>> On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>>> You want to use mysql_escape_string, and NOT addslashes and NOT
>>> Magic
>>> Quotes.
>>
>> function slashes( $var )
>> {
>> if( is_array( $var ) )
>> {
>>return arr
On 5/30/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
Say I wanted to use this on something other than $_GET, $_POST, & $_COOKIE?
Then I suppose you'll have to compensate with updates to support your
particular usage.
--
Greg Donald
http://destiney.com/
--
PHP General Mailing List (http://www.php
Greg Donald wrote:
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
You want to use mysql_escape_string, and NOT addslashes and NOT Magic
Quotes.
function slashes( $var )
{
if( is_array( $var ) )
{
return array_map( 'slashes', $var );
}
else
{
return mysql_real_escape_string( $v
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
You want to use mysql_escape_string, and NOT addslashes and NOT Magic
Quotes.
function slashes( $var )
{
if( is_array( $var ) )
{
return array_map( 'slashes', $var );
}
else
{
return mysql_real_escape_string( $var );
}
}
set_magi
You want to use mysql_escape_string, and NOT addslashes and NOT Magic
Quotes.
On Fri, May 25, 2007 12:34 pm, Rahul Sitaram Johari wrote:
>
> Ok, I'm not able to use array_map() at all to my benefit, or at least
> I
> can't figure out how to.
>
> I'm trying to generate the string with escape slashe
On Fri, May 25, 2007 10:32 am, Rahul Sitaram Johari wrote:
>
> Ave,
>
> I¹m inserting values out of an array into mySQL. There¹s other values
> besides the array values that are being inserted as well. This is my
> simple
> INSERT code:
array_map('mysql_real_escape_string', $var);
This assumes
Ave,
Alright, here's I solved it. Used the array_walk function. This is my code:
function test_alter(&$item1) {
$item1 = mysql_escape_string($item1);
}
array_walk($var, 'test_alter');
$var = implode("','", $var);
$sql = "INSERT INTO
nimo_account(Date,Time,Phone,Account,AccountType,RateC
Ok, I'm not able to use array_map() at all to my benefit, or at least I
can't figure out how to.
I'm trying to generate the string with escape slashes before I put it in the
INSERT statement, but it's not working primarily because values have to be
enclosed in Single Quotes while inserting into m
2007. 05. 25, péntek keltezéssel 11.32-kor Rahul Sitaram Johari ezt
írta:
> Ave,
>
> I¹m inserting values out of an array into mySQL. There¹s other values
> besides the array values that are being inserted as well. This is my simple
> INSERT code:
>
> $sql = "INSERT INTO db
> (Date,Time,Phone,Acc
Ave,
I¹m inserting values out of an array into mySQL. There¹s other values
besides the array values that are being inserted as well. This is my simple
INSERT code:
$sql = "INSERT INTO db
(Date,Time,Phone,Account,AccountType,RateClass,VoltLevel,IsoZone,TaxDist,Loa
dProfile,ServiceName,ServiceAddr
12 matches
Mail list logo