note 33060 added to function.msql-fetch-row
| From: | tomer at rack1 dot php dot net | Date: | Sun, 15 Jun 2003 13:08:07 +0000 |
| Subject: | note 33060 added to function.msql-fetch-row | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50378@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/function.msql-fetch-row.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33060
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33060&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33060&report=yes