Really idk whats wrong here every time I try to insert into 1 signal column?
Database connected very well, table name is stad
, and it contains two columns id
AI PRIMARY and name
unique
<?php
@$submit = $_POST['submit'] ;
@$stadName = $_POST['stadName'];
if(isset($submit)){
if(!$stadName){
echo "Error" ;
}else{
$sql = 'INSERT INTO stad name VALUES :name';
$stmt = $pdo->prepare($sql);
$stmt->execute(['name' => $stadName]);
echo "DONE" ;
}
}
?>
connection file
<?php
$serv = '127.0.0.1';
$user = 'root';
$pass = 'root';
$dbname = 'akfoot';
// db base connection
$pdo = new PDO('mysql:dbname='.$dbname.';host='.$serv.'; charset=utf8',$user,$pass);
?>
Database: