i have a table in mysql
ques_id (auto increment , primary) ,
ques_title (string)
By using eloquent
$qinfo = new Question ;
$qinfo->ques_title = "xyz" ;
$qinfo ->save() ;
i want to know what will be ques_id
of the above entry .
$qinfo->ques_id
is not working .
Eloquent :
class Question extends Eloquent {
protected $table = 'questions';
public $timestamps = false ;
protected $primarykey = 'ques_id' ;
}
table schema
mysql> desc questions ; +------------+------------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+------------------+------+-----+---------------------+----------------+ | ques_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | ques_title | varchar(200) | NO | UNI | NULL | | | created_at | timestamp | NO | | 0000-00-00 00:00:00 | | | updated_at | timestamp | NO | | 0000-00-00 00:00:00 | | +------------+------------------+------+-----+---------------------+----------------+ 4 rows in set (0.01 sec)