Can someone spot my problem here this is just part of code but I had it to where it created tables and inserted data into some tables I thought since the create and insert was getting so big I would open a .sql file and do it that way so I took out the create and insert stuff and replaced it with what’s at ******** Now I get this error
Parse error: syntax error, unexpected $end in /home/public_html/App/setup.php on line 163
163 is the very last line
<?php
exit;
}else{
// if connection is successful, save parameters into config.php
if(!$fp=@fopen("./config.php", "w")){
echo $divFormat."<div style=\"color: red;\">".$Translation["couldnt save config"]."</div></div><br>";
echo $backHome;
exit;
}else{
fwrite($fp, "<?php\n");
fwrite($fp, "\t\$dbServer=\"$dbServer\";\n");
fwrite($fp, "\t\$dbUsername=\"$dbUsername\";\n");
fwrite($fp, "\t\$dbPassword=\"$dbPassword\";\n");
fwrite($fp, "\t\$dbDatabase=\"$dbDatabase\";\n");
fwrite($fp, "?>");
fclose($fp);
}
}
********$f = fopen('DataBase_Tables.sql','r');
while($t = fread($f,1024657)){ $sql .= $t;}
fclose($f);
$lines = explode(';',$sql);
foreach($lines as $line){
if(trim($line)){
mysql_query($line) or die(mysql_error());********
}
// save MD5
if($fp=@fopen("./setup.md5", "w")){
fwrite($fp, $thisMD5);
fclose($fp);
}
// go to index
echo $backHome;
// ------------------------------------------
function setupTable($tableName, $createSQL='', $arrAlter=''){
global $Translation;
echo "<div style=\"padding: 5px; border-bottom:solid 1px silver; font-family: verdana, arial; font-size: 10px;\">";
if($res=@mysql_query("select count(1) from `$tableName`")){
if($row=@mysql_fetch_array($res)){
echo str_replace("<TableName>", $tableName, str_replace("<NumRecords>", $row[0],$Translation["table exists"]));
if(is_array($arrAlter)){
echo '<br>';
foreach($arrAlter as $alter){
if($alter!=''){
echo "$alter ... ";
if(!@mysql_query($alter)){
echo "<font color=red>".$Translation["failed"]."</font><br>";
echo "<font color=red>".$Translation["mysql said"]." ".mysql_error()."</font><br>";
}else{
echo "<font color=green>".$Translation["ok"]."</font><br>";
}
}
}
}else{
echo $Translation["table uptodate"];
}
}else{
echo str_replace("<TableName>", $tableName, $Translation["couldnt count"]);
}
}else{
echo str_replace("<TableName>", $tableName, $Translation["creating table"]);
if(!@mysql_query($createSQL)){
echo "<font color=red>".$Translation["failed"]."</font><br>";
echo "<font color=red>".$Translation["mysql said"].mysql_error()."</font>";
}else{
echo "<font color=green>".$Translation["ok"]."</font>";
}
}
echo "</div>";
}
?>