Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: salewit
  • Order by date
  1. salewit

    Bug in date count? Or is it me.

    It usually is...
  2. salewit

    Bug in date count? Or is it me.

    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!
  3. salewit

    Bug in date count? Or is it me.

    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...
  4. salewit

    Multiple inputs - how to collect dor MySQL

    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...
  5. salewit

    Emptying $_POST variables or preventing page reloads

    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!
  6. salewit

    Emptying $_POST variables or preventing page reloads

    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...
  7. salewit

    Negative or positive time difference. How to

    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...
  8. salewit

    Negative or positive time difference. How to

    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...
  9. salewit

    NEWB loop through text

    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...
  10. salewit

    NEWB loop through text

    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...
  11. salewit

    NEWB loop through text

    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...
  12. salewit

    Print rows based on criteria EXCEL

    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...
  13. salewit

    Value="" variable in SELECT list

    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...
  14. salewit

    Form value problems

    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...
  15. salewit

    Form value problems

    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...
  16. salewit

    Form value problems

    Hmmm I should have mentioned that I'm kind of a beginner at this. At first I tried to check in the beginning of my scriph such as this: Filename=test.php ------------------------ session_start if ($flag == 1) { if ($foo == "abc") $error=1; } if (($flag ==1) && ($error > 0)) { print "There is...
  17. salewit

    Form value problems

    I've got kind of a weird problem I can't figure out. I've got a form such as: Filename=test.php ------------------------ session_start print "<form action='test.php' method='POST'>"; print "<input type='text' name='foo' value='$foo'>"; print "<input type='submit' value='Go'>"; print...
  18. salewit

    Session variable - pulling hair out!

    I've just about had it. I can't figure this out. I systematically commented out areas until I got to the math part. I changed: $ordertotal = $total + $ship + $tax; to: $ordertotal = ($total + $ship + $tax); and it works.... every other time! I close and reopen my browser and it doesn't work...
  19. salewit

    Session variable - pulling hair out!

    Thanks for the response. I checked my server and register_globals is ON. session_register has not created a new variable on my other ones. I've got about 30 session variables, and they all work fine except this one. I get the impression that either the printf or doing the math on the variable...
  20. salewit

    Session variable - pulling hair out!

    I've got ONE session variable that doesn't seem to want to pass over. file1.php <?php session_start(); $ordertotal = $total + $ship + $tax; $ordertotal = round($ordertotal,2); printf ("%01.2f",$ordertotal); session_register("ordertotal"); print "Ordertotal=$ordertotal"...

Part and Inventory Search

Back
Top