im using mambo CMS and a mambot to imbed php
heres my code:
<h4>Below is a list off all Members</h4>
Please we aware these figures are in hours and are about 98% accurate until we find a permenate solution to converting the minutes back to hours using php
<body bgcolor="#CCCCCC" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<?php
include"configuration.php";
// Open MySQL connection
$mysql = mysql_connect($mosConfig_host,$mosConfig_user,$mosConfig_password);
$db = mysql_select_db($databse,$mysql);
// Get data from table
$result = mysql_query("SELECT * FROM pilotinfo WHERE visible='1'",$mysql);
while($row = mysql_fetch_array($result)) {
$data[] = $row;
}
// Set up the table, put little bits of HTML after the ? > if you want if you want.
?>
<table border=1 cellpadding=2 cellspacing=0><tr><th width="48">ID</th><th>Name</th><th>Flight Hours</th><th>Rank</th></tr>
<?php
// Begin printing data
for($i=0;$i<count($data);$i++) {
$temp1 = $data[$i]['id'];
$temp2 = $data[$i]['name'];
$temp3 = $data[$i]['hour'];
if ($temp3 < 2000)
{
$val = "2000";
$rank = '<img src="http://danhill.frihost.net/easyjetv/images/pilot.jpg"><br><b>Trainee 2nd Officer</b>';
}
elseif ($temp3 < 6000)
{
$val = "6000";
$rank = '<img src="http://danhill.frihost.net/easyjetv/images/second.jpg"><br><b>Second Officer</b>';
}
elseif ($temp3 < 8000)
{
$val = "8000";
$rank = '<img src="http://danhill.frihost.net/easyjetv/images/first.jpg"><br><b>First Officer</b>';
}
elseif ($temp3 < 10000)
{
$val = "10000";
$rank = '<img src="http://danhill.frihost.net/easyjetv/images/capt.jpg"><br><b>Captain</b>';
}
elseif ($temp3 < 12000)
{
$val = "12000";
$rank = '<img src="http://danhill.frihost.net/easyjetv/images/scapt.jpg"><br><b>Senior Captain</b>';
}
elseif ($temp3 = 440887)
{
$val = "440887";
$rank = '<img src="http://danhill.frihost.net/easyjetv/images/scapt.jpg"><br><b>Senior Captain/CEO</b>';
}
$hours2 = "$temp3"/60;
$number = "$hours2";
// english notation without thousands seperator
$hours3 = number_format($number, 1, '.', '');
// 1234.57
print("<tr><td>V-RAF $temp1</td><td>$temp2</td><td>$hours3</td><td>$rank</td></tr>");
}
print("</table>");
// Add thats all folks!
?>
<br><br>
Rank Requirements:<br />
<table cellspacing="1" cellpadding="2" border="2" align="center">
<tr>
<td>Rank</td>
<td>Hours</td>
<td>Image</td>
<br />
</tr>
<tr>
<td>Trainee Second Officer<br />
</td>
<td>0 -> 33.3<br />
</td>
<td><img border="0" src="http://danhill.frihost.net/easyjetv/images/pilot.jpg" /></td>
</tr>
<tr>
<td>Second Officer<br />
</td>
<td>33.4 -> 100<br />
</td>
<td><img border="0" src="http://danhill.frihost.net/easyjetv/images/second.jpg" /></td>
</tr>
<tr>
<td>First Officer<br />
</td>
<td>100.1 -> 133.3<br />
</td>
<td><img border="0" src="http://danhill.frihost.net/easyjetv/images/first.jpg" /></td>
</tr>
<tr>
<td>Captain<br />
</td>
<td>133.4 -> 166.6<br />
</td>
<td><img border="0" src="http://danhill.frihost.net/easyjetv/images/capt.jpg" /></td>
</tr>
<tr>
<td>Senior Catain<br />
</td>
<td>166.7 +<br />
</td>
<td><img border="0" src="http://danhill.frihost.net/easyjetv/images/scapt.jpg" /></td>
</tr>
</table>
heres my error:
Warning: Invalid argument supplied for foreach() in /home/homer090/public_html/global-european/includes/frontend.php on line 58
ive narrowed it down to the connection part of my script but can't work yout what the problem is as its using mambo's settings to connect?
btw frontend.php is a mambo file and yes i have asked about this error on tehir forum with no replies