Study/Mysql

list3.php

zeroplus1 2012. 9. 17. 00:20

조회처리관련 패턴

<?PHP
$con=mysql_connect('localhost','john','1');
mysql_select_db('johnDB');

$sql="select * from Member";
$res=mysql_querty($sql)

echo ("<table border='1'>);

//레코드의 배열단위로 가져옴
while($rs=mysql_fetch_array($res))
{
  $userid = $rs[userid];
  $userage = $rs[userage];
  echo("
        <tr>
        <td>$userid</td> <td>$userage</td>
        </tr>
      ");
};

echo "</table>";
mysql_close($con);

?>

'Study > Mysql' 카테고리의 다른 글

list2.php  (0) 2012.09.17
PHP DB연결  (0) 2012.09.03
*MY-SQL계정(root) - 사용자 관리  (0) 2012.09.02
DB기초 - 명령어  (0) 2012.09.02