Re: Problem with PHP, but I know it MySQL

2002-06-16 Thread Zak Greant

On Sat, 2002-06-15 at 05:31, Chuck Payne wrote:
...
 // 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 . /ABR\n;
 
 }
 
 What am I doing working.

  Hi Chuck,

  What happens if you run the query in the mysql command line client?

-- 
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Zak Greant [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Advocate
/_/  /_/\_, /___/\___\_\___/   Calgary, Canada
   ___/   www.mysql.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Problem with PHP, but I know it MySQL

2002-06-16 Thread Chuck \PUP\ Payne

A friend of my who is a programmer helped me only after I gave up on the
mailing answering me. So it is fix now. I had to the following...


// This is the actor query

 $sql = SELECT concat_ws(\ \, fname, lname)as actor FROM actormovie WHERE
title = '$title';
$result = mysql_query($sql);

$actor = ;

while ($myrow = mysql_fetch_array($result)) {
  $actor = $myrow[actor];
  $actor .= A HREF='' . $actor . /ABR\n;
}


where you set $actor = , it needs to be $actors, then the while loop
should look like this;

$actors = ;

while ($myrow = mysql_fetch_array($result)) {
  $actor = $myrow[actor];
  $actors .= A HREF='' . $actor . /ABR\n;
}

 
then when putting the info in the table, in the cast part you want to put
$actors and not $actor. What is happening is that $actor is being reset
every time you go through the loop.

Thanks anyway, but I felt no was going to help me, since no answer after a
day.

Chuck


On 6/15/02 10:42 PM, Zak Greant [EMAIL PROTECTED] wrote:

 On Sat, 2002-06-15 at 05:31, Chuck Payne wrote:
 ...
 // 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 . /ABR\n;
 
 }
 
 What am I doing working.
 
 Hi Chuck,
 
 What happens if you run the query in the mysql command line client?


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Problem with PHP, but I know it MySQL

2002-06-14 Thread Chuck Payne

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 . /ABR\n;

}

What am I doing working.

Chuck Payne





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php