-1

This is the code that i retrieve data from sql in this case ¨Km¨ is added before value but i will ¨Km¨ after value ..

example :

now is like this : Km 129.000

but i will 129.000 km

$insert1 =" /// Km: ";
        $string = "km <pre>{$insert1}</pre>";
        $query = '
       '.$item->getId();
        $db->setQuery( $query );
        $result = $db->loadResult();
        if($result) {
        $result = str_replace('*','',$result);
        print_r($insert1);
        print_r($result);
        }
  • to be honest either it's too late or I can't make much sense of your code – FFrewin Jul 21 '17 at 0:52
  • @FFrewin - I was thinking the same thing :) – Lodder Jul 21 '17 at 9:30
1

You simply need to add the km after the result from the database, like so:

$result = $db->loadResult();

if ($result)
{
    echo $result . ' km';
}
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.