多表查询

#1 05309

$ip_sql=mysql_query("select ip from musci_ip where musci_id='$id' and ip='$ip'");
$count=mysql_num_rows($ip_sql);
if($count >0 ){//点击记录
        echo "喜欢过了";

}else{//更新
        $sql = "update musci set love=love+1 where id='$id'";
        mysql_query( $sql);
         
        $sql_in = "insert into musci_ip (musci_id,ip,postdate) values ('$id','$ip','$search_postdate')";
        mysql_query( $sql_in);
       
        $result = mysql_query("select love from musci where id='$id'");
        $row = mysql_fetch_array($result);
        $love = $row['love'];
        echo $love;
}
这上面的代码用speedphp怎么写。我是个小菜鸟,请帮忙下。

2013-01-04 23:16:03

#2 jake

看手册,入门教程。一般新手入门都是看教程的。

2013-01-05 09:39:51