mysql_insert_id ON mysql_insert

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 14, 2014   (RSS)

By Djulia - October 14, 2014 - edited: October 14, 2014

Hi,

I would like to use mysql_insert_id after the mysql_insert function.

I tested this, but that does not function.

$colsToValues = array('field' => '...');
mysql_insert($tableName, $colsToValues, true);
$recordNum = mysql_insert_id()

$recordNum give always '0'.

What I would like, it is to be able to use $colsToValues and obtain mysql_insert_id().

Would there be a solution?

Thanks!

Djulia

By Djulia - October 14, 2014

Hi Claire,

It is perfect! :)

Thank you for your reactivity!

Djulia