you have an extra semicolon in the for statement
it should be
for (0 < $i > $count; $currrent_row = mysql_fetch_row($result); ++$i)
$path=$current_row[2]"; file://database field position matched index
number
print "<a href = $path>$count</a><br>"; //
}
hope that helps
Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India
----- Original Message -----
From: "andrew" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 10:24 AM
Subject: [PHP] Build HREF list from database???
> Hi - I want to print a list of numbers linked to URLs I create on the
fly -
> something like this:
>
> table:
> -------------------
> path pid
> ---------|---------
>
> foo.jpg 1
> bar.jpg 1
>
> <?php
>
> include("db_connection_params.inc"); file://all relevant database
variables
> $sql="select path from table where pid =1"; file://obvious
> $link_id = mysql_connect($host, $usr, $pass); file://get connection handle
>
> $result = mysql_db_query($database, $sql, $link_id);
> $count = mysql_num_rows($result) or die ("no rows returned from $sql");
>
> $i = 0; file://initialze counter
>
> for (0 < $i > $count; $currrent_row = mysql_fetch_row($result); ++$i;)
>
>
>
> $path=$current_row[2]"; file://database field position matched index
number
> print "<a href = $path>$count</a><br>"; //
> }
>
> ?>
>
> so I want this to print:
> 1 (linked to foo.jpg)
> 2 (linked to bar.jpg)
>
> The problem is I'm getting a parse error on the "for" line.
>
> Any ideas?
>
> TIA,
> andrew
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]