473,420 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ


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  

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.