Welcome Guest, Not a member yet? Register   Sign In
Need help with active record
#9

[eluser]theshiftexchange[/eluser]
Ok - now try and add a new record called "testinserttest"

Now run

Code:
$query=$this->db->query(“select * from UserTable where Username like ‘%insert%’”);

Does that work?

No? Then the issue is with the word "insert". You might need to double escape it or something so MYSQL knows it is a text field, not a command.

Yes? Then the issue is because you are looking for a wildcard on the left, but there is no text to the left. i.e.

Code:
$query=$this->db->query(“select * from UserTable where Username like ‘%insert%’”);  

vs

$query=$this->db->query(“select * from UserTable where Username like ‘insert%’”);



Messages In This Thread
Need help with active record - by El Forum - 04-13-2012, 08:12 PM
Need help with active record - by El Forum - 04-13-2012, 09:02 PM
Need help with active record - by El Forum - 04-13-2012, 09:07 PM
Need help with active record - by El Forum - 04-13-2012, 09:49 PM
Need help with active record - by El Forum - 04-13-2012, 10:02 PM
Need help with active record - by El Forum - 04-13-2012, 10:25 PM
Need help with active record - by El Forum - 04-13-2012, 10:29 PM
Need help with active record - by El Forum - 04-13-2012, 11:44 PM
Need help with active record - by El Forum - 04-14-2012, 05:32 AM
Need help with active record - by El Forum - 04-15-2012, 10:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB