update db record and file name

Hi all,

I want to create/update… both file name and correspoding record in DB. can I use transaction? I tried this:



	//create a row entry


	//create a pysical folder



	echo $model->id;


catch(Exception $e){


	echo '-1';


but it seems no effect, because when the fileRoot was incorrect, it still prints out $model->id.

thanks for reading this.

mkdir() doesn’t throw an Exception on failure. You have to check its return value and rollback if it’s false.

ok, I kind of see the point. thanks for your pointer, phtamas.