I have a query I'm using to pull in content based on a record number, but for some reason I can only grab certain records. When I output it onto a page, some records show up as completely blank.
$testSQL = mysql_query("SELECT * FROM `uploads` WHERE (`tableName`='data_table' AND `recordNum` = '112' AND `fieldName` = 'pdf')");
$testSQL = mysql_fetch_assoc($testSQL);
print_r($testSQL);
Theq query above outputs results, but when I change 'recordNum' to 80, I get nothing.
There is only one item for each record number. When I paste the query into mysql admin, it returns the correct result for both record 80 and record 112. But when I place full code on my page I can only get record 112. Any idea why one record is showing up as empty? The result is laid out exactly the same in mysql admin.
EDIT: Here's the output from mysql admin
-----------------------------------------------
num | order | tableName | fieldName | recordNum
-----------------------------------------------
20 | 1 | data_table | pdf | 112
-----------------------------------------------
20 | 1 | data_table | pdf | 80
EDIT 2: recordNum is set up as a string (VARCHAR255) and it doesn't seem like there are any spaces aren't the values of recordNum - I just highlighted the text, is there a better way to determine that?
ANOTHER UPDATE
I did a test pull to grab all of the data and it only pulled in the first 64 records. MySQL admin is telling me there are 102 records. Is there anything that could be causing my query to be limited?
FINAL UPDATE
I had a bug further up on my page prior to running this sql query from a different query that was causing the problem