분류 php

mysql_fetch_array () 함수

컨텐츠 정보

  • 조회 466 (작성일 )

본문

코드 : 

@mysql_connect("db_host", "db_user","db_pass") or die("Could not connect to MySQL server!");
@mysql_select_db("db_name") or die("Could not select database!");
$query = "SELECT * FROM mytable";
$result = mysql_query($query);

while ($row = mysql_fetch_array($result)) :
   print $row["id"];
endwhile;
mysql_close();



php