On Sat, May 31, 2008 at 4:23 AM, Ryan S <[EMAIL PROTECTED]> wrote:
>
>
>  Hey,
>
> This is my code:
> ==============================================================
> $update_sql="update greetings_final set 
> heading='$heading',message='$message',signature='$signature',font_size='$font_size',font_color='$font_color',bg_color='$bg_color'
>  where  temp_cno='".$thecno."' and rand_string='".$randreference."' LIMIT 5";
> echo $update_sql."<br><br>";
>        $result2 = mysql_query($update_sql);
>        if(mysql_affected_rows()==0){echo "Error R093d: unable to update 
> greeting";exit;}
> ==============================================================

    Try this:

<?php

// Shorten sanity for this email.
function m($data) {
    $data = mysql_real_escape_string($data);
    return $data;
}

$update_sql  = "UPDATE greetings_final SET heading='".m($heading)."',";
$update_sql .= "message='".m($message)."',signature='".m($signature)."',";
$update_sql .= "font_size='".m($font_size)."',font_color='".m($font_color)."',";
$update_sql .= "bg_color='".m($bg_color)."' WHERE temp_cno='".m($thecno)."' ";
$update_sql .= "AND rand_string='".m($randreference)."' LIMIT 5";

$result2 = mysql_query($update_sql) or die(mysql_error());

?>

-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to