Jump to content


New Members
  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Paul-D

  • Rank
  1. Paul-D


    Hi thanks for your suggestions. I should have used another inline php <option value="<?=$days?>" BUT your echo and keep everything inside PHP script better and I have never used foreach (range(1, 31) as $number ALSO when I use a loop to create the days drop down and view source i get... <select name="DD_Balance" style="width:40px"> <option value="1" >1<option value="2" >2<option value="3" >3<option value="4" >4<option value="5" SELECTED >5<option value="6" >6<option value="7" >7<option value="8" >8<option value="9" >9<option value="10" >10<option value="11" >11<option value="12" >12<option value="13" >13<option value="14" >14<option value="15" >15<option value="16" >16<option value="17" >17<option value="18" >18<option value="19" >19<option value="20" >20<option value="21" >21<option value="22" >22<option value="23" >23<option value="24" >24<option value="25" >25<option value="26" >26<option value="27" >27<option value="28" >28<option value="29" >29<option value="30" >30<option value="31" >31</select> But the months that have been done manually are <select name="MM_Balanc style="width:60px"> <option value="1" >Jan <option value="2" >Feb <option value="3" >Mar <option value="4" >Apr <option value="5" >May etc
  2. Paul-D


    Hi I have some website code that has worked fine up to now. I enter a day / month and / year. I tried to change the txt box for the day into a drop down list. and the submission $_POST fails. This works <input style="text-align:right;" type="text" size="1" maxlength="2" name="DD_Balance" value="<?=$_SESSION["DD_Balance"]?>">&nbsp;/&nbsp; This doesn't <select name="DD_Balance" style="width:40px"> <? for($days=1;$days<32;$days++) {?> <option value=$days <? if ($_SESSION["DD_Balance"] == $days){?> SELECTED <?}?>><?=$days?> <? } ?> </select> Confused as the names of the objects are the same. Also view text is all screwed up on several lines not underneath each other.
  3. Paul-D


    Is there a server variable that holds the full url including the page name.php TIA Paul
  4. Paul-D

    Date time comparisons

    Maybe turn them into a time stamp subtract them and just print out $c = date('d H:i:s' ,$time);
  5. Paul-D

    Date time comparisons

    Thanks for these. These are useful functions but in my case I am extracting to date time values from different tables not in the same SQL so I think I need a PHP solution. $a = "2018-08-26 12:20:00" $b = "2018-08-27 13:30:05" So $c would be either 1 day : 1 hour: 10 minutes: and 5 seconds OR 25 hours 10 minutes: 5 seconds. Sorry not so strait forward.
  6. Paul-D

    Date time comparisons

    Hi I have 2 MySQL date times I want to subtract them and display the number of hours minutes and seconds (seconds optional) I could have days but would be happy if the hours were more than 24. Thanks. Paul.
  7. DROP TABLE IF EXISTS `rain-accounts`; CREATE TABLE IF NOT EXISTS `rain-accounts` ( `rainID` varchar(10) DEFAULT NULL, `AccountDate` varchar(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO rain-accounts (rainID , AccountDate) VALUES ('5b6acefb' , '2018-08-08'); It was originaly INSERT INTO rain-accounts (rainID , date) VALUES ('5b6acefb' , '2018-08-08'); But I thought that you may not be able to have a field called date.

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.