jfs0479 Posted July 8, 2007 Share Posted July 8, 2007 Hi all, I am trying out thid else if statement in my php script and i have entered all of the details manually and in the correct format into the database to test. However each time the script loads, the image says error which is the last else (images/_status_error.jpg). It is really driving me round the best. The other thing is that i have it working superb on my local host and displays the correct message but now it is on someone elses shared host provider it is not working ??? Thanks James <?php include("db.php"); $nowdate = date('d/m/Y'); $query = "SELECT * FROM arab_flights ORDER BY flightid DESC LIMIT 5"; $result= mysql_query($query); $timenow = date('H:i:s'); //Applying the variables for the extraction while($myrow = mysql_fetch_array($result)) { $flightid = $myrow['flightid']; $departing = $myrow['departing']; $arriving = $myrow['arriving']; $aircraft = $myrow['aircraft']; $memberid = $myrow['memberid']; $time_startgate = $myrow['time_startgate']; $time_starttaxi = $myrow['time_starttaxi']; $time_startclimb = $myrow['time_startclimb']; $time_startcruise = $myrow['time_startcruise']; $time_startapproach = $myrow['time_startapproach']; $time_arrivedgate = $myrow['time_arrivedgate']; //Working Out Their Status if ($timenow >= $time_startgate) { $status=('<img src="images/status_atgate.jpg" />'); } elseif ($timenow >= $time_starttaxi) { $status=('<img src="images/status_taxi.jpg" />'); } elseif ($timenow >= $time_startclimb) { $status=('<img src="images/status_climbing.jpg" />'); } elseif ($timenow >= $time_startcruise) { $status=('<img src="images/status_cruise.jpg" />'); } elseif ($timenow >= $time_startapproach) { $status=('<img src="images/status_approach.jpg" />'); } elseif ($timenow >= $time_arrivedgate) { $status=('<img src="images/status_arrived.jpg" />'); } else { $status=('<img src="images/status_error.jpg" />'); } $data =("$status"); echo '<td height="28" class="content_table" align="center">' . $flightid . '</td> <td width="143" class="content_table" align="center">' . $departing . '</td> <td width="135" class="content_table" align="center">' . $arriving . '</td> <td width="134" class="content_table" align="center">' . $aircraft . '</td> <td width="102" class="content_table" align="center">' . $memberid . '</td> <td width="149" class="content_table" align="center">' . $data . '</td>'; } mysql_close() ; ?> Link to comment https://forums.phpfreaks.com/topic/58962-elseif-statement-error/ Share on other sites More sharing options...
jfs0479 Posted July 9, 2007 Author Share Posted July 9, 2007 anyone? Link to comment https://forums.phpfreaks.com/topic/58962-elseif-statement-error/#findComment-293138 Share on other sites More sharing options...
redarrow Posted July 9, 2007 Share Posted July 9, 2007 Mke sure the folder are in the correct place and also make sure all folder setted at cmod 0777 Link to comment https://forums.phpfreaks.com/topic/58962-elseif-statement-error/#findComment-293148 Share on other sites More sharing options...
jfs0479 Posted July 9, 2007 Author Share Posted July 9, 2007 Well i have just tried that method but it is still not working but now it is displaying just the image of images/status_atgate.jpg which is really annying as everything is being entered in the correct format into the database...??? Anybody know? Link to comment https://forums.phpfreaks.com/topic/58962-elseif-statement-error/#findComment-293490 Share on other sites More sharing options...
HuggieBear Posted July 9, 2007 Share Posted July 9, 2007 Is all the information being entered into the HTML table underneath OK? Regards Huggie Link to comment https://forums.phpfreaks.com/topic/58962-elseif-statement-error/#findComment-293496 Share on other sites More sharing options...
jfs0479 Posted July 9, 2007 Author Share Posted July 9, 2007 Yea all of the extra information in the table is being shown in the table thats wht is making it so strange as it worked on my localhost but not on a shared host provider ...thanks Link to comment https://forums.phpfreaks.com/topic/58962-elseif-statement-error/#findComment-293503 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.