$url=$_GET['url'];
$sql = "select * from table where exists ( select * from table where url= $url ) and url= $url'";
$res = $mdb2->query($sql);
if (MDB2::isError( $res )) {die($res->getMessage());}
$sql="select * from table where exists ( select * from table where url= ? ) and url= ?";
$types = array('text', 'text');
$sth = $mdb2->prepare($sql, $types, MDB2_PREPARE_RESULT);
$data = array($url,$url);
$res = $sth->execute($data);
$sth->free();
if (MDB2::isError( $res )) {die($res->getMessage());}
$sth = $mdb2->prepare($sql, $types, MDB2_PREPARE_RESULT);
$sth = $mdb2->prepare($sql, $types, MDB2_PREPARE_MANIP);
$sql = "select * from table where school=? order by ? DESC";
$types = array('text', 'text');
$sth = $mdb2->prepare($sql, $types, MDB2_PREPARE_RESULT);
$data = array($school, $kyouka);
$res = $sth->execute($data);
$sth->free();
if (MDB2::isError( $res )) {die($res->getMessage());}
$sql = "select * from table where name=? order by kokugo DESC";
$types = array('text');
$sth = $mdb2->prepare($sql, $types, MDB2_PREPARE_RESULT);
$data = array($school);
$res = $sth->execute($data);
$sth->free();
if (MDB2::isError( $res )) {die($res->getMessage());}
Author:@onetohihi
本職は、ネットワーク屋さんですが、ブログは趣味の範囲で、プログラミングやIT関連、ニュース、日記など色々書きます。
めんどくさがりですが、気楽にいきます。
お問い合わせはこちらから
この記事にトラックバックする