Hello All,
Is it possible to mix strings and numbers in a single array? I'm having a problem accessing the correct item from an array. The problem is not displaying the information, but rather the UPDATE of my database.
I have a form that allows a user to update meeting information. The data is coming from a MySql database, where the date/time of the meeting are coming from one field (datetime). In order to view and change a meeting date and/or time, I have to break apart the datetime field into something that can logically fit into separate dropdown boxes (select Month, select Day, select Year of meeting).
It's the Minute segment that's causing the update issue, because there is an option to select 00. Here is my time field formatted into separate dropdowns:
Time Variables
$selTime = $myrow[13];
$formatHour =date("g", strtotime($selTime));
$formatMin = date("i", strtotime($selTime));
$formatAM = date("a", strtotime($selTime));
dropdown boxes for the Minute selection
$min= array(1=>'- -','00',15,30,45);
echo "<select name=selMin>\n";
for($count=1; $count<=5; $count++)
{
$selected = ($formatMin == $min[$count] ) ? "selected" : "" ;
echo "<option $selected value=\"$count\">$min[$count]\n";
}
echo "</select>\n";
When I try to update this field (putting together all the pieces into datetime format), I keep getting 00 as a selMin value. On my update page, I code:
if($selMin == ' '){
$selMin = '00';
}
Sorry this is so long, but it's difficult to explain. I have everything else functioning properly on the UPDATE, but the minute field is causing problems.
Any help will be GREATLY appreciated!
Geogal
🙂