Welcome Guest, Not a member yet? Register   Sign In
Associate two table fields.
#1

[eluser]0plus1[/eluser]
Normally i would do this:

Code:
$sql = "SELECT id, label, link_url FROM `table` ORDER BY `order` ASC";
$items = mysql_query($sql) or die(mysql_error());
while ($obj = mysql_fetch_object($items)) {
    $sub_menu[$obj->id]['id'] = $obj->id;
    $sub_menu[$obj->id]['url'] = $obj->label.$obj->link_url;
}
mysql_free_result($items);

What is the correct way in code igniter?
#2

[eluser]0plus1[/eluser]
Or maybe just this?

SELECT ... (FIELD1+FIELD2) as COMBOFIELDS, ...
#3

[eluser]TheFuzzy0ne[/eluser]
Have you read the [url="http://ellislab.com/codeigniter/user-guide/database/index.html"]user guide[/url]? I'm not sure you have, since there is adequate information provided there you get you going.

I don't really understand what you mean by "associate two table fields". If you can post some code that demonstrates that you have read and understood the user guide, I'm sure it will be much easier for someone to help you.




Theme © iAndrew 2016 - Forum software by © MyBB