completeamateur
Members-
Posts
69 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
completeamateur's Achievements
Member (2/5)
0
Reputation
-
[SOLVED] Problem with Zend_Form_Decorator_FormErrors
completeamateur replied to completeamateur's topic in Frameworks
Simple mistake... I've set up a 'dev' subfolder in my hosting hence the path to the Zend libraries had changed, or at least that seems to have done the trick! -
Hi there, my site is working fine locally, but when I upload it to my webspace I get the following error... http://dev.awayfans.co.uk/user/register I've tried updating the Zend libraries but no luck. Any suggestions? Regards.
-
Hi guys, I'm setting up a database to help control my web site's product catalogue and stock levels. I'm thinking of having 2 tables, one that describes each product (common information), as well as one that contains possible options (unique information). I wanted to hear people's suggestions regarding the layout I have come up with... CREATE TABLE IF NOT EXISTS `products` ( `productID` smallint(6) unsigned NOT NULL auto_increment, `team` text NOT NULL, `description` text NOT NULL, `HA3` tinyint(1) NOT NULL, `gk` tinyint(1) NOT NULL, `start` year(4) NOT NULL, `end` year(4) NOT NULL, PRIMARY KEY (`productID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; CREATE TABLE IF NOT EXISTS `stock` ( `stockID` smallint(5) unsigned NOT NULL auto_increment, `size` tinytext NOT NULL, `price` float NOT NULL, `condition` tinyint(1) NOT NULL, `qty` smallint(3) NOT NULL, `productID` smallint(5) unsigned NOT NULL, PRIMARY KEY (`stockID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; FYI, each product could have up to 50 different options (approx. 10 size variations and 5 condition variations). Is this the best approach or would you approach it differently? It seems a little cumbersome but my brain isn't capable of anything better! Thanks for your help.
-
I have no finger nails or hair, but after what has felt like several years, I've managed to sort it!! $sql = $this->select() ->from('category AS node') ->from('category AS parent', '') ->from('category AS sub_parent', '(COUNT(parent.name) - (sub_tree.depth + 1)) AS depth') ->joinInner( array('sub_tree' => $this->select() ->from('category AS node', 'name') ->from('category AS parent', '(COUNT(parent.name) - 1) AS depth') ->where('node.lft BETWEEN parent.lft AND parent.rgt') ->where('node.lft = ' . $lft) ->group('node.name') ->order('node.lft') ), 'sub_parent.name = sub_tree.name', array() ) ->where('node.lft BETWEEN parent.lft AND parent.rgt') ->where('node.lft BETWEEN sub_parent.lft AND sub_parent.rgt') ->group('node.name') ->having('depth = 1') ->order('node.lft');
-
[SOLVED] ZF: Je suis tres confused!
completeamateur replied to completeamateur's topic in Frameworks
Yup, all sorted... no doubt that will throw another couple of hundred questions within the next 5 mins!! ;-) Out of interest, what's the default chmod (i.e. not 777)? Regards. P.S. Any suggestions re the complex query I posted?? -
[SOLVED] ZF: Je suis tres confused!
completeamateur replied to completeamateur's topic in Frameworks
Daniel, I've made the modifications you have suggested and it looks as if we're half way there. I seem to have some permissions problems as it is throwing the following errors... I'm running Mac OS X, PHP 5.2.5, Apache 2.0. Any suggestions? Thanks in advance. -
Yippee!... this has been solved in a different thread! http://www.phpfreaks.com/forums/index.php/topic,227860.0.html
-
Daniel, that's worked a treat. It was trying to enter it as a string rather than an expression. Thank you so much.
-
It's all running from my local machine so there shouldn't be a problem. The query is supposed to resemble what is suggested in http://dev.mysql.com/tech-resources/articles/hierarchical-data.html I'm still not having any joy though. This is my latest (failed) attempt... $sql = $this->select() ->from('category AS node') ->from('category AS parent') ->from('category AS sub_parent') ->from( array('sub_tree' => $this->select() ->from('category AS node') ->from('category AS parent', '(COUNT(parent.name) - 1) AS depth') ->where('node.lft BETWEEN parent.lft AND parent.rgt') ->where('node.lft = 1') ->group('node.name') ->order('node.lft') ), '(COUNT(parent.name) - (sub_tree.depth + 1)) AS depth' ) ->where('node.lft BETWEEN parent.lft AND parent.rgt') ->where('node.lft BETWEEN sub_parent.lft AND sub_parent.rgt') ->where('sub_parent.name = sub_tree.name') ->group('node.name') ->having('depth = 1') ->order('node.lft');
-
I'm afraid this just returns... Notice: Undefined property: Catalogue::$update in /Library/WebServer/Documents/bbusl/application/models/Catalogue.php on line 80 Fatal error: Call to a member function __toString() on a non-object in /Library/WebServer/Documents/bbusl/application/models/Catalogue.php on line 80
-
I'm working with ZF so the code I use to generate the query is a little abstract... $this->update(array('lft'=>'lft + 2'), 'lft > ' . $lft); I've tried all variations of apostrophes and quotes but to no avail. Interestingly enough, I've found that... $this->update(array('lft'=>'2'), 'lft > ' . $lft); ...works fine, but... $this->update(array('lft'=>'lft'), 'lft > ' . $lft); ...doesn't. I presume this is because it is trying to enter the string 'lft'?
-
[SOLVED] ZF: Je suis tres confused!
completeamateur replied to completeamateur's topic in Frameworks
I've just upgraded from ZF 1.5 -> ZF 1.7 and it now throws a form validation error... * The file '' could not be found * The file '' was not found -
Why is the ZF so baffling? I'm trying to provide a facility to upload files. I have created an element within the form... $image = new Zend_Form_Element_File('image'); $image->setLabel('Photo') ->setAttrib('enctype', 'multipart/form-data') ->setRequired(false) ->setDestination('/upload/catalogue/images') ->addValidator('Count', false, 1) // ensure only 1 file ->addValidator('Size', false, 1024000) // limit to 1MB ->addValidator('Extension', false, 'jpg,png,gif'); // only JPEG, PNG, and GIFs ...and the controller consists of... if ($this->_request->isPost()) { $formData = $this->_request->getPost(); Zend_Debug::dump($_FILES); exit; ...but this just returns... array(0) { } i.e. no file is uploaded! I don't understand what I'm doing wrong. Any suggestions?
-
Hi guys, I'm trying to increment the current value of a column by using an update query. UPDATE category SET lft = lft + 2 WHERE lft > $lft; Unfortunately, because I'm using Zend Framework, it interprets 'lft + 2' incorrectly (don't ask me why!). Is there another way to increment the existing value, e.g. lft++
-
Apologies, I'm using Zend Framework 1.5