Welcome Guest, Not a member yet? Register   Sign In
Query not following rules!!
#12

[eluser]TWP Marketing[/eluser]
[quote author="codemonkey" date="1347049651"]

Code:
$this->db->where('added_by', $tech);

$this->db->like('ticket_num','match');
$this->db->or_like('part_num','match')
$this->db->or_like('make','match');
$this->db->or_like('model','match');;
$this->db->or_like('user_first_name','match');
$this->db->or_like('user_last_name','match');
$this->db->or_like('reason','match');
$this->db->or_like('date_created','match');

$this->db->limit(100);
$this->db->order_by('date_created', 'DESC');
$query = $this->db->get('item_history');
return $query->result();

Code:
AND  `ticket_num`  LIKE '%%'
OR  `serial_num`  LIKE '%%'
OR  `part_num`  LIKE '%%'
OR  `make`  LIKE '%%'
OR  `model`  LIKE '%%'
OR  `user_first_name`  LIKE '%%'
OR  `user_last_name`  LIKE '%%'
OR  `reason`  LIKE '%%'
OR  `date_created`  LIKE '%%'
ORDER BY `date_created` DESC
LIMIT 100

Thank you[/quote]

I see two things. First, the SQL query string contains a LIKE string of '%%' where it should contain '%match%'. That tells me that your original POST to set the value of $match is not returning the string 'match':
Code:
$match = $this->input->post('search');

Second, Note the top code block, above, where I hand coded the match string as 'match' for each OR_LIKE clause.
If you try that, what happens?
If it fails, then comment out all but one OR_LIKE clause and test it again.


Messages In This Thread
Query not following rules!! - by El Forum - 09-07-2012, 01:27 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:30 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:33 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:45 PM
Query not following rules!! - by El Forum - 09-07-2012, 01:49 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:04 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:10 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:23 PM
Query not following rules!! - by El Forum - 09-07-2012, 02:29 PM
Query not following rules!! - by El Forum - 09-07-2012, 05:00 PM
Query not following rules!! - by El Forum - 09-10-2012, 06:27 AM
Query not following rules!! - by El Forum - 09-10-2012, 07:17 AM
Query not following rules!! - by El Forum - 09-10-2012, 07:44 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:07 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:15 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:38 AM
Query not following rules!! - by El Forum - 09-10-2012, 08:51 AM
Query not following rules!! - by El Forum - 09-10-2012, 09:14 AM
Query not following rules!! - by El Forum - 09-10-2012, 09:36 AM
Query not following rules!! - by El Forum - 09-10-2012, 11:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB