U E D R , A S I H C RSS

ZP Board/PHP Study/MySQL


1. MySQL

  • mysql_connect, mysql_close, mysql_query, mysql_affected_rows, mysql_num_rows, mysql_fetch_row, mysql_fetch_array
  • mysql_connect ("", "", "패");
    • mysql .
  • mysql_close();
    • mysql .
  • mysql_query(" 행할 ");
    • mysql 함 행한.
  • ex) $result = mysql_db_query("zp2002","select * from addressbook order by binary name");
    • $result , identifier
  • mysql_affected_rows
  • mysql_num_rows
  • mysql_fetch_row( identifier);
    • identifier
      • ex) $row = mysql_fetch_array($result);
  • mysql_fetch_array( identifier);
    • mysql_fetch_row
    • identifier field

2.

~cpp 
     ..

1.
mysql_select_db("database1");
mysql_query("select * from table1 by order name");

2.
mysql_query("use database1");
mysql_query("select * from table1 by order name");

3.
mysql_db_query("database1", "select * from table1 by order name");

..
~cpp 
<!--babo.php-->
<html>
<head>
<title>  </title>
</head>
<body>
<table border=1 cellpadding=2>
<tr align=center> <td>  </td> <td width=120> 호 </td> </tr>
<?php
mysql_connect ("165.194.17.15", "zp2002", "호");
$result = mysql_db_query("zp2002","select * from addressbook order by binary name");
while($row = mysql_fetch_array($result)) {
	echo "<tr> <td>", $row["name"], "</td><td align=center>", $row["phone"], "</td> </tr>";
}
mysql_close();
?>
</table>

<FORM method="POST" action="save.php" >
 <INPUT type="text" name="name" value="" size=10 maxlength=10> 
호 <INPUT type="text" name="phone" value="" size=15 maxlength=15> 
 <INPUT type="submit" value="" size=5>
</FORM> 

<font size=2 color=red>      .
<br>    10bytes, 호 15bytes  . </font>
</body>
</html>
{{{~cpp
<!save.php>
<php
if ($_POSTname != "" && $_POSTphone != "") {
mysql_connect("zeropage.org","zp2002","호");
mysql_select_db("zp2002");
mysql_query("insert into addressbook values('$_POSTname', '$_POSTphone')");
mysql_close();
}
?>
<script language="javascript">window.location.replace("babo.php");</script>
}}} 한 페. ""


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:30
Processing time 0.0127 sec