dennismonsewicz Posted June 29, 2009 Share Posted June 29, 2009 Code: foreach($deduct_rows as $rows) { echo '<div style="padding-top:20px;">'; echo '<span class="maintitle" style="font-size: 30px !important; display: block;">Your deductible is $'. $rows->deductible .'</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 20px;">Your bundle price is $' . $rows->bundle . '</span'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your insurance price is $' . $rows->insurance . '</span'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your warranty price is $' . $rows->warranty . '</span'; echo '</div>'; } The results come back as the following: $.99 when in the DB the actual row is 5.99 So its cutting off the first character.... any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/ Share on other sites More sharing options...
KevinM1 Posted June 29, 2009 Share Posted June 29, 2009 You're echoing out four distinct values...are they all screwed up, or just one of them? Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865694 Share on other sites More sharing options...
dennismonsewicz Posted June 29, 2009 Author Share Posted June 29, 2009 All of them... and if I print_r($rows); then the results display as they should. For some reason the Span tag is messing everything up Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865697 Share on other sites More sharing options...
J.Daniels Posted June 29, 2009 Share Posted June 29, 2009 '</span'; You are missing the closing bracket on 3 lines. Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865699 Share on other sites More sharing options...
dennismonsewicz Posted June 29, 2009 Author Share Posted June 29, 2009 yeah I noticed that and that didn't fix the problem updated code: foreach($deduct_rows as $rows) { echo '<div style="padding-top:20px;">'; echo '<span class="maintitle" style="font-size: 30px !important;">Your deductible is $' . $rows->deductible . '</span>'; echo $rows->deductible; echo '</div>'; } If I echo out the deductible and it is not inside the span tag then everything displays like it should Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865703 Share on other sites More sharing options...
J.Daniels Posted June 29, 2009 Share Posted June 29, 2009 Can you do a view source and post the generated output? Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865707 Share on other sites More sharing options...
dennismonsewicz Posted June 29, 2009 Author Share Posted June 29, 2009 <div class="maintitle" style="font-size: 30px ! important;">Your Deductible is .00</div> I have it boiled down to if I include an HTML $ symbol then it doesn't display the characters before the decimal for some reason Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865714 Share on other sites More sharing options...
dennismonsewicz Posted June 29, 2009 Author Share Posted June 29, 2009 I got it fixed. I had to escape the $ symbol updated code: foreach($deduct_rows as $rows) { $deduct = $rows->deductible; echo '<div style="padding-top:20px;">'; echo '<span class="maintitle" style="font-size: 30px !important; display: block;">Your deductible is \$'. $rows->deductible .'</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 20px;">Your bundle price is \$' . $rows->bundle . '</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your insurance price is \$' . $rows->insurance . '</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your warranty price is \$' . $rows->warranty . '</span>'; echo '</div>'; } Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865716 Share on other sites More sharing options...
JJ2K Posted June 29, 2009 Share Posted June 29, 2009 Dont you need to escape the dollar symbol like \$ EDIT: Sorry to slow Quote Link to comment https://forums.phpfreaks.com/topic/164110-solved-results-from-db-not-correct/#findComment-865720 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.