Answer the question
In order to leave comments, you need to log in
What is the problem with Fatal error: Cannot break/continue 1 level?
When I try to update the file, it gives -
Fatal error: Cannot break/continue 1 level in C:\OpenServer\domains\AnnaMarcus\admin\inc\update_info.php on line 12
Form
<form method="post" action="inc/update_info.php">
<textarea name="info"></textarea>
<input type="submit" title="Отправить"/>
</form>
include "class.main.php";
$classes=new classes;
$error=false;
$text = $_POST['info'];
$id = 1;
if(!$classes->update_info($text, $id)) {
$error=true;
break;
}
if(!$error){echo "<script> location.replace('../info.php'); </script>";}
class classes extends db{
function update_info($text, $id){
$quest = "UPDATE info SET `text` = ".$text." WHERE `id` =".$id;
if($result=$this->connection->query($quest)){
return(true);
}
else{
return(false);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question