anchor() function problem... - 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: anchor() function problem... (/showthread.php?tid=13171) |
anchor() function problem... - El Forum - 11-13-2008 [eluser]XssLab[/eluser] Hello, sorry but I have a simple problem with anchor function.... an example: Code: <?= anchor('users/delete/', 'delete'); ?> I need to append ID user to delete/ and... I try with: Code: <?= anchor('users/delete/'".$row->id."', 'delete'); ?> but, the HTML output... is without ID! Where is the problem? anchor() function problem... - El Forum - 11-13-2008 [eluser]rogierb[/eluser] What's up with the quotes? Code: <?= anchor('users/delete/'".$row->id."', 'delete'); ?> Try Code: <?= anchor('users/delete/'.$row->id, 'delete'); ?> And check if $row->id has a value anchor() function problem... - El Forum - 11-13-2008 [eluser]XssLab[/eluser] [quote author="rogierb" date="1226606196"]What's up with the quotes? Code: <?= anchor('users/delete/'".$row->id."', 'delete'); ?> Try Code: <?= anchor('users/delete/'.$row->id, 'delete'); ?> And check if $row->id has a value [/quote] Mumble, you are right! This is a foreach right code: Quote:foreach($query->result() as $ker => $value) Thanks ! anchor() function problem... - El Forum - 11-13-2008 [eluser]JoostV[/eluser] rogierb is right... If $row->id has no value, this statement will delete ALL the records in your table... So, in your controller: Code: function delete() And in your model 'users': Code: function delete($user_id) anchor() function problem... - El Forum - 11-13-2008 [eluser]XssLab[/eluser] [quote author="JoostV" date="1226607548"]rogierb is right... If $row->id has no value, this statement will delete ALL the records in your table... So, in your controller: Code: function delete() And in your model 'users': Code: function delete($user_id) Yeah, it's a fantastic model! Very very good anchor() function problem... - El Forum - 11-13-2008 [eluser]JoostV[/eluser] ;-P |