so the other day i posted a way i found of making car images work, and urbanmafia kindly shared his simple way of adding car images to garage
since this , ive also added it so that when a user steals the car that also calls the image to be pulled up via the db
however the current issue im having is , im tryint ti make it possible to re-view the car ,by reading the cars id , then finding the pic field in the db from this for some reason this isnt working and i was wondering if anyone could points out what im doing wrong here ?
public function method_view() {
$id = $this->methodData->id;
$car = $this->db->prepare("SELECT * FROM garage INNER JOIN cars ON (CA_id = GA_car) WHERE GA_id = :car");
$car->bindParam(':car', $id);
$car->execute();
$car = $car->fetchObject();
if (empty($car) || $car->GA_uid != $this->user->id) {
$this->alerts[] = $this->page->buildElement('error', array("text"=>'You dont own this car or it does not exist!'));
} else {
$this->alerts[] = $this->page->buildElement('success', array(
"text" => '<img src="http://criminalempire.co.uk/<{image}>"><br>Your Currently Viewing '));
$this->db->query("UPDATE userStats SET US_money = US_money + 0 WHERE US_id = ".$this->user->id);
$actionHook = new hook("userAction");
$action = array(
"user" => $this->user->id,
"module" => "garage.view",
"id" => $car->CA_id,
"success" => true,
);
$actionHook->run($action);
}
}
its now successfuly reading the car id .. and i can now click on the car and view the car id .. the problem im having is with
$this->alerts[] = $this->page->buildElement('success', array(
"text" => '<img src="http://criminalempire.co.uk/{image}"><br>Your Currently Viewing '));
this for some reason not alowing me to call the image even though its showing the car id , and then reading the CA_image table .. but for some reason this isnt working and i dont know why
this is what i get ... but am yet to actualy get any sort of picture
please if somone could help that would be great