// db관련 파일 인크루드
include "conf.php";
$connect = mysql_connect("localhost", $dbname, $dbpass);
$result=mysql_select_db($dbname, $connect);
if ( !$connect ) {
echo " 데이터베이스에 연결할 수 없습니다.";
}
$fp = fopen("hanja.txt","r");
if(!$fp) {
echo("Failed to open the file");
}
while(!feof($fp)) {
$line = fgets($fp,3);
$sql = "select * from chinese where china='$line'";
$result = mysql_query($sql, $connect);
$row = mysql_fetch_object($result);
if(!$row->id){
echo("$row->id");
}
}
fclose($fp);
include "conf.php";
$connect = mysql_connect("localhost", $dbname, $dbpass);
$result=mysql_select_db($dbname, $connect);
if ( !$connect ) {
echo " 데이터베이스에 연결할 수 없습니다.";
}
$fp = fopen("hanja.txt","r");
if(!$fp) {
echo("Failed to open the file");
}
while(!feof($fp)) {
$line = fgets($fp,3);
$sql = "select * from chinese where china='$line'";
$result = mysql_query($sql, $connect);
$row = mysql_fetch_object($result);
if(!$row->id){
echo("$row->id");
}
}
fclose($fp);
댓글 달기