Hi, I'm trying to select data from a couple of tables with the same query. Easy right? Well it's driving me crazy. I'm passing an integer via an html form, using php to grab it, and insert it into the query (albumSongs.albumID = 1), to where I want to grab all the data from the first table where albumID equals the number I pass, and the data from songNames for each row that matches in albumSongs (songNamesID = songNamesID) The query executes without error, but no data is returned (the data is there, and should return if my query is right). I'm lost trying to find my mistake.

mysql> show columns from albumSongs;
+-------------+------------+------+-----+---------+-------+
| Field       | Type       | Null | Key | Default | Extra |
+-------------+------------+------+-----+---------+-------+
| albumID     | int(3)     |      |     | 0       |       |
| songNamesID | int(4)     |      |     | 0       |       |
| discNumber  | tinyint(1) |      |     | 0       |       |
| subSong     | int(4)     |      |     | 0       |       |
| trackLength | varchar(5) |      |     |         |       |
| orderBy     | int(3)     |      |     | 0       |       |
+-------------+------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> show columns from songNames;
+---------------+--------------+------+-----+---------+-------+
| Field         | Type         | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| songNamesID   | int(4)       |      |     | 0       |       |
| songNamesName | varchar(196) |      |     |         |       |
+---------------+--------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> SELECT albumSongs.*, songNames.* FROM bytor.albumSongs, bytor.songNames WHERE albumSongs.albumID = 1 && albumSongs.SongNamesID = songNames.songNamesID;
Empty set (0.01 sec)



-- By-Tor.com It's all about the Rush http://www.by-tor.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to