开发者

what is the error in this PHP_MYSQL update commad?

what's the error in update command ?? it doesn't update the database ?

if($action=="new")
{
    $query1="insert into activity_basic_info(activity_id) values($activity_id)";
    $result1=mysql_query($query1);
    if($result1)
        echo "01";
    else
        echo "00";
}
else
{
    $query="update activity_basic_info set";
    if(isset($name))
        $query = $query." name='$name',";
    if($describtion!="" && describtion!=NULL)
        $query = $query." describtion='$describtion',";
    if($city!=NULL&&$city!="")
        $query = $query." city_id=$city,";
    if($region!=NULL)
        $query = $query." region_id=$region,";
    if($street!=NULL)
        $query = $query." street_id=$street,";
    if($telephone!="")
        $query = $query." telephone=$telephone,";
    if($email!=NULL&开发者_运维技巧;&$email!="")
        $query = $query." email='$email',";
    if($url!=NULL&&$url!="")
        $query = $query." url='$url'";
    else
        $query = $query."url=''";

    $query = $query." where activity_id=$activity_id";

    $result=mysql_query($query);
        echo $query;
}
?>


You should check the success of $result = mysql_query($query); then if false, check the value of mysql_error() http://php.net/manual/en/function.mysql-error.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜