Welcome Guest, Not a member yet? Register   Sign In
Create a variable in my model?
#1

[eluser]ChrisF79[/eluser]
This is a very remedial question I'm sure but I have the following:

Controller
Code:
$data['records'] = $this->property_model->getOneProperty($data['mls_listing_id']);
$this->load->view('property', $data);

Model
Code:
(query here)

if($q->num_rows() > 0) {
    foreach ($q->result() as $row) {
    $data[] = $row;
    }
return $data;

View
Code:
<?php foreach ($records as $r) : ?>
<th>Asking Price:</th>
<td>$&lt;?php echo number_format($r->SALE_PRICE); ?&gt;</td>

I've trimmed most of the detail away for a simple example.

My question is, the query pulls things like the street number, street name, city, state, zip, etc. I want to combine all of that into a "address" variable. How do I do it in my model so that I can use it as $r->address; in my view?


Messages In This Thread
Create a variable in my model? - by El Forum - 09-21-2012, 11:28 AM
Create a variable in my model? - by El Forum - 09-21-2012, 11:56 AM
Create a variable in my model? - by El Forum - 09-21-2012, 01:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB