I am trying to parse the code below. I've looked at other sites, giving explanations ranging from short tag openings (which I don't have) to unclosed quotes (mine are closed) to forgotten closing brackets (this is nowhere near the end of my file).
I'm really struggling here - any help is appreciated.
PHP Parse error: syntax error, unexpected $end in /home2/jackaroo/public_html/system/stat.php on line 3
<?php
$username="jackaroo_score";
$password="score";
$database="jackaroo_scores";
//sql connect
mysql_connect(localhost,$username,$password);
mysql_select_db($database) or die( "Unable to select database");
$fetch = mysql_query("SELECT * FROM stat");
while($row = mysql_fetch_array($fetch))
{
//what we're working with: '$ip','$storageup','$storageleft','$switcherup','$aja1up','$aja2up','$serverup','$today' (the var '$today' is in the SQL table as date)
echo "Last update from $row[ip] on $row[date]<br>";
if ( $row[serverup] == 1 ) {
echo "File server is: <img src="green_dot.jpg"> Up";
} else {
echo "File server 1 is: <img src="red_dot.jpg"> Down";
}
if ( $row[storageup] == 1 ) {
echo "RAID Array is: <img src="green_dot.jpg"> Up<br>";
} else {
echo "RAID Array is: <img src="red_dot.jpg"> Down<br>";
}
echo "Storage left: $row[storageleft]"
if ( $row[switcherup] == 1 ) {
echo "Switcher is: <img src="green_dot.jpg"> Up";
} else {
echo "Switcher is: <img src="red_dot.jpg"> Down";
}
if ( $row[aja1up] == 1 ) {
echo "AJA KiPro 1 is: <img src="green_dot.jpg"> Up";
} else {
echo "AJA KiPro 1 is: <img src="red_dot.jpg"> Down";
}
if ( $row[aja2up] == 1 ) {
echo "AJA KiPro 2 is: <img src="green_dot.jpg"> Up";
} else {
echo "AJA KiPro 2 is: <img src="red_dot.jpg"> Down";
}
}
//close sql
mysql_close();
//close php
?>