Mysql Query is not working, why?
Posted
by
Furkan Kadioglu
on Stack Overflow
See other posts from Stack Overflow
or by Furkan Kadioglu
Published on 2012-09-15T15:23:55Z
Indexed on
2012/09/15
15:37 UTC
Read the original article
Hit count: 174
Im using this example: www.jtable.org
Now i download to jtable php version. And i edited script. Jtable simple version is working but my edition is doesnt working.
I can do list, but i cant do add a row; this codes having problem. But php doesnt giving any error.
else if($_GET["action"] == "create")
{
//Insert record into database
$result = mysql_query("INSERT INTO veriler(bolge, sehir, firma, adres, tel, web) VALUES('" . $_POST["bolge"] . "', '" . $_POST["sehir"] . "', '" . $_POST["firma"] . "', '" . $_POST["adres"] . "', '" . $_POST["tel"] . "', '" . $_POST["web"] . "'");
//Get last inserted record (to return to jTable)
$result = mysql_query("SELECT * FROM veriler WHERE id = LAST_INSERT_ID();");
$row = mysql_fetch_array($result);
//Return result to jTable
$jTableResult = array();
$jTableResult['Result'] = "OK";
$jTableResult['Record'] = $row;
print json_encode($jTableResult);
}
if you doesnt understand, please ask me question. Where is the problem?
© Stack Overflow or respective owner