|
Computers Ask about your system/software issues here, or discuss the latest in the field. |
|
Thread Tools | Display Modes |
04-28-2005, 09:10 PM | #1 |
Moderator
|
php/mySQL help
hey dudes and dudettes, hopefully someone can help me:
here is where i am stuck now: i have three sets of queries that insert into seperate tables and then try to view the data that was just inserted. the insertions all work, but only the second SELECT query works. they just don't display the information even though it is in the database. here they are: not working: $query = 'INSERT INTO Review (ReviewTitle, ReviewType, Rating, ArtistID, AlbumID, Text, Link, Picture, AuthorID, Date) VALUES ("'.$reviewtitle.'", "'.$reviewtype.'", "'.$rating.'", "'.$muartist.'", "'.$mualbum.'", "'.$reviewtext.'", "'.$date.'", "'.$url.'", "'.$imageurl.'", "'.$authorname.'")'; $result = mysql_query($query) or die("Query failed: ".mysql_error().$query); echo "<tr><td><p><strong>Added into Review table<strong></p></td></tr>:"; $query = 'SELECT ReviewTitle, ReviewType, Rating, ArtistID, AlbumID, Text, Link, Picture, AuthorID, Date FROM Review WHERE (ArtistID = "'.$muartist.'") AND (AlbumID = "'.$mualbum.'") AND (AuthorID = "'.$authorname.'")'; $result = mysql_query($query) or die("Query failed: ".mysql_error().$query); working: $query = 'INSERT INTO Artist (ArtistID, AlbumID) VALUES ("'.$muartist.'", "'.$mualbum.'")'; $result = mysql_query($query) or die("Query failed: ".mysql_error().$query); echo "<tr><td><p><strong>Added into Artist table<strong></p></td></tr>:"; $query = 'SELECT ArtistID, AlbumID FROM Artist WHERE (ArtistID = "'.$muartist.'") AND (AlbumID = "'.$mualbum.'")'; $result = mysql_query($query) or die("Query failed: ".mysql_error().$query); not working: $query = 'INSERT INTO Album (AlbumID, ReleaseYear) VALUES ("'.$mualbum.'", "'.$muyear.'")'; $result = mysql_query($query) or die("Query failed: ".mysql_error().$query); echo "<tr><td><p><strong>Added into Album table<strong></p></td></tr>:</p>:"; $query = 'SELECT AlbumID, ReleaseYear FROM Album WHERE (AlbumID = "'.$mualbum.'") AND (ReleaseYear = "'.$muyear.'")'; $result = mysql_query($query) or die("Query failed: ".mysql_error().$query); |
04-28-2005, 09:13 PM | #2 |
Moderator
|
ok i'm a tool, i just had some stuff out of order.
|