Okay, am creating a checklist of books (two actually). This displays their name, price, rarity, and a checkbox. I have one list that shows all books that have been Read. One shows all books that have Not been read. In order to do this I have two tables.
One is called collector_books. This contains approx 1400 books, their prices, their rarity (just a number...ranking system for rarity), and an sid number.
Then I have a second table, called collector_books_read. This contains only two things sid and uid. This table is what will be storing the data to determine which books a user has read.
The coding below is what I am using to display what books a user has read or has not read. It works fine for displaying what books a user Has read. However, the modification I did to show what books a user has Not read, does not work. The modification is what I show below. The only thing I changed was the $query statement. When I want to show what books I have read, I have "WHERE A1.sid = A2.sid"...that works. I thought changing the Equals to Not Equals would be all I have to do to get it to work show ones that I have Not read...however, instead it displays all the books twice, with the exception of the ones I have read (the ones I have read only show up once). To me, this shows that it is SEMI-working because it is eliminating the ones I have read...but for some reason shows the entire first table again.
I hope that all made sense...I know, very wordy. Don't mind the checkboxes, I haven't gotten to the stage where I can actualy have users check stuff off to move it from unread to read...or vise-versa.
Help is appreciated. I'm quite new to all this php/mysql stuff so please talk in lamenst(sp?) terms.
<?php
global $user;
$db = mysql_connect("localhost", "collin","MYPASSWORD");
mysql_select_db("colliny2k_neo",$db);
$query="SELECT * FROM collector_books A1, collector_books_read A2 WHERE A1.sid <> A2.sid AND A2.uid = $user->uid ORDER BY A1.book ASC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "Book Collector Checklist