Jump to content

koen

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

koen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've read the section and tried some things. But I don't see how full text search can match a partial word. To give another example: the field contains 1 word for every row row1: possibl row2: possib I want the best match when I search for 'possible' (wich is the field from row 1).
  2. Example: searching for string ABCDEFG, and in DB there's string ABCDE and ABC. ABCDE is best match. What sql can I use for this? One option I see but don't really like is searching with WHERE string LIKE abcdefg OR string LIKE abcdef OR ...
  3. This category class asks the connection upon construction. I would wait with this until necessary. A $this->getConnection() method could do this.
  4. I think we'll get scenario's as described above. Hosts who have enabled the mysql/mysqli extension and aren't going to enable extra extensions for working with pdo.
  5. Is there any indication that if they push PDO to be the standard the mysqli drivers for it will be enabled by default?
  6. You may want to declare a private __clone() method to the singleton too.
  7. Another option is the one used by CakePHP. I only very briefly looked at it but it doesn't seem to require anything other than the files itself.
  8. There's an interesting discussion going on right now about the MVC models in PHP frameworks, and about the nature of the MVC model itself. I think the email quoted in the following post is an interesting clarification of some widely misunderstood MVC conceptions: http://pookey.co.uk/blog/archives/43-phplondon08-the-crazy-guy-mail.html
  9. Suppose you're working in a database class and every method in this class needs the database connection. A common solution is to to use somethink like this private $db; public method getPosts() { $db = $this->getConnection(); $db->execute( // some sql here); } private method getConnection() { if (is_null($this->db) $this->db = // stuff to get connection return $this->db; } This doesn't prevent methods from calling $this->db directly. Encapsulation is mostly viewed between objects but not in the object itself. To prevent methods from accessing $this->db a solution would be the following: private method getConnection() { static $db; if (is_null($db) $db = // stuff to get connection return $db; } Is there a reason the first one is used and not the second one?
  10. That would mean I'd try to log in your account and after a number of failed attempts you and I are both blocked from loggin in? I'd say only block the visitor who's trying to log in.
  11. Is there any technique that prevents the view from updating the model? Example: Controller says: model, do a login with credentials x and y. The view has access to the model also, to display some data. But I don't want it to be able to ask it to do a login. So I think the question is whether there is a way to allow the controller to access [property or method] X of the model but not Y, and the view only Y but not X.
  12. http://www.martinfowler.com/eaaDev/uiArchs.html
  13. So you have a couple of checkboxes on the first page that each hold an array,eg array(2, 5, 7) for checkbox 2. Then on the second page, after a user has chosen checkbox 2, you want a button for each of these values in the array. Is that what you want?
  14. One day you have 2 session handling classes, one with a DB, and with the regular session mechanisms, and you want to be able to choose between the dynamically. If you get your session class from the factory, there's only one place to get the session, which also decides which of the 2 session handlers will be used. What would be a good design now to include possible changes like this?
  15. I don't see a form with action=add?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.