URL and/or anchor from database |
[eluser]Unknown[/eluser]
Hey guys, I've run into a small problem, that might be more PHP than CI, but I would appreciate any help. I'm developing a basic website, formatted for the iphone to display a menu from a mySQL database. So far, so good. I've got my main view setup and it reads the records from the database beautifully. Here is the code: Code: <?php foreach($query->result() as $row): ?> The problem lies in the anchor. Obviously I dont wan't all the generated links to go to appetizers.html, thats just in there for testing. I want each link to go and pull a different query, which is doable, I just have to follow the blog video tutorial. But the link in that tutorial is below the foreach statement. My goal is to have the link go to www.mydomain.com/index.php/catDesc where catDesc is the data pulled from the database. Then that view will display all the items under that category. Does this make sense? I swear it does in my head. Again, any help would be appreciated. Thanks in advance...
[eluser]umefarooq[/eluser]
hi try to use CI anchor it will solve you problem. Code: anchor(uri segments, text, attributes) check the user guide also http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]Unknown[/eluser]
[quote author="umefarooq" date="1248344914"]hi try to use CI anchor it will solve you problem. Code: anchor(uri segments, text, attributes) check the user guide also http://ellislab.com/codeigniter/user-gui...elper.html[/quote] Thanks for the quick response. I did try that, but I cant seem to get the uri segments to be dynamically pulled from the database. also, i need the display text to be dynamically pulled from the DB aslo. Here's what I have inputted, which obviously isn't working. Code: <?php foreach($query->result() as $row): ?> Also, off topic, but that's an interesting username, umefarooq. In my language it means "Mother of Farooq" or "Farooq's Mother." Just kinda interesting...
[eluser]David Johansson[/eluser]
Code: <?php foreach($query->result() as $row): ?> |
Welcome Guest, Not a member yet? Register Sign In |