toda Posted March 10, 2013 Share Posted March 10, 2013 Sorry to say I am a complete beginner in php. The dollar price in the stock details page not showing. Could anyone please help on this issue? The code, at least to my understanding is as follows. <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top:8px;"> <tr class="vehicle_name_price_text"> <td width="572" style="padding-left:30px;"><h2><?php echo $rowmake['name'];?> <?php echo $row['name'];?> - FOB Price: <?php if($row['dis_price']){ echo '<span class="old-price">US $'.number_format($row['price']).'</span> '; echo '<span class="price"> US $' .number_format($row['dis_price']).'</span>'; }else { echo 'US $'. number_format($row['price']); } ?> </h2></td> <td width="185"> </td> </tr> </table></td> </tr> Thanks and regards Quote Link to comment Share on other sites More sharing options...
davidannis Posted March 10, 2013 Share Posted March 10, 2013 Can you add the line print_r($row) ; echo '<br />'; immediately after the <?php This will allow you to see what is in the row to see if there is a price there. I suspect it is blank. Does the price show elsewhere in your system? Did this ever work? Thanks, David Quote Link to comment Share on other sites More sharing options...
toda Posted March 10, 2013 Author Share Posted March 10, 2013 David, Thanks for the help . I added the line as you said and the result is total loss of what I previously had. Now it is giving the following Toyota T/LANDCRUISER PRADO - FOB Price: Array ( [0] => 19 [id] => 19 [1] => 1 [maker] => 1 [2] => 0019 [refno] => 0019 [3] => Wagon [type] => Wagon [4] => TRJ150-XXXXX70 [chassisno] => TRJ150-XXXXX70 [5] => T/LANDCRUISER PRADO [name] => T/LANDCRUISER PRADO [6] => 2009 [model] => 2009 [7] => Right Hand [drive] => Right Hand [8] => 4 [grade] => 4 [9] => 4/A [auction_grade] => 4/A [10] => 2009 [year] => 2009 [11] => December [month] => December [12] => Gasoline/Petrol [fuel] => Gasoline/Petrol [13] => Automatic [transmission] => Automatic [14] => Other => Other [15] => 7 [seats] => 7 [16] => 4 [doors] => 4 [17] => 18500 [km] => 18500 [18] => 2690 [cc] => 2690 [19] => Available [status] => Available [20] => Stock List [stock_location] => Stock List [21] => 0 [price] => 0 [22] => [dis_price] => [23] => Anti-Lock Brakes,Driver Airbag,Passenger Airbag,Side Airbag,A/C: Front,A/C: Rear,Cruise Control,Navigation System,Power Steering,Remote Keyless Entry,Child Seat,Power Seats,Power Windows,Rear Window Defroster,Rear Window Wiper,AM/FM Radio,AM/FM Stereo,Premium Sound,Satellite Radio,DVD,Alloy Wheels,Power Door Locks,Power Mirrors,Sunroof,Power Slide Door,Custom Wheels,Fully Loaded,Maintenance Records [options] => Anti-Lock Brakes,Driver Airbag,Passenger Airbag,Side Airbag,A/C: Front,A/C: Rear,Cruise Control,Navigation System,Power Steering,Remote Keyless Entry,Child Seat,Power Seats,Power Windows,Rear Window Defroster,Rear Window Wiper,AM/FM Radio,AM/FM Stereo,Premium Sound,Satellite Radio,DVD,Alloy Wheels,Power Door Locks,Power Mirrors,Sunroof,Power Slide Door,Custom Wheels,Fully Loaded,Maintenance Records [24] => [comments] => ) US $0 Quote Link to comment Share on other sites More sharing options...
toda Posted March 10, 2013 Author Share Posted March 10, 2013 The price value does not show up anywhere in the system. I it did not work at all from the begining. Sorry to biother. But any ideas how to solve this issue? Thanks and regards Quote Link to comment Share on other sites More sharing options...
Jessica Posted March 10, 2013 Share Posted March 10, 2013 The price is set to 0. The code works. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 10, 2013 Share Posted March 10, 2013 The code David gave you has verified what Jessica has just said, that the price is 0 in your data. Problem solved. [21] => 0 [price] => 0 If this is you opinion of debugging and the result is total loss of what I previously had you should probably consider taking up something other than programming. 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.