我有一个问题如何执行此操作,以便在mysql中使用$ _GET检查表。我有一个剧本。
<?php
require_once 'inc/config.php';
if (isset($_GET['ip'])) {
$ip = trim($_GET['ip']);
$code = trim($_POST['code']);
$sql = "SELECT * FROM license WHERE ip=? AND code=?";
$db = new MySQL($dbc['host'], $dbc['user'], $dbc['password'], $dbc['database']);
$stm = $db->dbConn->prepare($sql);
$stm->execute(array($ip, $code));
echo "1";
}
?>
的config.php
<?php
$dbc['host'] = "localhost";
$dbc['user'] = "admin_bf2mod";
$dbc['password'] = "LwNMtIwiz8";
$dbc['database'] = "admin_bf2mod";
?>
我想从表中扫描一下,如果IP是正确的但是代码不是它显示1如果代码和ip是好的话它会显示0如果代码是