Welcome Guest, Not a member yet? Register   Sign In
Retrieving Fields From Database

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

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

CodeIgniter Database Class Examples

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.

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

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.

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....

Theme © iAndrew 2016 - Forum software by © MyBB