データベースから時間を取得しています。エコーアウトすると動作しますが、while ループでは動作しません。ただし、他の変数は機能します...
コード:
$resultevent = mysql_query('SELECT venue, date, TIME_FORMAT(startTime, "%h:%i %p") AS startTime2, TIME_FORMAT(endTime, "%h:%i %p") AS endTime2 FROM events"');
$rowevent = mysql_fetch_assoc($resultevent);
$date = new DateTime($originaldate);
$newdate = $date->format('m/d/Y');
$startTime2 = $rowevent['startTime'];
$endTime2 = $rowevent['endTime'];
$venue = $rowevent['venue'];
echo $startTime2; <============== WORKS HERE
while ($row = mysql_fetch_assoc($result)) { //the code for these queries is not shown
echo 'getting here'; <======= WORKS
echo $venue; <======= WORKS
echo $startTime2; <======= DOESNT WORK
}