diff --git a/common.inc.php b/common.inc.php index c10f7de..3d8013a 100644 --- a/common.inc.php +++ b/common.inc.php @@ -84,8 +84,21 @@ if(!mysql_select_db($DBNAME)) } //find out the fair year and any other 'year=0' configuration parameters (things that dont change as the years go on) -$q=mysql_query("SELECT * FROM config WHERE year='0'"); -if(!mysql_num_rows($q)) +$q=@mysql_query("SELECT * FROM config WHERE year='0'"); + +//we might get an error if installation step 2 is not done (ie, the config table doesnt even exist) +if(mysql_error()) +{ + echo "SFIAB ERROR"; + echo "

Science Fair In A Box - ERROR

"; + echo "SFIAB installation is not complete. Please go to Installer Step 2 to complete the installation process"; + echo "
"; + echo ""; + exit; +} +//if we have 0 (<1) then install2 is not done, which would get caught above, +//if we have 1 (<2) then insatll3 is not done (no entries for FAIRYEAR and SFIABDIRECTORY) +if(mysql_num_rows($q)<2) { echo "SFIAB ERROR"; echo "

Science Fair In A Box - ERROR

";