What I mean is something like the following
CODE
<?php
switch($page) {
case "default":
$sql = "CREATE TABLE DEFAULT";
$process = mysql_query($sql) or die(mysql_error());
if($process)
{
echo "DONE!";
define('DEFAULT', true);
} else {
die("<p>Error occurred on <strong>". (__LINE__) . (__FILE__) ."</strong></p>");
}
break;
case "not_default":
$this->include_form('prefs');
define('DEFAULT', false);
break;
}
?>
switch($page) {
case "default":
$sql = "CREATE TABLE DEFAULT";
$process = mysql_query($sql) or die(mysql_error());
if($process)
{
echo "DONE!";
define('DEFAULT', true);
} else {
die("<p>Error occurred on <strong>". (__LINE__) . (__FILE__) ."</strong></p>");
}
break;
case "not_default":
$this->include_form('prefs');
define('DEFAULT', false);
break;
}
?>
Or is the switch... case... operator for one line operations?
I want help ASAP
- Thanks for any help here