Member
Member
Chief   2008-07-02, 00:49
#1

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

Member
Member
sbillard   2008-07-02, 02:37
#2

That is the sql you need to execute.

But you might want to figure out why setup was not able to do the job as whatever it is may cause other problems within zenphjoto.

Member
Member
Chief   2008-07-02, 07:18
#3

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.

Member
Member
Chief   2008-07-02, 07:20
#4

Can you also help convert that statement into a sql query I can add to it. I get a syntax error which I assume is coming from the mix of php in there as well. Thank you

Member
Member
Chief   2008-07-02, 09:01
#5

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');

Member
Member
sbillard   2008-07-02, 18:49
#6

if you run setup.php?debug it will create a setup_log.txt file that has all the SQL plus what result it got back if there was a failure. This would be interesting to see.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.