OMG what is up with the documentation...... - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: OMG what is up with the documentation...... (/showthread.php?tid=33053) |
OMG what is up with the documentation...... - El Forum - 08-13-2010 [eluser]Neocrypter[/eluser] Ok so this is the second time ive looked at the documentation use the example in there and its not doing what it says it dose. example my current issue Code: $id=2; that should produce SELECT * WHERE banned_user_id = '2' by my figuring, but what im getting is SELECT 2 WHERE banned_user_id = 2 and the example as take straight from the online docs http://ellislab.com/codeigniter/user-guide/database/active_record.html Code: $this->db->where('name', $name); Earlier in the doc i read that the db assumes * when when SELECT $X is not supplied am I missing something or is the docs not accurate OMG what is up with the documentation...... - El Forum - 08-13-2010 [eluser]Clooner[/eluser] [quote author="Neocrypter" date="1281759675"]Ok so this is the second time ive looked at the documentation use the example in there and its not doing what it says it dose. am I missing something or is the docs not accurate[/quote] If you follow the manual it will exactly describe how to use AR correctly. Like so! Code: $this->db->where('banned_user_id', $id); OMG what is up with the documentation...... - El Forum - 08-13-2010 [eluser]Neocrypter[/eluser] yup i tried that too exact same result as with what i have above, when i pasted that code it was me trying random things to try and sort it out. Code: $this->db->where('banned_user_id', $id); Quote:A Database Error Occurred OMG what is up with the documentation...... - El Forum - 08-13-2010 [eluser]Clooner[/eluser] [quote author="Neocrypter" date="1281760524"]yup i tried that too exact same result as with what i have above, when i pasted that code it was me trying random things to try and sort it out.[/quote] I didn't use AR for a while but AFAIK AR works really well for the basic stuff What kind of db are you using, anything special? Did you retrieve the query generated by the profiler? OMG what is up with the documentation...... - El Forum - 08-13-2010 [eluser]cahva[/eluser] You must have have select somewhere there as that example works for other people OMG what is up with the documentation...... - El Forum - 08-13-2010 [eluser]Neocrypter[/eluser] nope the db is nothing special at all, and as far as i can tell i dont have it anywhere as im directly calling the function in my model that uses's that code snipet im completely at a loss with what is going on OMG what is up with the documentation...... - El Forum - 08-13-2010 [eluser]John_Betong[/eluser] Try this: Code: $id = 2; OMG what is up with the documentation...... - El Forum - 08-14-2010 [eluser]WanWizard[/eluser] You can't put the where after the get, that doesn't work. Can you do Code: var_dump($this->db->ar_select); OMG what is up with the documentation...... - El Forum - 08-14-2010 [eluser]Neocrypter[/eluser] ok got passed that issues, its all working now, i went back through my code line by line and i did have a select statement in there, >.<, another quick question in my view i have a form im using the built in form helper im creating all the fields with arrays and form_X($y) which is pulling up the form and populating it correctly but when i go to submit its telling me that $y is an undefined variable why would it be doing that since $y is the array thats building the form which obviously working. example Code: <?php foreach($query as $row): clicking submit gives me this Quote:A PHP Error was encountered Also sorry im asking so many questions, but im on a major time crunch with this as in ive got to get it done tonight or my wife kids and I are going to get an eviction notice tomorrow... first paying job ive had In long time but i think its came a little too late. OMG what is up with the documentation...... - El Forum - 08-14-2010 [eluser]pickupman[/eluser] Code: foreach($query->result() as $row){ Keep in mind that your foreach loop is only going to create one field. It will iterate each result and only save the string from the last iteration. |