YoungNate_Black_coder Posted July 7, 2011 Share Posted July 7, 2011 function get_inc(){ $clutches = "SELECT * FROM cluth WHERE uid = '$id'"; $clu = mysql_query($clutches)or die(mysql_error()); $result = mysql_fetch_array($clu,MYSQL_ASSOC); $i = 1; echo "<tr><td>Number.</td><td>clutch Size.</td><td>Worth</td></tr>"; while($result = mysql_fetch_array($clu,MYSQL_ASSOC)){ $cid = $result['id']; $sire = $result['sire']; $dame = $result['dame']; $datel = $result['date_layed']; $size = $result['size']; $price = $result['price']; echo "<tr><td>$i.</td><td> <a href=\"?room&height=350&width=520&modal=true\" class=\"thickbox\" title=\"$sire+$dame\"> ($size) Egg Clutch</a> </td><td>$price</td></tr>"; $i++; } } Quote Link to comment https://forums.phpfreaks.com/topic/241292-anything-wrong-with-this-query/ Share on other sites More sharing options...
AyKay47 Posted July 7, 2011 Share Posted July 7, 2011 function get_inc(){ $clutches = "SELECT * FROM cluth WHERE uid = '$id'"; $clu = mysql_query($clutches)or die(mysql_error()); echo "<tr><td>Number.</td><td>clutch Size.</td><td>Worth</td></tr>"; $i = 1; while($result = mysql_fetch_array($clu,MYSQL_ASSOC)){ //result_type is not needed but is fine as-is $cid = $result['id']; $sire = $result['sire']; $dame = $result['dame']; $datel = $result['date_layed']; $size = $result['size']; $price = $result['price']; echo "<tr><td>$i.</td><td>"; <a href=\"?room&height=350&width=520&modal=true\" class=\"thickbox\" title=\"$sire+$dame\"> ($size) Egg Clutch</a> </td><td>$price</td></tr>"; $i++; } } only thing I changed is the redundancy of the $result variable you can also echo $i++ instead of $i whats going on with your href? Quote Link to comment https://forums.phpfreaks.com/topic/241292-anything-wrong-with-this-query/#findComment-1239413 Share on other sites More sharing options...
YoungNate_Black_coder Posted July 7, 2011 Author Share Posted July 7, 2011 Thanks Buddy Worked Out Great!!! Quote Link to comment https://forums.phpfreaks.com/topic/241292-anything-wrong-with-this-query/#findComment-1239418 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.