jaxdevil Posted November 12, 2007 Share Posted November 12, 2007 these codes below were working, but they were wrong because I had LIMIT on them and set to one item, now that I removed the LIMIT function from both queries the second one does not pull up at all. Any ideas why? Oh yeah, and the first query is still reflecting just the 10% from the first item, not the array. anyone can figure that out too? I am stumped. Thanks in advance guys, SK <?php $sql = "SELECT * FROM checkout WHERE bidnum=$di"; $query = mysql_query($sql); $sum5 = array(); while($row = mysql_fetch_array($query)) { $sum5[] = $row['amt']; echo "</center>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "<table width=\"1000\" height=\"20\" border=\"1\" bordercolor=\"green\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr>"; echo "<td width=\"900\" align=\"center\" valign=\"middle\">"; echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"; echo "<tr>"; echo "<td width=\"100\">"; echo "</td>"; echo "<td width=\"650\" align=\"center\" valign=\"middle\">"; echo "<font face=\"Tahoma\" size=\"2\"><b>10% Buyers Premium</b></font>"; echo "</td>"; echo "<td width=\"150\">"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</td>"; echo "<td width=\"100\" align=\"center\" valign=\"bottom\">"; echo "<center>"; $sum5 = number_format(array_sum($sum5)*0.1,2,'.',''); echo "" .$sum5; } ?> <?php $sql = "SELECT * FROM checkout WHERE bidnum=$di"; $query = mysql_query($sql); $sum6 = array(); while($row = mysql_fetch_array($query)) { $sum6[] = $row['amt']; echo "</center>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "<table width=\"1000\" height=\"20\" border=\"1\" bordercolor=\"green\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr>"; echo "<td width=\"900\" align=\"center\" valign=\"middle\">"; echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"; echo "<tr>"; echo "<td width=\"100\">"; echo "</td>"; echo "<td width=\"650\" align=\"center\" valign=\"middle\">"; echo "<font face=\"Tahoma\" size=\"2\"><b>7% Sales Tax</b></font>"; echo "</td>"; echo "<td width=\"150\">"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</td>"; echo "<td width=\"100\" align=\"center\" valign=\"bottom\">"; echo "<center>"; $sum6 = number_format(array_sum($sum6)*0.07,2,'.',''); echo "" .$sum6; } ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted November 12, 2007 Share Posted November 12, 2007 Where is $di value coming from? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 12, 2007 Share Posted November 12, 2007 if you don't do or die(mysql_error()); on a query no one will help you Quote Link to comment Share on other sites More sharing options...
jaxdevil Posted November 12, 2007 Author Share Posted November 12, 2007 $di is being called in a GET statement. i.e. deduct.php?di=57 would pull the rows whos bidnum=57 i added the or die statements in the query. I didn't get any errors back. i think it maybe a tables problem? I could be wrong of course. Please help if you can. Thanks in advance, SK Quote Link to comment Share on other sites More sharing options...
Branden Wagner Posted November 12, 2007 Share Posted November 12, 2007 change $sql = "SELECT * FROM checkout WHERE bidnum=$di"; $query = mysql_query($sql); to $sql1 = "SELECT * FROM checkout WHERE bidnum=$di"; $query1 = mysql_query($sql1) or die(mysql_error()); AND change $sql = "SELECT * FROM checkout WHERE bidnum=$di"; $query = mysql_query($sql); to $sql2 = "SELECT * FROM checkout WHERE bidnum=$di"; $query2 = mysql_query($sql2) or die(mysql_error()); Quote Link to comment 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.