Jump to content

cmgmyr

Members
  • Posts

    1,278
  • Joined

  • Last visited

    Never

Everything posted by cmgmyr

  1. cmgmyr

    Tricky Query

    Hey All, I have a little delema that I can't figure out. I have this query currently: SELECT p.id, p.styleno, t1.name AS category1, t2.name as category2, t3.name as category3, p.description, p.price, p.sort FROM categories AS t1 LEFT JOIN categories AS t2 ON t2.parentid = t1.id LEFT JOIN categories AS t3 ON t3.parentid = t2.id INNER JOIN products AS p ON t3.id = p.category Now, this works great if there are 3 levels of categories, but I need this to be altered to show all of the items if there are 1, 2, or 3 levels of categories...and not just 3. Any ideas? Thanks in advance, -Chris
  2. yes, you can easily do that. there is no real secret to it...just do good work. If you do good work it's even easier to get more work. I've made over $30K so far this year.
  3. it's in the specs somewhere on their site.
  4. No problem. Sometimes in the big projects you forget the "little" things until there is a problem. Lesson learned!
  5. I went through the tables in the query and "indexed" all of the connecting columns that weren't already indexed or a key, now it runs in about 5 seconds.
  6. I know, I have it at 3 minutes right now. Even running it directly in phpMyAdmin takes 4-5 min usually.
  7. It's about a medium size, there is about 1500 products in there right now.
  8. I know that I can do that, but I was looking for a more efficient way to handle this query. If there isn't a solution that way I can change the timeout as a last resort. I don't really want the client waiting 5 min to download/upload and XL file though.
  9. Hey All, I'm having a little problem with exporting data from my database. The problem is that the query seems to be too much for PHP and MySQL to handle since it is timing out. Here is the query: SELECT p.id, p.base_no, p.style_no, t1.name AS category1, t2.name as category2, t3.name as category3, p.metal, p.description, c.name as collection, p.price, pe.b2c_desc, pe.meta_title, pe.meta_desc, pe.meta_keys, pe.alt_tag, p.site FROM categories AS t1 LEFT JOIN categories AS t2 ON t2.parentid = t1.id LEFT JOIN categories AS t3 ON t3.parentid = t2.id INNER JOIN products AS p ON t3.id = p.categories_id LEFT JOIN collections AS c ON p.collection = c.id LEFT JOIN products_extended AS pe ON p.style_no = pe.style_no The categories table is a hierarchical setup (id, parentid, name). Do you guys have any ideas about how to make this function better? Any other solutions??? Thanks in advance, -Chris
  10. This is an update from my first post. I originally voted for 30-40k, but at the end of the year I did about 63K (little off haha). So far the first quarter of this year I've done 20+K so I look to clean up about 90+K by the end of the year. For reference here in Syracuse, NY, USA I bought a pretty good size 4 bdr house back in Jan. for 130K.
  11. I play drums mostly (as you can make out from my image), but I also play guitar, a little bass, and a little piano. Recently I have picked up and become a "Guitar Hero", but that doesn't really count...awesome game though, I wish I thought of it.
  12. None of you guys have comments???
  13. So have you guys heard of these? Used them? Plan to? I've been following both of these for quite a while now and it just seems like the latest releases are very stable and ready to go for heavy development. I made a little app over the weekend and it wasn't too bad to construct. It was pretty much a small search outputted to a data grid. It came out to about 65 lines of code (just the flex)...the same thing in PHP would have been around 200 or so (or more easily). It looks like both of these will be very helpful for future development. What are your thoughts???
  14. awesome! worked like a charm! thanks!!!
  15. I have the database and the table set to utf8_unicode_ci this in the header file <meta http-equiv="content-type" content="text/html; charset=utf-8" /> and this right after the database connection $db->query('SET NAMES cp866');
  16. I have a database that will eventually have to be used for english, russian, spanish, and a few other languages. Right now I'm adding the russian to it, but when it outputs to the PHP page all I get are question marks. It's showing correctly in phpMyAdmin, but not when it's echoed. Can anyone point me in the right direction? Thanks, -Chris
  17. you can do something like this: <?php $current_hour = date('h'); if($current_hour >= 17 && $current_hour <= 4){ //between 5pm and 4am $col = 'night'; }elseif($current_hour >= 5 && $current_hour <= 12){ //between 5am and 12 noon $col = 'morning'; }else{ $col = 'afternoon'; } ?> Where $col would be whatever you named your columns, then just put that into your query
  18. you can have a table "mail_messages" and have a couple columns "morning_message", "afternoon_message", and "night_message". Then you can set up a cron job to run the mail script and just grab the column you want out of the database.
  19. some people learn by example and looking at other scripts which would probably be the best way to go for something like this. The one that i posted is a very simple example that can get anyone going, buknoii still has a lot of work to do be for he can get it into an actual site the other link that was posted is good too
  20. download this guys user login script...it's pretty good to start out with. http://www.maaking.com/index.php?loadpage=scripts
  21. dwest, I think it might not have worked because of your query, try something like this: $sql = "SELECT something FROM your_table WHERE id = '$albumID' ORDER BY RAND() LIMIT 5"; Just run this as a full query and not just getting the variable and see what you come up with. Putting the data into arrays (when it's already in one) will just slow you down. ...the limit will limit the amount of records returned, so in this one a max of 5 records can be returned.
  22. Moto Razr is the one I usually do it on. You can use pretty much any audio software...I use Adobe Audition...it's overkill for something like this, but I just use it for other things.
  23. Check this out, it should do everything you want it to do. http://www.micahcarrick.com/04-19-2005/php-zip-code-range-and-distance-calculation.html
  24. try $sortorder = $wpdb->get_var("SELECT sortorder FROM $wpdb->nggalbum WHERE id = '$albumID' ORDER BY RAND() LIMIT 1"); ...LIMIT optional, or you can just change the value...the RAND() is the part you want to stick with.
×
×
  • 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.