<Body>
<Center>
<H2> PHP + MySQL example </H2>
<H3> <u> <font color = brown> enter data in the text area and confirm </font> </u> <Form action = "<? Echo $ php_self?> "Method = post>
<Textarea Cols = 40 rows = 5 name = TXT> </textarea>
<Br>
<Input type = "Submit" value = "OK">
</Form>
<?
$ Connect_id = mysql_connect ("localhost", "username", "password ");
If (isset ($ txt )){
$ Dbtime = date ("Y-m-d h: I: s ");
Mysql_db_query ("usernamedb", "insert into test values (0, '$ dbtime',' $ TXT ')");
}
?>
<P>
</Center>
<Div align = center> <center>
<Table border = 1 cellpadding = 0 cellspacing = 2 width = 80%>
<Tr> <TD>
<?
$ Result = mysql_db_query ("usernamedb", "select * from test ");
While ($ userdb = mysql_fetch_row ($ result ))
{
Echo "<". $ userdb [0]. ">:< font color = purple> ". $ userdb [1]. "</font> <font color = Red> ". $ userdb [2]. "</font> <br> N ";
}
Mysql_close ($ connect_id );
?>
</TD> </tr>
</Table>
<P>
</Body>
</Html>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]