Jump to content

Jonob

Members
  • Posts

    77
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Jonob's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a setup where users can store 'templates' in a table. When they add new products, they can apply these templates to the new product - basically it pre-fills fields in the product form. For example, they can store a template with a name of 'red tomato', and if they create a new product called 'red tomato', then the system will automatically find the rule, and apply the template. At the moment, this is super simple, and performed via a query as follows: SELECT * FROM (`templates`) WHERE `rule` like '%red tomato%' LIMIT 1 I'd like to take this to the next step, and give users more flexibility in how the search is performed. For example, I'd like to allow users to save wildcards with their template rules. So, they could create a template rule called '*tomato' and this would match any of the following search terms: 'tomato', 'red tomato' or 'green tomato'. Do I need to be careful with the wildcards that are allowed (reserved or special chars ?). Any other general concerns or comments would be appreciated.
  2. I am using a curl library to upload images to Amazon S3 using a php wrapper (http://undesigned.org.za/2007/10/22/amazon-s3-php-class). However, becuse CURLOPT_FOLLOWLOCATION is set to true on my server and open_basedir is enabled, this throws an error: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set I understand that I could disable open_basedir or use one of the workarounds at http://php.net/manual/en/function.curl-setopt.php. Instead, as a quick test I set CURLOPT_FOLLOWLOCATION = false. The image upload to S3 still seems to work, but I am concerned that something may break down the line. Are there any implications that I should be aware of? I am not quite if CURLOPT_FOLLOWLOCATION is it even relevant in this case?
  3. I have been familiarising myself with most of the well known frameworks. Codeigniter seems to come out trumps in terms of usability, ease of use and speed. However, my one major concern that sometimes gets repeated is that its a 'starter' framework and that developers tend to outgrow it. I am not quite sure what it means to outgrow a framework. Does anyone have real experience of this, and reasons why they moved from CI to something else (presumably Zend or Symphony?). I am looking to build a fairly large project, and want to make sure that over the long term is sustainable, maintainable and scalable (lots of ables!). Thanks for any advice that you can give.
  4. ini_set('max_execution_time', 0); seemed to work fine
  5. Howdy, I am running xampp on windows 7 64 bit and have one particularly intensive script to run. I have changed the max_execution_time var in /xampp/php/php.ini to 3000, and phpinfo clearly shows 3000 max_execution_time for local and master value. However, when running the script, I still get a "Maximum execution time of 60 seconds exceeded" error. Am I missing something obvious here? Thanks for any help you can provide.
  6. I have a database table that stores imported information. For simplicity, its something like: CREATE TABLE `data_import` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `payee` VARCHAR(50) NULL DEFAULT NULL, PRIMARY KEY (`id`), INDEX `payee` (`payee`) ) I also have a table that stores import rules: CREATE TABLE `import_rules` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `search` VARCHAR(50) NULL DEFAULT NULL, PRIMARY KEY (`id`), INDEX `search` (`search`) ) The idea is that for each imported transaction, the query needs to try find a single matching rule - this match is done on the data_import.payee and import_rules.seach fields. There won't always be a match, and thats fine. Because these are both varchar fields, I have indexed them in the hope of making the query faster. This is what I have come up with so far, which seems to work fine. SELECT id.id, id.payee, ir.id, ir.search FROM import_data id LEFT JOIN import_rules ir on i.payee = ir.search I would like to now make this search functionality a little bit more powerful, so that a partial match can be returned. Lets say, for example, that we have id.payee = 'coca cola' and ir.search = 'cola'. This should still return a match. My understanding is that "LIKE '%search%'" has bad performance. Are there any other alternatives?
×
×
  • 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.