Jump to content

koopkoop

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by koopkoop

  1. Hmmm. I think this is the answer: http://dev.mysql.com/doc/refman/5.0/en/query-log.html Can anyone confirm there isn't a better method?
  2. "And the easiest thing you can do is here is log all data written to the database" ^ How exactly would I do that? That's another method that will work too. Anyone?
  3. Print queries isn't practical because the shopping cart is incredibly modular. There's a lot of modules involved which each contribute their small portion of info which makes up the entire info set for a product. It just isn't practical to trace across the hundres of files which comprise all the modules involved in the process. I really need software to do this. My current solution is using WinMerge to compare text file backups between the two database states. It works, but is very slow because of all the manual labour involved.
  4. Is there a piece of software out there that can monitor a mysql database and give some kind of output as to what changes have been made? I'm working with a PHP shopping cart (Magento) that has very poor product import support. To get around this, I'm writing my own product import script to inject products, and all of its associated values, directly into the database. However, I need to know exactly how the shopping cart is storing product information. To figure this out, I want to take a "snapshot" of the database before I add a product, then add a product through the shopping cart and then compare the database against the snapshot to see exactly where the shopping cart placed the values.
  5. How do I debug a full website? I'm working on an eCommerce site and there's a lot of variables shared between pages. Therefore, I can't simply point the debugger to an individual page and expect the page to debug because all the variables it depends on are missing. For example, a page showing all the details for a single product relies heavily on all the data that was passed to it from the page that showed you the entire product collection. How would I go about debugging the product detailed info page? I'm using PDT, but will switch for this type of functionality.
  6. If I have a table like so: TABLE TestTable ID / Name / Age ------------------- 1 / Greg / 14 2 / Mary / 45 3 / Bob / 16 Is there an SQL statement that'll return the name of each column and it's numeric index in the table (Eg Id=0,Name=1,age=3)? I know I can do a SELECT *.....then use MYSQL_FETCH_ARRAY to grab the associated numbers, but I was hoping for a more elegant solution.
  7. Is there another way of writing a query that would only affect the itemnumbers of interest?
  8. Thanks for the pointers on using the generic 'price' statement. Does that mean I can do something like below to increase the existing price value for that particular itemnumber? eg: UPDATE `products` SET `price`= CASE WHEN `itemnumber`='PL1222' THEN 'price' + 3.00 WHEN `itemnumber`='YX1222' THEN 'price' * 4 ELSE THEN `price` END WHERE `itemnumber`IS NOT NULL Yeah, I under stand the concern over the dollar signs. My actual db doesn't have them.
  9. UPDATE products SET CASE WHEN itemnumber = PL1222 THEN price='$5.00' WHEN itemnumber = YX1222 THEN price='$6.00' Would this work?? Can someone please correct?
  10. How would I update the price of itemnumbers PL1222 to $5.00 and YX1222 to $6.00, in one query? Table:Products Itemnumber| Price ---------------------- PL1222 | $3.40 AX1222 | $4.45 YX1222 | $2.31
  11. Update only PL1222 to $5.00 and YX1222 to $6.00, in one query.
  12. ^ OK. Look at my original post. How would I update prices to a new value on only PL1222 and YX1222 with ONE query.
  13. I know there's a way though because I found something close to what I'm trying to accomplish: UPDATE test SET test_order = case test_id when 1 then 2 when 2 then 3 when 3 then 1 end WHERE test_id in(1,2,3) Hopefully, this helps clear things up more than confusing things further.
  14. ^ Thanks, but that solution is using one query for every update. If I used your example to update 30 records, I would have used 30 queries. I'm looking for a query statement that will allow me to update 30 records with one query.
  15. ^^^ Forgot to restate, but I want to do the entire update in one query.
  16. I have a table like the one below. I have another table with prices in it that I would like to update my first table's prices with. I also need to be able to select which itemnumbers get their prices updated. I can handle the assembly of the query in PHP, but I have no idea what the actual MYSQL query would look like. What MYSQL query would I need to accomplish this? Itemnumber| Price ---------------------- PL1222 | $3.40 AX1222 | $4.45 YX1222 | $2.31
  17. How do i specify regex values in terms of their ascii table equivalent? I'm totally new to advanced regex concepts.
  18. I have a csv data file with products descriptions from the product manufacturer. Unfortunately, the manufacturer can never seem to get their exports right so, alot of times, there'll be random products with descriptions that have garbage characters inserted into it (Eg square box character or A with a carat above it character). I want to write a filter to take in these description strings and filter out(or replace) all these garbage characters.
  19. Is there a built in function to filter a string based on a coder's input ascii table value? Eg. Filter everything above 39 in the Ascii table I've found the FILTER_FLAG_STRIP_HIGH (that kills all above 127), but I need more control over the ascii range that gets filtered.
  20. I'm really new at MySQL and having a tough time with a query problem across multiple coulmns and tables: I'm trying to create a "easy to use" search box on an e-commerce website. When a search term is plugged in, it'll search the "Products" table in columns "product names", "product ID numbers" and "product categories". If the term matches in any of those columns, it'll then pull the image location from the same table and then pull pricing information from a second "price" table based on the common product ID. The search results are not as expected though. If I search for a term that I know matches (eg. a productID of "123"), it'll return a huge amount of hits with nothing but the same product repeating over and over. I troubleshot it by slowly eliminating terms from my query and it turns out it's the "OR"s that are fouling the search. I know this fixes it, but I don't understand why. Obviously, I'm using the wrong query string, but what do I replace it with to get the functionality I described above? Queries below: BROKEN QUERY: SELECT products.itemnumber,products.name,products.midimagename,prices.bestprice FROM products,prices WHERE products.category LIKE '%fall%' OR products.itemnumber LIKE '%fall%' OR products.name LIKE '%fall%' AND products.itemnumber = prices.itemnumber SEMI-FIXED QUERY (It now doesn't do what I need, but at least it doesn't repeat the same search hit over and over): SELECT products.itemnumber,products.name,products.midimagename,prices.bestprice FROM products,prices WHERE products.category LIKE '%fall%' prices.itemnumber
  21. I've looked everywhere and I don't seem to be able to find an array function to convert an associative array to a numerical one. Is there one to do this that I'm not aware of because it seems kind of weird that there isn't such an obvious function?? Also, what's the reasoning behind being unable to reference an array associatively AND numerically? Thanks.
  22. I already have a site created and I need to add a shopping cart to it. I don't want one of those "eStore-in-a-box" apps - just the shopping cart. Can anyone recommend a good one suitable for this task that also has cheap processing fees? I'd prefer something that doesn't come with third-party branding(Eg. GoogleCheckout and Paypal), but will use them as a last resort option. So, any recommendations? I'm all ears for advice too since I've never done this before. Thanks.
  23. To further clarify, the number of fields between the two are completely different along with the names: eg. PRODUCTS itemnumber,name,description PRICES itemnumber,prices,caseweight,caseqty I want to search the two for a unique product and get a result like itemnumber,name,description,prices,caseweight,caseqty Thanks.
  24. How do I select a single row from two tables with a common field - based on a unique sharked key. For example, I've got two tables "products" and "prices". I want to select all the fields from each based on the shared "itemnumber" key. This returns zero results: SELECT * FROM prices,products WHERE products.itemnumber="11004NA" AND prices.itemnumber="11004NA" This returns 1 result - which is exactly what it should be doing: SELECT * FROM prices,products WHERE products.itemnumber LIKE"%11004NA%" AND prices.itemnumberLIKE "%11004NA%" Why doesn't the first one work? What's the proper way of writing this?
×
×
  • 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.