Mysql Query is not working in edited jTable code, 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/28 9:37 UTC
Read the original article Hit count: 161

Filed under:
|
|
|
|

I'm using this example: www.jtable.org

I've downloaded the jTable PHP version. I then edited the script. The jTable simple version is working, but my edited version isn't.

I can create a list, but I can't add a row; this code is causing problems. However, PHP doesn't display any error messages.

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);
}

What is the problem?

© Stack Overflow or respective owner

Related posts about php

Related posts about jQuery