CodeIgniter Forums
Retrieving Fields From Database - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Retrieving Fields From Database (/showthread.php?tid=10859)

Retrieving Fields From Database - El Forum - 08-15-2008

Iam new to code igniter technique. Got a problem relating to retrieving fields from database.
According to the logic, I query database for desired/selected field results and send them to any page view. In a normal way the array of results ,have same names as database field names. So printing the array as $row->Name(field). In a way its working fine,but....

The problem is that, when any field is empty , its gives error Undefined index

Retrieving Fields From Database - El Forum - 08-21-2008

[eluser]Phil Sturgeon[/eluser]
$row->fieldname will do the trick. Check out the manual on this, its very good.

CodeIgniter Database Class Examples

Retrieving Fields From Database - El Forum - 08-22-2008

It was not with the syntax "$row->field", the problem was, if the field was empty, instead of displaying nothing,in simple way of php,it was giving error.

But got the problem cleared. Thanks for the reply.

One another thing, kind of having problem with routing & htaccess. Can you provide any good resource for it. Plus for adding a suffix ".html" , it doesnt add to all urls, only one or two.

Retrieving Fields From Database - El Forum - 08-22-2008

Check this out for the .htaccess... you just throw that in the dame directory as your index.php and system folder and your set. Make sure you make the changes in your config file.

Hope that helps, it helped me when I was new Smile

Retrieving Fields From Database - El Forum - 08-22-2008

That didnt resloved.
Already have placed the file in right level, i-e same directory where index.php resides.

writing "RewriteEngine on" cause Html Error 500.
and removing it cause Html Error 404.

Is there a way ,to configure whether ,apache is accepting htaccess directives.

Thanks for guidance.

Retrieving Fields From Database - El Forum - 08-23-2008

I need urgent help for CI ....I already create CI model and controller...and 2 view files for search ....
but i can not retrive my search result .... using 2 select option ...
please check my files ..and give me solution as soon as possible...
I am looking forward to hear from you....