Site icon Pro House Tips

how to get another column same value for the increment culomn

i have column call id is increment auto in DB how to get another column same value?

EX:

id vid
1 1
2 1
3 2
$sql = 'insert into villa (id,vid)
     values(:itid,:itvid)';

     $stmt->execute($r = array(
            'itid'                       => null,
            'itvid'=>id));

i am not sure about this because it is not work

Exit mobile version