|
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]
|