Form kullanarak Mysql veri tabanıma veri eklemeye çalışırken bu hatayı alıyorum, yanlışım nerdedir ?? neden olmuyor ?

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, 1, 1, 1, 1 )' at line 2



a.php

<html>
<body>

<?php

$v = $_POST['Vizyon'];
$f = $_POST['Film'];
$y = $_POST['yonet'];
$o = $_POST['oyunc'];
$p = $_POST['puan'];
// Make a MySQL Connection
mysql_connect("localhost", "root", "xxxxx") or die(mysql_error());
mysql_select_db("xxxx") or die(mysql_error());

// Insert a row of information into the table "example"
mysql_query("INSERT INTO Vizyon
(Vizyon, Film, yonet, oyunc, puan) VALUES($v, $f, $y, $o, $p ) ")
or die(mysql_error());

echo "Eklidim!";

?>

</body>
</html>

a.html

<html>

<body>

<form action="a.php" method="post">

Vizyon: <input type="text" name="Vizyon" />

Film: <input type="text" name="Film" />

Yonetmen: <input type="text" name="yonet" />

Oyuncular: <input type="text" name="oyunc" />

Puan: <input type="text" name="puan" />

<input type="submit" />

</form>

</body>

</html>

 

$query = "INSERT INTO Vizyon (Vizyon, Film, yonet, oyunc, puan) VALUES('$v', '$f', '$y', '$o', '$p')";
mysql_query($query) or die(mysql_error());

seklinde dener misin? (tabi bu post ile aldigin data'ya mysql_real_escape_string uygulamayi unutma)

sourlemonade

VALUES($v, $f, $y, $o, $p ) derken değişkenleri tırnak ile kaçmak gerekiyor sanırım.

pentium100mmx

evet '$değişken' gerekliymiş teşekkür ederim !

4telbanayeter
1

mobil görünümden çık