Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Then for lack of a better understanding of what you're trying to say, no it's not possible.
  2. Does this code execute sometime before the login code? If not then how does this little code snippet work with the rest of the site?
  3. Are you including the jQuery library somewhere? It's not in the code you posted. Yep.
  4. Okay, so you're using MONTH()... Is there a problem?
  5. I hesitate to ask but what have you tried so far?
  6. Not as you're describing it. But that's okay because what you're describing is not true. Maybe this will be easier: Please post the code you have now. The stuff into which you're trying to insert this query.
  7. I was looking for the more specific "one uses implode() and one doesn't" but that's close enough. implode() turns an array into a string, right? monthNames() returns an array, right? If you echo an array you just get "Array", right? (The answer to all three is "yes", by the way.) Try using implode() on the one line that doesn't seem to work. Just like how you use it on the other line that does work.
  8. For the record, please post the exact code you have right now.
  9. If you don't have any variables then how do you know which three months you want?
  10. Deep breath. Look at the two lines of code I pointed out. You see them? Good. Now, tell me: what is the difference between them? They are not identical. How are they not identical? Explain to me, in English, what both lines do in as much detail as you can. Just do something that requires you actually looking at them and reading the code. If you haven't realized, I'm trying to show you why one works and the other looks like it doesn't work. (Because it does work.)
  11. Sure, you can use MONTH(). But if you don't have any variables then what are you going to use it with?
  12. Yes. There are two. I posted an EXACT usage of one and a big hint for using the other.
  13. Are you not looking at the code? Okay... Let me try adding some spacing to it. echo implode(", ", monthNames(5 , 7 )); echo monthNames($FromMonth, $ToMonth) ;
  14. You can't put if blocks directly inside a class definition. Instead, put them inside the get_machid() function like function get_machid() { if ($this->type == RES_TYPE_ADD) { return $this->resource->get_property('machid'); } else if ($this->type == RES_TYPE_MODIFY) { return $this->machid; } } (assuming that the "type" variable is a member of the Reservation class and not, say, a function parameter you haven't mentioned)
  15. echo implode(", ",monthNames(5,7)); echo monthNames($FromMonth, $ToMonth); There's a major difference between those two lines.
  16. 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).
  17. 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.
  18. json_encode would be the function you're looking for.
  19. Using these functions, or SSH if it's a remote machine, or something else. [edit] Or the backtick operator.
  20. If you're using the current date and time you can just use the NOW() MySQL function. INSERT INTO orders (..., created, ...) VALUES (..., NOW(), ...)
  21. But that is being sorted correctly. 11am versus 1am.
  22. 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?
  23. 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?
  24. 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.
  25. 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.
×
×
  • 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.