I need this to print out with the leading zero just for numbers 1-9 the rest is fine.... right now it doesn't even print out the 0 it just starts with 1
I have tried to make $min == "00"; and also tried $min == '00'; neither work...Code:print "<select name=\"Minute\">"; for($min == 00; $min <= 60; $min++) { if($EventMinute == '$min') { print "<option value=\"$min\" selected=\"selected\">$min</option>"; } else { print "<option value=\"$min\">$min</option>"; } }
another issue I am having which is probably related to this same issue is that when I input a var into the database it doesn't add the first zero.
I know this first part is not php but it relates to my question.. second part is php
Is there something special I have to do to make it insert and print the leading zero?Code:<select name="Minute"> <option value="00">00</option> <option value="01">01</option> <option value="02">02</option> </select> ------------ inserting here from php file ------------ $insert = "INSERT INTO SiteEvents(EventMinute) VALUES('".addslashes($EventMinute)."')";



Reply With Quote

Bookmarks