Welcome Guest, Not a member yet? Register   Sign In
help me write this mysql query in codeigniter

(This post was last modified: 11-12-2019, 03:49 AM by Chivinsdev.)

Try this one I hope it will help you get what you are looking for.

in your controller.

Either you autoload the database in autoload file or you load it to the controller straight by

PHP Code:
$this->load->database(); // within the controller but I prefer autoload 

in your model just continue with

PHP Code:
public function searchListing($data$location) {
$q $this->db->select('*, ABS( post_code - '.$location.') AS distance')

I used the chaining method which is the shorter method. So try it I hope it will help you.
If you are facing more problem and confused let me know either you private message me or drop your problem here. I am here to help

Messages In This Thread
RE: help me write this mysql query in codeigniter - by Chivinsdev - 11-12-2019, 03:12 AM

Theme © iAndrew 2016 - Forum software by © MyBB