At 11/1/2002, you wrote:
I have a website using PHP and MySQL and having a problem.

This is what I have:

$db = mysql_connect("1.1.1.1","name","password");
mysql_select_db("database");
$query = "SELECT title, artist FROM songlist WHERE songlist.songid=1";
$result = mysql_query($query) or die("Query failed");

Then I have the following to display the data:

    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        foreach ($line as $col_value) {
                   print "<BR>$col_value\n";
        }
    }


What I get is:

Name of Song
Artist


What I want is:

Name of Song (Artist)
 while ($line = mysql_fetch_array($result)) {
      print "<br>$line["title"] . " (" . $line["artist"] . ")";
    }




-------------------------
Pekka Saarinen
http://photography-on-the.net
-------------------------



---------------------------------------------------------------------
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

Reply via email to