Á¦ÃâÀÚ : Joe Thong darkjoe@softhome.net Site URL: http://phpdb.linuxbox.com
¼³¸í: ¿©·¯°¡Áö µ¥ÀÌÅͺ£À̽º ¼¹ö¿¡¼ °á°ú Á¶ÀÛÀ» À§ÇÑ °·ÂÇÑ PHP µ¥ÀÌŸº£À̽º ·¦ÆÛ. µ¥ÀÌÅͺ£À̽ºÀÇ °á°ú°¡ phpDB¿¡ ÀÇÇØ ÀÚµ¿À¸·Î ³ª¿À°Ô µÈ´Ù.
ÀÌÈÀÏÀ» ¾òÀ¸·Á¸é À¥ºê¶ó¿ìÁ®¿¡¼ '´Ù¸¥À̸§À¸·Î ÀúÀå'À» ´©¸£°í phpDB-mssql.lib ¶ó°í ÀÔ·ÂÇϽÿÀ.(¿ªÁÖ: phpDB-mssql.lib °¡ ¾Æ´Ï°í. phpDBTest.php3 ¶ó°íÇؾßÇÕ´Ï´Ù.)
<html> < head> < title>Untitled< /title> < /head> < body> <?php // ÀÌÈÀÏÀº phpDB.inc°¡ ÀÖ´Â µð·ºÅ丮¿¡ ÀÖ´Ù°í °¡Á¤ÇÕ´Ï´Ù. include("phpDB.inc"); $db = new phpDB(); $db->pconnect("hostName", "userName", "passWord", "databaseName") or die ("Can't connect to database server or select database"); $rs = $db->execute("SELECT * FROM Items"); $numOfRows = $rs->getNumOfRows(); echo "Number of Rows: $numOfRows"; $rs->firstRow(); // ¼±ÅûçÇ×À̳ª, ÃßõÇÕ´Ï´Ù. while (!$rs->EOF) { // Fields collection accessible as associative arrays too echo "<br>" . $rs->fields[0]; $rs->nextRow(); // NOTE: nextRow() is placed at below } $rs->close(); $db->close(); // ¼±ÅûçÇ× ?> < /body> < /html>