php-general | 2001062
Date: 06/24/01
- Next message: Andreas D. Landmark: "Re: [PHP] PHP 4.0.6 + GD 2.0.1"
- Previous message: Rouvas Stathis: "Re: [PHP] Oracle Database keeps disconnecting - or something"
- In reply to: McShen: "Re: [PHP] ->>coding help"
- Next in thread: Hugh Bothwell: "Re: [PHP] ->>coding help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Oops..was overwriting the $result variable...hehe....its fixed.
<?php
$connection = mysql_connect("***","****","****");
if ($connection==false)
{
echo mysql_errno().":".mysql_error()."";
exit;
}
$end = $list + 16;
$query = "SELECT * FROM refer ORDER BY hits desc LIMIT $list, $end";
$result = mysql_db_query ("celebzone", $query);
$num = mysql_num_rows($result);
$j=0;
$i=0;
echo "<table border=0>\n";
for ($j = 0; $j < $num; $j++)
{
echo '<tr>\n';
for ($i = 0; $i <= 1; $i++)
{
@$data = mysql_fetch_array($result);
@$id = $data[id];
@$title = $data[title];
echo "<td>\n";
echo "$title";
echo "</td>\n";
}
echo "</tr>\n";
}
echo "</table>";
echo "<br><br>\n";
?>
Jason Lotito
www.NewbieNetwork.net
PHP Newsletter: http://www.newbienetwork.net/ciao.php
PHP, MySQL, PostgreSQL Tutorials, Code Snippets, and so much more
> -----Original Message-----
> From: McShen [mailto:webmaster <email protected>]
> Sent: Sunday, June 24, 2001 10:45 AM
> To: php-general <email protected>
> Subject: Re: [PHP] ->>coding help
>
>
> Jason, your scripts works prefectly in creating a table. But,
> It only ouputs the first query from the databse. Others are
> not shown. ""Jason Lotito"" <jason <email protected>> wrote in
> message news:000f01c0fc67$abfe3a90$72003bd0 <email protected>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andreas D. Landmark: "Re: [PHP] PHP 4.0.6 + GD 2.0.1"
- Previous message: Rouvas Stathis: "Re: [PHP] Oracle Database keeps disconnecting - or something"
- In reply to: McShen: "Re: [PHP] ->>coding help"
- Next in thread: Hugh Bothwell: "Re: [PHP] ->>coding help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

