Welcome Guest, Not a member yet? Register   Sign In
delete max value from column
#1

Hi
i have problem when executed this code in CodeIgniter it deletes all records not only the max value record although it works fine if i execute Sql query in phpmyadmin what wrong in PHP code my code:

controller:

    $this->data->del_data_query('DELETE FROM `sessions` WHERE
          sessions.name =
            "dina" and id = (select max(id) from `sessions` ) ');

  Model:

  public function del_data_query($query)

  {

    $this->db->query($query);

  }
Reply
#2

@EdwardOkduduMari ,

Can you kick out the actual query that CI executes? Just to confirm that your query is that same as the query that you run directly in phpMyAdmin.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB