0

I am creating an android app with a php Rest server with firebird database. I can get information from the database via json with php server but I can't update anything. Here is my code.

public function update_user_info (){

        $fname = $_POST['fname'];
        $lname = $_POST['lname'];
        $address = $_POST['address'];
        $city = $_POST['city'];
        $state = $_POST['state'];
        $zip = $_POST['zip'];
        $home = $_POST['home'];
        $cell = $_POST['cell'];
        $birthdate = $_POST['birthdate'];
        $weekly = $_POST['weekly'];
        $email = $_POST['email'];
        $users_id = $_POST[users_id];
        $last_active = date("m/d/Y", time());
        $last_act_time = date("h:i:s", time());

        $acct_email = strtolower($email);
    //make email all lowercase


        horse_connect();
        $query = ibase_prepare("UPDATE USERS SET FIRST_NAME = ?,
                               LAST_NAME = ?, ADDRESS = ?, CITY = ?,
                               STATE = ?, ZIP = ?, HOME_PHONE = ?, CELL_PHONE = ?,
                               BIRTHDATE = ?, HTML_EMAIL = ?,
                               LAST_ACTIVE = ?,
                               LAST_ACT_TIME = ?, EMAIL_NEWS = ?, EMAIL_LIVE_SCORES = ?
                               WHERE USERS_ID = ?");

        $result = ibase_execute($query, $fname, $lname,
                     $address, $city, $state, $zip,
                     $home, $cell, $birthdate,
                     $acct_email, $last_active, $last_act_time,
                     $weekly, $live, $users_id);

        //$final_array = array('user id' => $fname);
        if($Result)
            $json = array("status" => 1);
        else
            $json = array("status" =>0);
        echo json_encode($json);
  } //end: update_user_info

I am using Advanced rest client for testing.

Kevin
  • 53,822
  • 15
  • 101
  • 132

2 Answers2

0

Try using ibase_commit after execute. If possible try to use PDO when working with database.

Edin Omeragic
  • 1,948
  • 1
  • 23
  • 26
0

Thanks everyone but I found the Problem. HTML_EMAIL should be ACCT_EMAIL. HTML_EMAIL is a bit field, true or false. ACCT_EMAIL is a string