echo"<div class=\"error\">SFIAB Installation Step 1 is not yet complete.</div>";
echo"<a href=\"install.php\">Go back to installation step 1</a><br />";
echo"</body></html>";
exit;
}
require_once("data/config.inc.php");
require_once("config_editor.inc.php");
require_once("user.inc.php");
require_once("committee.inc.php");
mysql_connect($DBHOST,$DBUSER,$DBPASS);
mysql_select_db($DBNAME);
echo"Checking for SFIAB database... ";
$q=@mysql_query("SELECT val FROM config WHERE var='DBVERSION' AND conferences_id='0'");
$r=@mysql_fetch_object($q);
$dbdbversion=$r->val;
if(!$dbdbversion){
echo"<div class=\"error\">SFIAB Installation Step 2 is not yet complete.</div>";
echo"<a href=\"install2.php\">Go back to installation step 2</a><br />";
echo"</body></html>";
exit;
}
//a fresh install should ONLY have DBVERSION defined in the config table. If there are others (SFIABDIRECTORY) then this is NOT fresh
$q=mysql_query("SELECT * FROM config WHERE conferences_id='0' AND ( var='DBVERSION' OR var='SFIABDIRECTORY') ");
//we might get an error if the config table does not exist (ie, installer step 2 failed)
if(mysql_error()){
//we say all tables, but really only we check for config where conferences_id=0;
echo"<div class=\"error\">ERROR: No SFIAB tables detected, It seems like step 2 failed. Please go <a href=\"install2.php\">Back to Installation Step 2</a> and try again.</div>";
echo"</body></html>";
exit;
}
//1 is okay (DBVERSION). More than 1 is bad (already isntalled)
if(mysql_num_rows($q)>1){
//we say all tables, but really only we check for config where conferences_id=0;