Arrghhh! Idiot me...
The actual select statement was:
SELECT monthname(edate) as mon, year(edate) as yr, count(month(edate)) as cnt FROM widgettable WHERE edate > now() GROUP by mon ORDER by edate;
1/4/07 and 1/17/07 is less than now. Never mind!
Here's the data:
edate name
2007-01-17 Widget-1
2007-01-25 Widget-2
2007-01-04 Widget-3
2007-02-10 Widget-4
2007-02-01 Widget-5
2007-03-01 Widget-6
2007-03-15 Widget-7
2007-03-20 Widget-8
And I enter this command in PHPMYADMIN:
SELECT monthname(edate) as mon, year(edate) as yr...
I've got a database that I want admin people to be able to update. Here's a look roughly at how the database would look to the admin person. Note all fields are editable by user:
Train Number | Description | Leaves
17 | Earlybird | 9:10
23 | Rock Island | 12:02
422...
Hmmm I never even thought of comparing a unique value in the database. That sounds simple enough. I guess what I was hoping for was some PHP command to clear out the POST data or something along the lines of $_POST[name] = "";
But the database check sounds good. Thanks so much!
I've got a simple shopping cart system that doesn't use session variables. Instead data is POSTed from another page. On my final page after payment is retrieved, a receipt is displayed, database stuff is done, logfile stuff is done, and e-mails are sent. I want to either be able to clear $_POST...
Thanks for all the help. I may have to try the 1904 Date method as I was planning on calculating and graphing on the data. I also didn't have any plans to exchange this with anyone.
This has been a crash course in time calculations. Another problem that just popped up .... in the above example...
I'm trying to subtract the time in one cell from another. Simple stuff. But I also want a NEGATIVE time displayed in certain situations. I'm trying to calculate arrival information. For example:
Due at 17:10. Arrived at 18:20. 18:20-17:10 = 1:10 (late)
But if this happens:
Due at 17:10...
Actually, I found a routine that does what I want. I don't know HOW it does it, but it works.
What I was trying to do was to look for instances of any kind of link (http://) in my text string and add the tags to make it clickable. It got ridiculously complex and the routine I found used...
Thanks for the response. I tried this and it resulted in an endless loop.
$position = 0
while ($position = strpos($string,"test", $position) !== FALSE):
Doesn't using the variable $position twice in this statement throw off the loop? Maybe it should be something like:
$start_position = 0...
I know this is probably very simple, but I can't figure it out. I've tried it with a WHILE and a DO loop, and can't get it to work.
$string = "This is a test. This is only a test. Testing 123";
$position = strpos($string,"test");
if ($position !== false) {
// processes
// more processing
}
How...
I am creating an Excel order sheet with hundreds of items. A customer will go in and enter what they want and then print the order out. I want to print out ONLY those rows where the customer specified a quantity. Is this possible?
i.e. Order Form in Excel:
Item Descr Price Qty
101 Widget1...
I have a drop box in a PHP form script that has error checking in it. The user fills out the form, and if there is an error in the form, the user fixes the error, the script is re-run, but I can't seem to "hold" the value of the state drop-down. It defaults back to "Select One". How do I hold...
Wow, thanks again for the in-depth help. I turned register_globals off, and now of course the thing is not running at all. I'm going through the code step by step changing things. There seems to be a lot to change.
I'll check out php.net. I've been there before, and they're great as reference...
Thanks for the response.
Ok, here's the problem. I taught myself PHP from a book. Apparently an OLD book. So now I'm in the bad position of having to unlearn before I learn properly.
This book told me that PHP passes form variables automatically. Whether POST or GET is used, the next script...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.