SQL query and active record - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: SQL query and active record (/showthread.php?tid=8951) |
SQL query and active record - El Forum - 06-06-2008 [eluser]bugboy[/eluser] Hello All Hope your all having a great day. I have a question and its to do with MySQL. (not my strongest point). I need to do what seems like a simple search but for the life of me not work out what to do. I have a table structure like this. Code: cms_stove each stove thats been inputted can have more then one flu type. I need to do a search on this so i can from a html check box list of the flu types get all the stoves without duplicates that have those flu types. I would do a search but i don't even know where to begin on this. Any pointers or links or help would be greatly appecitated. Thanks SQL query and active record - El Forum - 06-06-2008 [eluser]Bramme[/eluser] You'll have to use an inner join if I'm not mistaken. Err, smth like this should do the trick (might not be 100% correct) Code: <input type="checkbox" name="flutype[]" value="type-id-for-foo" />Foo SQL query and active record - El Forum - 06-06-2008 [eluser]bugboy[/eluser] cheers dude I'll try that in a bit and get back to you. Man this community is ace. |