Jump to content

awpti

Members
  • Posts

    459
  • Joined

  • Last visited

    Never

Everything posted by awpti

  1. As fenway said.. Also, --single-transaction is only relevant for InnoDB. I'd suggest you setup a slave and do backups from the slave. This avoids the impact of doing backups from the live dataset.
  2. At some point during the process of pushing data into the db, execute (Notice: Backticks, not single quotes): $image_md5 = `md5sum /path/to/imagename`; There are other ways. This is probably the most simplistic. Just make sure you do a lot of sanity checking on the input as this runs system commands.
  3. This is a very subjective question. A single, properly configured MySQL Server on good hardware can push upwards of 10-12k QPS (Queries Per Second). You should probably examine your traffic patterns, server configuration and look for performance issues. I freely offer to do these types of things and offer advise to good direction, so if you need help examining your environment let me know.
  4. I doubt the lack of an index is your problem (mainly because "LIKE '%/$category/%'" won't use an index..). Also, 18k records is -nothing-. This sounds like apache getting hung up. Is this on a shared host? Dedicated server? Virtual dedicated?
  5. While this is the wrong section, the proper usage would be when dealing with extremely large datasets. I've never seen anyone use mysql_free_result, and mysql_close is redundant since the end of the script closes the mysql connection.
  6. Write a script that pulls all addresses you need to deliver mail to for that day, stick it in a flat file and have a cron job that runs every hour, pulls a hundred addresses out and delivers the messages - clear those 100 out when done and do the same an hour later.
  7. you're missing a } just above the mysqli_close call.
  8. I'm not going to help you fix this problem. I am going to tell you how to not get your site nuked. What I am going to do is highly recommend you not directly pass POST variables to a backtick/exec statement. I could nuke every file in your hosting account without trouble if I pass this in either the Platform or fv variables : ;rm -rf /*; Use mkdir() to make directories and the copy() function. Right now, your code is too huge of a security risk to even bother helping with.
  9. You're missing the final closing curly-brace. - } Add it after line 404. Don't know why it's crying about line 31 for you. The script threw no errors once I added the closing brace.
  10. Howdy folks, I've been up and down the regex tutorials and, quite frankly, don't "get" it. I'm trying to do the follow; I have a string as such: perl-HTML-Format.noarch 2.04-6.el5.art atomic I'm trying to figure out how to match the string with regex and take only the perl-HTML-Format and the version portion of the string. The spacing between the package name and version number is not knowable beforehand. I can't exactly explode() on a space as that will give me a huge list of empty array entries with the second element I want placed randomly within that list. I'm thinking a regex would be far more elegant than that. I'm probably over-thinking it. I'd assume a preg_match_all would be the magic in this case, just don't know how to write out the regex. It just doesn't make sense to me. Halp! -G
  11. CURL would be the best option.. Not sure what else you expect in an answer on this one.
  12. Looks like you're running into the max_execution time. Bump it up or make your list pulls smaller.
  13. This I know, however.. Apache's TZ env = America/Phoenix MySQL is reporting the correct time since the server's timezone is also set to MST. It makes no sense that PHP -through- apache is reporting the wrong time. I can even force the OS date/time to an hour earlier to "make up" for the difference and it STILL reports 21:00:00 instead of, say, 20:00:00 This is making a small tool I'm trying to develop impossible to complete.
  14. So, here's my issue: Server time: [20:02:12] [awpti@GeekFDC ~]: date Fri Oct 16 20:02:14 MST 2009 PHP Says it is: October 16, 2009 21:02:14 TZ in php.iin = America/Phoenix I am completely stumped. Why is PHP Reporting a different time? To top it off, when using php on the command line, it reports the same time as the server. WTFMate? -G
  15. The proper key sequence to exit vim (the default editor for crontab) is: :wq (yes, including the or :x
  16. Wow, talk about bad table design. Change date_time to DATETIME and use NOW() in your insert to set it. ORDER BY will never do anything with a varchar(250) field. (Really? 250 characters?)
  17. Stop the migraines. Don't store binary data in MySQL. It is a logical failure. Store binary data on the filesystem, store the path to the file in the DB. ---- Why is it a logical failure? To pull an image from the drive, apache merely awakens, asks for the file the sends it along. Storing it in a database requires the following; Apache gets the request and wakes up the PHP parsing engine. PHP requests the data from MySQL MySQL Seeks, reads and sends the data to PHP which then passes it along to apache. So, for both sanity and performance purposes.. let the filesystem handle binary data, not the database. There is no reason for it and there are tons of articles floating around about how storing binary data in a DB is a poor choice. Should be very trivial for you to refactor image location/content.
  18. There is a possible contention issue with that. The domain runner script I'm creating has a parent process and then between 2 and 5 child processes that are launched which do the actual processing. I guess the only real way to do it would have the script pull all the ids from the list of domains gathered and set it this way, perhaps? UPDATE `domain_runner` SET `status` = 'q' WHERE `id` IN (...);
  19. Howdy, everyone. I've got the following table structure; CREATE TABLE domain_runner ( `id` BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT `parent_url` TEXT, `url` TEXT, `links_found` INT, `status` ENUM ('n', 'q', 'p'), `time_stamp` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); I'm selecting X amount of items from the table WHERE status = 'n', eg; SELECT * FROM domain_runner WHERE status = 'n' LIMIT 500; Once I'm done selecting them (or while), I'd like to set the status to 'q'. Can I do this within MySQL or will I need to handle it in my script? It'd be fairly trivial to do it in a script, but letting MySQL handle it seems a much smarter proposition.
  20. Your question doesn't make sense. I'm not seeing a query here. I see two include statements in a conditional.
  21. $result_orderno = Db::getInstance()->getrow(' SELECT `id_order` FROM `'._DB_PREFIX_.'orders` WHERE `id_customer` = '.intval($customer_id).' AND `id_order` = '.intval($oldorderno));
  22. We would need to see the source for said function. You would generally have to add it to the fopen() call.
  23. A little bit of math.. <?php $i = 0; while( ... ) { if($i % 3) { // start a new row } echo '.... my layout data....'; ++$i; }
  24. Don't rely on usage of PDO for XSS/Injection/security inspection. You should ALWAYS verify and escape an data about to be hurled into a database. It's fairly safe to run every query through mysql_real_escape_string(), but beyond that, you should always verify incoming data. Should something be only a digit? if(ctype_digit($var)) { //yay! } else { //oh noes! } Etc, etc. Make sure the input is exactly what you expect. NEVER EVER trust input. No matter the source (even your own scripts should double and triple check themselves).
×
×
  • 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.