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)

So how do I get the output to be on the same line.  I have a search
statement which I am having the same problem with.

Any input is appreciated.



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