<?PHP
//connect to the mysql server
//remove if a connection is already established
$dbc = mysql_connect ('localhost', 'user', 'password');
//select the PDS database
//remove if the database with the PDS files is already selected
$dbs = mysql_select_db('PDS database name');
//get the recent listings
$rz = mysql_query("SELECT * FROM pds_list WHERE state='apr' ORDER BY d_submit DESC, id DESC LIMIT 0,10;");
for($xz=0;$xz<mysql_num_rows($rz);$xz++){
$recent[$xz] = mysql_fetch_assoc($rz);
}
//select the default database
//remove if your external script does not need a different database
$dbs = mysql_select_db('default database name');
//we now will generate the markup for display
?>
<table>
<?PHP
for($xz=0;$xz<count($recent);$xz++){
?>
<tr>
<td><a href="http://www.yoursite.com/folder/show.php?id=<?=$recent[$xz]['id']?>"><?=$recent[$xz]['firm']?></a></td>
</tr>
<?PHP
}
?>
</table>
include('pdsrecent.php');
<iframe src="http://www.yoursite.com/pdsrecent.php"></iframe>$recent = mysql_fetch_assoc($rz);$recent[$xz] = mysql_fetch_assoc($rz);<?PHP
//connect to the mysql server
//remove if a connection is already established
$dbc = mysql_connect ('my_db_info');
//select the PDS database
//remove if the database with the PDS files is already selected
$dbs = mysql_select_db('my_db_info');
//get the recent listings
$rz = mysql_query("SELECT * FROM (pds_list left join pds_listcat on pds_list.id = pds_listcat.list_id)
LEFT JOIN pds_category
ON pds_listcat.cat_id = pds_category.id
WHERE pds_list.state='apr'
ORDER BY pds_list.d_submit
DESC LIMIT 0,10;")or die(mysql_error());
for($xz=0;$xz<mysql_num_rows($rz);$xz++){
$recent[$xz] = mysql_fetch_assoc($rz);
}
//we now will generate the markup for display
?>
<?PHP
for($xz=0;$xz<count($recent);$xz++){
?>
<dl>
<dt>
<a href="http://www.krazyboyentertainment.com/directory/show.php?lid=<?=$recent[$xz]['list_id']?>"><?=$recent[$xz]['firm']?></a></dt>
<dd><?php if ($recent[$xz]['list_id']=="") echo "<a href=\"/directory/index.php\">Add Your Listing Now</a>"; else echo "Listed In: ";
?><a href="http://www.krazyboyentertainment.com/directory/<?=$recent[$xz]['title']?>-<?=$recent[$xz]['id']?>-0.html"><i><?=$recent[$xz]['title']?><?=$recent[$xz]['id']?></i></a>
</dd>
<dd><i><?=$recent[$xz]['xtra_5']?> <?=$recent[$xz]['xtra_6']?></i></dd><br /><br /></dl>
<?PHP
}
?>
Users browsing this forum: jekwumoore and 1 guest