properly install config types and type values

properly rollover config types and type values
This commit is contained in:
james 2007-09-26 20:21:13 +00:00
parent 1aa5ef0332
commit 620353e8fa
2 changed files with 6 additions and 4 deletions

View File

@ -68,12 +68,14 @@
$q=mysql_query("SELECT * FROM config WHERE year='$currentfairyear'");
echo mysql_error();
while($r=mysql_fetch_object($q))
mysql_query("INSERT INTO config (var,val,category,ord,description,year) VALUES (
mysql_query("INSERT INTO config (var,val,category,ord,description,type,type_values,year) VALUES (
'".mysql_escape_string($r->var)."',
'".mysql_escape_string($r->val)."',
'".mysql_escape_string($r->category)."',
'".mysql_escape_string($r->ord)."',
'".mysql_escape_string($r->description)."',
'".mysql_escape_string($r->type)."',
'".mysql_escape_string($r->type_values)."',
'".mysql_escape_string($newfairyear)."')");
//now the dates

View File

@ -115,12 +115,12 @@ if($_POST['action']=="save")
{
//add the actual fair name, and just insert the defaults of everything else
if($r->var=="fairname")
mysql_query("INSERT INTO config (var,val,description,category,ord,year) VALUES ('$r->var','".mysql_escape_string(stripslashes($_POST['fairname']))."','".mysql_escape_string($r->description)."','".mysql_escape_string($r->category)."','$r->ord','".$_POST['fairyear']."')");
mysql_query("INSERT INTO config (var,val,description,category,ord,year,type,type_values) VALUES ('$r->var','".mysql_escape_string(stripslashes($_POST['fairname']))."','".mysql_escape_string($r->description)."','".mysql_escape_string($r->category)."','$r->ord','".$_POST['fairyear']."','".mysql_escape_string($r->type)."','".mysql_escape_string($r->type_values)."')");
//add the fair manager as well
else if($r->var=="fairmanager")
mysql_query("INSERT INTO config (var,val,description,category,ord,year) VALUES ('$r->var','".mysql_escape_string(stripslashes($_POST['email']))."','".mysql_escape_string($r->description)."','".mysql_escape_string($r->category)."','$r->ord','".$_POST['fairyear']."')");
mysql_query("INSERT INTO config (var,val,description,category,ord,year,type,type_values) VALUES ('$r->var','".mysql_escape_string(stripslashes($_POST['email']))."','".mysql_escape_string($r->description)."','".mysql_escape_string($r->category)."','$r->ord','".$_POST['fairyear']."','".mysql_escape_string($r->type)."','".mysql_escape_string($r->type_values)."')");
else
mysql_query("INSERT INTO config (var,val,description,category,ord,year) VALUES ('$r->var','$r->val','".mysql_escape_string($r->description)."','".mysql_escape_string($r->category)."','$r->ord','".$_POST['fairyear']."')");
mysql_query("INSERT INTO config (var,val,description,category,ord,year,type,type_values) VALUES ('$r->var','$r->val','".mysql_escape_string($r->description)."','".mysql_escape_string($r->category)."','$r->ord','".$_POST['fairyear']."','".mysql_escape_string($r->type)."','".mysql_escape_string($r->type_values)."')");
}
//copy over the dates defautls