Zenphoto refused to install the basic tables to the database so I went through setup.php to find the mysql queries and added them manually. At the bottom of zp_images however was the code
$db_schema[] = "ALTER TABLE $tbl_images ".
"ADD CONSTRAINT $cst_images FOREIGN KEY (albumid) REFERENCES $tbl_albums (id) ON DELETE CASCADE ON UPDATE CASCADE;";
What is the sql query I convert this to assuming its needed?
Thank you
The setup.php file had all the boxes ticked, the database was set up with sufficent priviliges but when it came to pressing go it wouldnt write the tables. I asked on the forum and the answer I got was it should have worked, it all seems to be working fine at the moment and I dont have any idea what could have been wrong as it should have worked from the beginning.
ALTER TABLE 'mark_zenphoto'.'zp_images'
ADD CONSTRAINT $cst_images FOREIGN KEY (albumid) REFERENCES 'mark_zenphoto'.'zp_albums' (id) ON DELETE CASCADE ON UPDATE CASCADE)
This is as far as I've got but I know the syntax must be wrong. Also I dont understand what I would translate $cst_images to. Would it be 'mark_zenphoto'.'zp_images_ibjfk1'?
// Prefix the constraint names:
$cst_images = prefix('images_ibfk1');