Jump to content

[SOLVED] results from DB not correct


dennismonsewicz

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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>';
				}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.