-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Then for lack of a better understanding of what you're trying to say, no it's not possible. -
strange problem!!!only work after a refresh!
requinix replied to joomtalk's topic in PHP Coding Help
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? -
Are you including the jQuery library somewhere? It's not in the code you posted. Yep.
-
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Okay, so you're using MONTH()... Is there a problem? -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
I hesitate to ask but what have you tried so far? -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
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. -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
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. -
Insert only date where month is not previous month
requinix replied to newphpcoder's topic in MySQL Help
For the record, please post the exact code you have right now. -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
If you don't have any variables then how do you know which three months you want? -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
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.) -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Sure, you can use MONTH(). But if you don't have any variables then what are you going to use it with? -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Yes. There are two. I posted an EXACT usage of one and a big hint for using the other. -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
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) ; -
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)
-
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
echo implode(", ",monthNames(5,7)); echo monthNames($FromMonth, $ToMonth); There's a major difference between those two lines. -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
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). -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
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. -
how to convert php string ro javascript string?
requinix replied to megetron's topic in Javascript Help
json_encode would be the function you're looking for. -
Using these functions, or SSH if it's a remote machine, or something else. [edit] Or the backtick operator.
-
If you're using the current date and time you can just use the NOW() MySQL function. INSERT INTO orders (..., created, ...) VALUES (..., NOW(), ...)
-
But that is being sorted correctly. 11am versus 1am.
-
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?
-
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?
-
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.
-
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.