This seems to be a weird glitch in the return of the data. The query runs fine and it dumps the data into the array appropriately, however it wont print the result set correctly. I put in a couple of debug tools and found that its only recognizing the first 5 results, but yet when I do a print_r it prints all of the contents its supposed to have.
// EDITCode:<?php $connection = mysqli_connect("host", "user", "pass"); $printer = $_GET['p']; if( mysqli_select_db($connection, "database") ) { $query = "SELECT DISTINCT p.part_id, p.number, p.description FROM parts_printer AS pp LEFT JOIN parts AS p ON pp.part_id = p.part_id WHERE pp.printer_id = '".$printer."' ORDER BY p.number ASC"; if( $result = mysqli_query($connection, $query) ) { $status1thumb = array(); $status1nothumb = array(); while( $row = mysqli_fetch_assoc($result) ) { $status1thumb[] = array( 'ID' => $row['part_id'], 'NUM' => $row['number'], 'DESC' => $row['description'], ); } mysqli_free_result($result); mysqli_close($connection); } else { echo "query error"; } } else { echo "connection error "; } ?> <html> <head> <title>Parts Verification</title> <style type="text/css"> table { margin: 1em; margin-top: 0; border-left: 1px solid #000; border-top: 1px solid #000; } th,td { border-right: 1px solid #000; border-bottom: 1px solid #000; } </style> </head> <body> <? // Print the Results printf("Query: %s \n", $query); if( !empty($status1thumb) ) { echo "<table><caption>Verified w/ Image length: ". strlen($status1thumb) ."</caption>\n\t<tr>\n"; echo "\t\t<th>Number</th>\n"; echo "\t\t<th>Description</th>\n"; echo "\t\t<th>Preview</th>\n\t</tr>\n"; for($i=0; $i<strlen($status1thumb); $i++) { echo "\t<tr>\n"; echo "\t\t<td title='".$status1thumb[$i]['ID']."'>".$status1thumb[$i]['NUM']."</td>\n"; echo "\t\t<td>".$status1thumb[$i]['DESC']."</td>\n"; echo "\t\t<td><img src='/images/parts/thumbnails/tn_".$status1thumb[$i]['NUM'].".jpg' alt='".$status1thumb[$i]['NUM']." Preview'></td>\n"; echo "\t</tr>\n"; } echo "</table>"; print_r($status1thumb); } ?> </body> </html>
the string length of the array should be 1096 not 5


Reply With Quote
) what a brain fart ... lol thx

Bookmarks