Ok. Go to this link...
http://www.magidesign.com/movielist.php and select "12 Monkeys" You will see
that only picked one actor...
It should have pick four
mysql> SELECT concat_ws(" ", fname, lname) as actor FROM actormovie WHERE
title = "12 Monkeys" ORDER BY lname;
+---------------------+
| actor |
+---------------------+
| Brad Pitt |
| Christopher Plummer |
| Madeleine Stowe |
| Bruce Willis |
+---------------------+
4 rows in set (0.01 sec)
I know that the problem is some where in this statement...
$sql = "SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
title = '$title' ORDER by lname";
$result = mysql_query($sql);
$actor = "";
while ($myrow = mysql_fetch_array($result)) {
$actor = $myrow[actor];
$actor .= "<A HREF=''>" . $actor . "</A><BR>\n";
}
Only thing is I am brain dead and can't see it...
Thanks for the help...
Chuck
On 6/15/02 12:10 AM, "Tyler Longren" <[EMAIL PROTECTED]> wrote:
> you need to put your $myrow in a while loop:
>
> while ($myrow = mysql_fetch_array($result)) {
>
> $title = $myrow[title];
> $videoid = $myrow[videoid];
> $catergory = $myrow[catergory];
> $appraisal = $myrow[appraisal];
>
> // blah blah blah everything else
> }
>
> Tyler Longren
> Captain Jack Communications
> www.captainjack.com
> [EMAIL PROTECTED]
>
> ----- Original Message -----
> From: "Chuck Payne" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Friday, June 14, 2002 11:03 PM
> Subject: [PHP] Problem with MySQL
>
>
> Hi,
>
> I am working on a movie database I have two database that I am calling from
> but the problem I am having when I ask it to go and fetch all the movies
> with the same title, it stops and only shows one.
>
> Here is a basic layout...
>
> if($videoid) {
>
> $result = mysql_query("SELECT * FROM library WHERE videoid=$videoid",$db);
>
> $myrow = mysql_fetch_array($result);
>
> // The Myrows
>
> $title = $myrow[title];
> $videoid = $myrow[videoid];
> $catergory = $myrow[catergory];
> $appraisal = $myrow[appraisal];
>
> // Some where here it's not working.....
>
> $sql = "SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
> title = '$title' ORDER by lname";
> $result = mysql_query($sql);
> print $sql;
>
> $actor = "";
> while ($myrow = mysql_fetch_array($result)) {
> $actor = $myrow[actor];
> $actor .= "<A HREF=''>" . $actor . "</A><BR>\n";
>
> }
>
> What am I doing wrong? It only show one record and it show more.
>
> Chuck Payne
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php