Connecting Tech Pros Worldwide Help | Site Map

Put it into MySQL

By Darrell Shifflett
Senior Editor, Linux-2000.org

Lets get started

First lets login to mysql.

Step 3:

-------------------------//// cut ////------------------------------
<?php

$db = mysql_connect("localhost","user_id","password");
mysql_select_db("news",$db);
$result = mysql_query("SELECT * FROM slashdot LIMIT
10",$db);
if ($myrow = mysql_fetch_array($result)) {
echo "<table border=3 bgcolor=\"#009999\">\n";
do {
printf("<tr><td><b>Category:</b> %s <a
href=\"$myrow[Link]\">\n
<font
color=\"#CFCFCF\">Slashdot.org</a><br></font>\n
<b>Topic:</b> %s<br></tr>\n",
$myrow[Category], $myrow[Title], $myrow[Link]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
} else {
echo "Sorry, no records were found!";
}

?>

-------------------------//// cut ////------------------------------

<?
include("slashnews.php3");
?>

Of course you can make the above PHP script do what you need for your needs.

« Where to Start