SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Array, Cross Referencing or something else?

    Hi,

    If I add a field within a MySQL Database that is used for creating the navigation bar can PHP use the field?

    I was thinking of using a number system. This would then help create a left-navigation bar that changes depending on what the customer is looking at. I would add a 1 for one particular product category (say shoes), a number 2 for another category (say Jeans), a 3 for another category (t-shirts).

    Can PHP be used to display all entries from a one cell, if they have a 1, 2 or a 3 in another cell?

    In the example above if someone is looking at shoes then every item with a 1 has it's product name displayed within the left-navigation bar. I want to avoid coding every product using an array. Can this be done with PHP?

    Matt.

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I'm a hungover today, but what about...
    Code:
    SELECT foo, bar FROM table WHERE thingy = 1;
    ?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •