You are here: Re: Problem with apostrophe in MySQL « All PHP « IT news, forums, messages
Re: Problem with apostrophe in MySQL

Posted by J. Cairn on 04/10/07 00:04

I have tried that. Here is the code:

if($_REQUEST[name] != null){

$textToInsert = addslashes($_REQUEST[name]);

$sql = "UPDATE organization SET name = '$textToInsert'";

if($_REQUEST[description] == ""){
$sql = $sql . ", description = null ";
} else {
$sql = $sql . ", description = '" . $_REQUEST[description] . "'";
}

if($_REQUEST[phone] == ""){
$sql = $sql . ",phone = null ";
} else {
$sql = $sql . ",phone = '" . $_REQUEST[phone] . "'";
}

if($_REQUEST[url] == ""){
$sql = $sql . ",url = null ";
} else {
$sql = $sql . ",url = '" .$_REQUEST[url] . "'";
}

if($_REQUEST[categoryList] == ""){
$sql = $sql . ",catId = null";
} else {
$sql = $sql . ",catId = '" . $_REQUEST[categoryList] . "'";
}
$sql = $sql . " where id = " . $_REQUEST[id];

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация