...or if you don't know where it's going to end up and you don't know if you're
able to disable them you can use this function instead of addslashes() - which is
what I do:
// Bogdan Stancescu <[EMAIL PROTECTED]>, 2001
function gpc_slashes($unslashed)
{
if (phpversion()>=4) {
if (
> > Just curious, but why are you having to stripslashes() on the data coming
> > out of the database? Do you have magic_quotes_runtime enabled on your
> server?
>
>I honestly don't know... all I know is that I'm adding slashes on the
>way into the database, and stripping them on the way out, b
function Build_Array($mysql_result_pointer)
{
if(mysql_num_rows($mysql_result_pointer))
{
$res[] = mysql_field_name($mysql_result_pointer);
while($row = mysql_fetch_array($mysql_result_pointer))
{
$res[] = row;
}
}
return($res);
}
Jim Lu
Many thanks to both Michael and Bogdan.
Michael Sims wrote:
> Just curious, but why are you having to stripslashes() on the data coming
> out of the database? Do you have magic_quotes_runtime enabled on your server?
I honestly don't know... all I know is that I'm adding slashes on the
way int
At 11:12 AM 1/22/2002 +1100, Justin French wrote:
>Hi all,
>
>I've got into the habbit of pulling data out of a table something like this:
[...]
> $id = $sql_myrow["id"];
> $date = $sql_myrow["date"];
[...]
>Now, I reckon there must be a way of automating the task of making the
>$title var out
function make_vars($result)
{
$fields = mysql_num_fields($result);
if ($myrow = mysql_fetch_array($result)){
for ($i=0; $i < $fields; ++$i){ // >
$names = mysql_fieldname($result,$i);
global $$names;
$$names = $myrow[$names];
}
return true;
}else{
6 matches
Mail list logo