Jump to content

dunksy

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dunksy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Right, appealing to all you MySQL lovers: I have three tables: - lindoProducts, which stores the ID of the type of instrument it is in(instID) - lindoInstruments, which in turn stores the ID of the type of category it is in (categoryID) - lindoCategories lindoInstruments and lindoCategories also have a field called ordering, so that I can order the categories on the page, and within these order the instruments, and then list products by name. I am trying to do exactly this, but also allow for other selction criteria, for example selecting all products whose description contains the word "ultra". I have this: SELECT c.* FROM lindoProducts c, lindoInstruments p, lindoCategories q WHERE p.categoryID=q.ID AND c.instID=p.ID AND c.active='1' AND c.description LIKE 'ultra' ORDER BY q.ordering DESC This seems to be working fine, but I am getting a very odd occurance. For some reason, although it is ordering the categories fine, within these, it is not grouping the products by instrument type. So, I am getting: Category: Guitars Instrument Type: Electric then Instrument Type: Bass then Instrument Type: Electric again So it seems like I am missing some sub ordering or grouping. Any ideas? Duncan
  2. Good afternoon. Right I am currently developing an availability and price checker for a hotel, and they want to be able to specify a price by date range. So they may enter a strt date, end date, and the price they wish to assign to all dates within that range. Rather than store in a table a start date, end date and then price, i am thinking of storing one entry per day and store the price set. The reason being is that if they set the dates between June 1st 2006 and June 10th 2006 to price x, then go back, and set the dates between May 15th and June 15th there is going to be an overlap. I therefore need to be able to take two dates and a price as input to my function, and the function would, for all dates occuring between these two, check the table to see if the entry is there for that specific date, and if not create one, if it is, then update it. Sounds simple but I have still not got to grips with mktime() date() and the other date manipulation tools, and other tutorials do not seem to be helping me. Any help would be greatly appreciated. regards, Duncan
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.