note 33060 deleted from function.msql-fetch-row by nlopess
| From: | nlopess@php.net | Date: | Mon, 23 Feb 2004 14:36:16 +0000 |
| Subject: | note 33060 deleted from function.msql-fetch-row by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65592@lists.php.net to get a copy of this message | ||
Note Submitter: tomer -(at)- parity-bit -(dot)- com
----
A __simple__ example of using this to create a table (assumes you've already connected and
selected your DB)
<TABLE WIDTH=100%>
<TR><TH>Name</TH><TH>Description</TH><TH></TH></TR>
<?php
$result = mysql_query("SELECT * FROM
$table LIMIT 0,30") or
die("Error:<BR>" . mysql_error());
while ($row = mysql_fetch_array($result) {
$description = "<SMALL>" .
str_replace("\n","<BR>\n",$row["description"]) .
"</SMALL>";
print "<TR><TD>" . $row["name"] .
"</TD><TD>" . $description . "</TD><TD><A
HREF=\"edit.php?ID=" . $row["ID"] .
"\">edit</A><BR><A HREF=\"delete.php?ID=" .
$row["ID"] . "\">delete</A></TR>";
}
?>
</TABLE>
This creates a table with a 'name' a 'description', and edit and delete links.