Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Dfly
  • Order by date
  1. Dfly

    math expression in the LIMIT clause?

    The parenthesis stall out in the LIMIT clause, but are accepted in other areas of a query. I can do my calculations for the LIMIT start_pos, 3 in an auxiliary query. SELECT (((2-1)*15)+3) AS start_pos; I was hoping that I had something misplaced and could do it all in one query. Thank you...
  2. Dfly

    math expression in the LIMIT clause?

    SELECT code, name, thumbnail, image FROM inventory WHERE (category_id = 6) ORDER BY name LIMIT ((2-1)*15) , 3 I need this query statement to have the math calculation in the LIMIT clause to adjust for the page links. ((current_page_link-1)*maxrows/pg) It keeps getting tossed out because...
  3. Dfly

    anybody read this book? " MySQL and Perl for the Web" by Paul DuBois

    The logical wording of SQL makes it easy to learn. Consider downloading phpMyAdmin at sourceForge.net. It's a free program that helps you maintain your database and you can learn a lot about SQL statements from using it. Far as the book goes, I haven't read it, but I've had 3 people rave about...
  4. Dfly

    HELP with SELECT command - replace ??

    Thanks for responding, KarveR. Didn't work. The site I'm working on uses the PerlShop Shopping Cart DBI module. I found the example below in the documentation. Nested query uses the "execute" command. Not sure the syntax would work for all programs, but it might. Ashford # Create...
  5. Dfly

    HELP with SELECT command - replace ??

    Clear as the Mississippi River. Right? What I want to show on the page is: TITLE, PRICE, DESCRIPTION, IMAGE (if there is an image entry for this specific title), More Details LINK (if there is a SUMMARY entry). What I'm trying to solve is the "if": If there is an image, show it...
  6. Dfly

    HELP with SELECT command - replace ??

    I was thinking CASE would act like a subquery. Here's an example. The company sells books. Some of the titles have images and long summaries; others, only a brief description. What I want is a query command for SELECT * FROM inventory WHERE authorLast = 'Doe' Add to the above query: (1) show...
  7. Dfly

    HELP with SELECT command - replace ??

    Is it possible to add the TableName to a query using CASE, so it could be used like an 'if...then' statement? Ashford SELECT FROM tableName CASE columnName WHEN 'true' THEN 'text string-A' WHEN 'false' THEN 'text string-B';
  8. Dfly

    beginner needs to know where to start???

    Vicky, first read your WebHost's FAQ to see what programs they support - SQL? mySQL? PHP? ASP? Then do a search at http://www.about.com using a keyword string like "database mysql tutorial". Many are designed for beginners and some combine mySQL with PHP or ASP. Once you learn the...
  9. Dfly

    Storing Images in MySQL

    My 'inventory' table has a column for 'thumbnail' and another for the full size image. The data for the graphics columns is the path to the image. product_id thumbnail 2101 /grfx/bookcover/2101.jpg SELECT product_id, thumbnail FROM inventory The beginning of your directory path...
  10. Dfly

    Please recommend tuning suggestions for slow MySql???

    I've always used the single quotes in the WHERE clause, except for when the data is numbers. Ex: WHERE media='audio' and stock > 0; I'll change those to see if it makes a difference. My next quest for speed involves normalization of the inventory table, if our webhost (our mySQL server) can...
  11. Dfly

    One large table or 3 smaller tables for speed?

    My purpose is to get the catalog pages to load faster for our bookshop. Currently I have all the data columns for the inventory in one table. Should I split off some of the columns into their own table? Then, use the item_id# as a common factor in each table and create join queries? Ashford...
  12. Dfly

    Please recommend tuning suggestions for slow MySql???

    Hi, Bob. I'm having a similar problem and not quite following what you are saying. Our database has over 6,000 items and the 'inventory' table is indexed. The pages seem to retrieve data way too slow. Would you please show a before and after SELECT statement to demo what you changed? Ashford...
  13. Dfly

    Does the [SELECT] data cache?

    The site I'm working on today is a book shop for magicians. Fun stuff, huh? The inventory is slightly over 10,000. The Feature Page showcases 4 items (listed below). The "SELECT [col_names] FROM inventory" repeats in each query, basics like title, author, price; however, the...

Part and Inventory Search

Back
Top