Why does query work in MySQL but not in PHP doc
| From: | Fates | Date: | Sat, 08 Jul 2000 11:19:34 +0000 |
| Subject: | Why does query work in MySQL but not in PHP doc | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5527@lists.php.net to get a copy of this message | ||
I am using two tables within one database and want to query both tables:
When I type this line in MySQL program it works:
SELECT * from albums, songs WHERE albums.AlbumID = 2 and songs.albumid = 2 and albums.album =
"Collection";
When I try and use this with php form I get nothing
$query = "SELECT * FROM albums, songs WHERE albums.AlbumID = 2 and songs.albumid = 2 and
albums.album = "Collection";
$result = mysql_db_query("musicdb", $query);
if ($result) {
echo "Found these entries in the database:<ul>";
while ($r = mysql_fetch_array($result)) {
$AlbumID = $r["AlbumID"];
$Album = $r["Album"];
<TD> <? echo "$Album"; ?></TD>
<TD> <? echo "$Artist"; ?></TD>