Jump to content

requinix

Administrators
  • Posts

    15,264
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. WHERE date >= "2012-04-01" AND date Or a nicer looking BETWEEN if you can determine the last day of the third month (eg, 2012-06-30).
  2. Here's a start: array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") There are smarter solutions but they aren't quite as... intuitive.
  3. json_encode would be the function you're looking for.
  4. Using these functions, or SSH if it's a remote machine, or something else. [edit] Or the backtick operator.
  5. If you're using the current date and time you can just use the NOW() MySQL function. INSERT INTO orders (..., created, ...) VALUES (..., NOW(), ...)
  6. But that is being sorted correctly. 11am versus 1am.
  7. Being vague and saying things like "issue loading" and "make a difference" really doesn't help us understand what you're talking about. Or what we're supposed to do. Do you want anecdotes about using the onload event? Something more helpful?
  8. One more question: what if there's only one row and it doesn't have a summary? Should it be listed with an empty summary or not listed at all?
  9. 1. A negligible amount. It's a matter of a handful of added character comparisons (like character == '\\' || character == '$') which sum up to a grand total of negligible. 2. If you're concerned about efficiency, don't use PHP. There are plenty of other, real issues to focus on instead of which quoting style for strings is better. 3. I used to insist on single-quotes for variableless strings and double-quotes for other strings. Then I got tired of having to think ahead of time about whether I was going to put a variable into a string or not.
  10. Just using an image won't do anything. It has to be an input with type=image. For validating the file type, the best way is for the script to use a function like getimagesize to find out (a) whether the file is an image and (b) what type of image it is. If it isn't a PNG (or even an image at all) then you can do whatever you'd like. If anybody tells you to use $_FILES["fileInputX"]["type"] they are wrong.
  11. If that's how you feel about it then go right ahead.
  12. The first one uses concatenation: you start with one string, concatenate the variable, then concatenate a second string. The dot there is the operator that does string concatenation. The second one uses variable interpolation: PHP looks at what's in the string, sees a variable, and automatically "inserts" its value into that spot.
  13. Why are these nearly identical rows even allowed in the database?
  14. You mean like strncmp?
  15. ORDER BY the month thing LIMIT 3. Basically.
  16. Only way it's possible is if there's actual JavaScript code on the page that checks the URL for sorting information when the page loads. As you're describing it, no you can't do that.
  17. That would be unusual. There's a default log that should be receiving things even if there isn't a log dedicated to whatever. Have you found the logs/ directory? That's where it would be.
  18. %T (and others) isn't supported on Windows systems and strftime() will return false if you try to use it.
  19. Apache has an error log and in it will be more information about that error. What does it say?
  20. Looking at that print_r() output, how do you know which products are supposed to be removed?
  21. Are you absolutely sure they're VARCHAR columns and have that they the correct data?
  22. $sock = socket_create(AF_INET,SOCK_STREAM, 1) That 1 there is a number corresponding to the TCP protocol. At least it's "supposed" to be. On your system TCP is actually 6. I just realized there's a constant you can use instead of the function call, so the proper way of writing that code above would be $sock = socket_create(AF_INET,SOCK_STREAM, SOL_TCP)
  23. What happens if you get rid of the if(class_exists('MySQLDB') != true) { block?
  24. Does the MySQLDB class have a "prodisused" method?
  25. Then it's the other way around: $blog_posts is an array with only ever one object, so the outer loop wouldn't be necessary and you could foreach ($blog_posts[0]->data as $post) {
×
×
  • 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.