I am using goDaddy server. This page doesn't work but when I copy paste SQL output to phpmyadmin SQL tab, it works. Some pages have same status. Some pages which has "insert into" query, it works. This page works on my computer seamlessly
include('database.php');
$resimurl="some url";
$sql = "INSERT INTO gruplar (grupadı,resim,uyesayı,gelenkutusayı) SELECT '" . $adı ."','" . $resimurl ."',1,0 FROM dual WHERE NOT EXISTS (SELECT idi FROM gruplar WHERE grupadı='". $adı. "')";
$result = mysqli_query($conn, $sql);
die($sql);
databese.php
$servername = "bla bla";
$username = "bla";
$password = "bla";
$dbname = "db name";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die ("HATA"); //die("Connection failed: " . $conn->connect_error);
}
I want to remind that some pages which use this database.php works seamlessly.
Thanks for your help.
I solved problem with chancing table column name "ı" to "i". ex(grupadı => grupadi ) It was not about undefined variable. I think it is about comminication of databese and php works with $adı variable. Thanks for help