<Body>
<Center>
<H2> PHP + MySQL example <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]