테이블 유뮤 확인하는 방법
작성자 : 김영철
등록날짜 : 2009.01.14 22:15
<?
$conn = mysql_connect ("데이터베이스위치","유저","패스워드");
$result = mysql_list_tables ("찾고자하는 디비명");
$search_table = "찾고자하는 테이블";
$i = 0;
while ($i < mysql_num_rows ($result)) {
$tb_names[$i] = mysql_tablename ($result, $i);
if( $tb_names[$i] == $search_table ) echo $search_table. "테이블이 있습니다.";
$i++;
}
mysql_close($conn);
?>
1.
sptbl_qry = "select count(*) TotCount from INFORMATION_SCHEMA.tables where table_name='[table_name]'"
2.
function mysql_table_exists($table, $link) {
$exists = mysql_query("SELECT 1 FROM `$table` LIMIT 0", $link);
if ($exists) return true;
return false;
}
mysql_query는 query가 성공하면 true, 실패하면 false입니다.
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
☞자세히보기 |
|
|