Notice: Undefined variable: db in B:\xampp\htdocs\link-ekle.php on line 7
Fatal error: Uncaught Error: Call to a member function prepare() on null in B:\xampp\htdocs\link-ekle.php:7 Stack trace: #0 {main} thrown in B:\xampp\htdocs\link-ekle.php on line 7
Insert kodları
if ($_POST){
$ad = $_POST["ad"];
$link = $_POST["link"];
echo "Proje Ad : ". $ad . "
Proje Link :" . $link;
$query = $db->prepare("INSERT INTO link SET
link_ad = ?,
link_link = ?");
$insert = $query->execute(array(
$ad, $link
));
if ( $insert ){
$last_id = $db->lastInsertId();
print "insert işlemi başarılı!";
}
}else{
}