Jump to content

thejayjay

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

thejayjay's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thejayjay

    Average?

    do you want to write a script to do it for you or do you want it to calculate it \"all by itself\"?
  2. sounds like you are trying to insert too many values in a row, for example you have a \"row\" that takes 3 values and you are trying to put in 4. hope that helps.
  3. I have solved a lot of problems since I initially posted, mostly because the customer wanted a different layout of the output. =] Thank goodness it made the work easier. To answer your question about the vast number of results for \"one\" caris that as the tire size increases the offset of the wheel also begins to differ. I have solved this problem with various solutions that required some weird nested if statements and otherwise. Unfortunately I discovered in the end that the offsets aren\'t really important because our client can figure out what offset to buy \"on the fly\" and he intended to do it all himself anyway.... grrr. Oh well, at least I tried... Thanks for all your help guys =]
  4. that was the answer that i was looking for and was pretty much what i had determined from looking for information online. thanks for clearing it up for me! cheers, james
  5. Thanks a ton for your help guys, the solutions you spoke of achieved a large portion of my work! I was able to get rid of a lot of nasty code that was handling what is now handled with about half as many lines! =] I have run into a snag though as I am now doing a really complicated query to do some serious \"trimming\" to find EXACTLY what i need from a database. let me explain the situation a customer selects a make and year from a drop down list such as this make --> acura year --> 1998 i then take a look in the db to see what \"models\" of acura existed in 1998. the user then selects model --> cl upon submission of that page another query is run on the \"vehiclegroups\" table that pulls down the various vehicle settings like so, let me post a query w/ results as an example mysql> select * from vehiclegroups where descriptor like \'%acura% %cl% %1998%\'; +------------------------------------+---------+--------+----+-----------+ | descriptor | bolt | offset | id | wheelsize | +------------------------------------+---------+--------+----+-----------+ | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 35-40 | 79 | 15x6.5 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 35-45 | 80 | 16x7 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 38-42 | 81 | 17x7 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 38-42 | 82 | 17x7.5 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 38-45 | 83 | 18x7 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 38-45 | 84 | 18x7.5 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 38-45 | 85 | 18x8 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 38-45 | 86 | 19x7 | | Acura CL 1996 1997 1998 1999 2000 | 4x114.3 | 38-45 | 87 | 19x7.5 | +------------------------------------+---------+--------+----+-----------+ 9 rows in set (0.01 sec) that gives me a \"start\" to determine the necessary information if a \"wheel\" that we carry will fit a vehicle that the customer is shopping for. here is how the \"fitting\" works, the wheel\'s offset must be in the range of what the vehicle accpets and the wheelsize MUST MATCH exactly. so the offset is a range and the wheel must be directly equal. a wheel offset is usually a number so i just make sure it is bigger than the smallest and bigger than the largest. my problem is this. i can\'t figure out a way to \"traverse\" the database with a proper search algorithmn without generating duplicate results. if you guys need more code / query stuff posted let me know. thanks
  6. thanks a ton for your help, i found an easy solution to the problem, but am still lacking one thing if i select all my names / brands first like so query = \"select distinct name, brand where brand = \'$brandfromform\';\"; i therefore get what i need if i nest another query below that that only pulls out the same name\'s easy as that =] i sorta answered my own question when i typed out what i wanted in plain nasty form hah! thanks a ton for your help... now my only question is howto pull other fields out during my distinct query that i DO NOT want to be distinct (i need two more fields at the same time as doing the name brand...)
  7. i want to select some additional fields from my table, but they don\'t need to be distinct. how do i do that?
  8. if i was going to use multiple sql queries how would i go about doing it? i just tried nesting some queries but it doesn\'t appear to work
  9. hello, i am displaying a \"product list\" for a site i am working on and I have a question about distinct. this is my current query to mysql // mysql query $query = \"select distinct name, brand, wheelsize, finish, price, packageprice, comments, picture, thumbnail from wheels where brand = \'$brand\';\"; First question, is that the correct usage of distinct... (obviously i don\'t need the whole data to be distinct but i need all of those fields from the db to display to the enduser) Second question, Say i have a product brand of X1000 and inside the database i have two or more different \"names\" like spiffy awesome While the spiffy and awesome can have multiple wheel sizes / finishes i want the information grouped together in a certain way such as this START OF HTML TABLE X1000 - spiffy all the combos that exist of size / finish for the x1000 - spiffy END OF HTML TABLE START OF HTML TABLE X1000 - awesome all the combos that exist of size / finish for the x1000 - awesome END OF HTML TABLE it boils down to this, with that current select syntax it selects ALL the X1000\'s and they all get glued together. such that the awesome\'s and spiffy\'s are in the same html table together. do i need to nest some select querys and query the database more than once? if you guys need more code pasted from me i can do so.
×
×
  • 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.