[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-developers] Help with quotes in sql statements
From: |
Brian Johnson |
Subject: |
[Phpgroupware-developers] Help with quotes in sql statements |
Date: |
Wed, 13 Nov 2002 20:14:41 +0000 |
Could someone help me with to change this sql statement from the addbook
module, it
has problems with names that include a single quote (like O'Sullivan)
$sql = 'UPDATE phpgw_addbook_person_main SET ';
$sql.= 'title = \''.$person['main']['title'].'\', ';
$sql.= 'last_name = \''.$person['main']['last_name'].'\', ';
$sql.= 'middle = \''.$person['main']['middle'].'\',';
$sql.= 'first_name = \''.$person['main']['first_name'].'\', ';
$sql.= 'birthday = \''.$birthday.'\', ';
$sql.= 'gender = \''.$person['main']['gender'].'\'';
$sql.= ' WHERE id = '.$id;
This doesn't work
$sql = "UPDATE phpgw_addbook_person_main SET ";
$sql.= "title = \"".$person['main']['title']."\", ";
$sql.= "last_name = \"".$person['main']['last_name']."\", ";
$sql.= "middle = \"".$person['main']['middle']."\",";
$sql.= "first_name = \"".$person['main']['first_name']."\", ";
$sql.= "birthday = \"".$birthday."\", ";
$sql.= "gender = \"".$person['main']['gender']."\"";
$sql.= " WHERE id = ".$id;
- [Phpgroupware-developers] Help with quotes in sql statements,
Brian Johnson <=