Search the Community

Showing results for tags 'sql'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk


There are no results to display.

Found 10 results

  1. I've been working with different CMS's for quite a few years now but there was always one thing that bugged me, I never knew how the CMS takes a url and resolves a page ID from it. I knew it was to do with the "slug" but what i couldn't figure out is when it came to sub pages, as the slug only refers to the page itself not the parent pages in the url e.g /parent-page/sub-page. The main two CMS's i've worked with are Wordpress and ProcessWire, ProcessWire always has the upper hand when it comes to speed, even a large PW site is tens of milliseconds faster than a fresh Wordpress install. With the resolution of urls to pages being (probably) the most used query in a CMS i thought i'd investigate the two different approaches. Both ProcessWire and Wordpress split the urls by forward slash to extract the slugs /about/people/ => ['about', 'people'], however ProcessWire takes a completely different approach when it comes to resolving a page ID from these slugs. ProcessWire uses this query: SELECT,pages.parent_id,pages.templates_id FROM `pages` JOIN pages AS parent2 ON ( AND ('about')) JOIN pages AS rootparent ON ( AND WHERE'people' AND (pages.status<9999999) GROUP BY LIMIT 0,1; Resulting in a single item of the page in question including the page's template id. For urls with more parts it looks as though ProcessWire creates more JOINS to essentially walk back up the hierarchy and fully resolve the ID of the correct page. Wordpress on the other hand takes a different approach: SELECT ID, post_name, post_parent, post_type FROM wp_posts WHERE post_name IN ('about','people') AND post_type IN ('page','attachment'); More elegant looking however it returns a list of potential items. So requires a loop within PHP to walk the hierarchy tree and determine the correct page ID. Both queries once cached by MySQL took 19-21ms to return, ProcessWire looks as though it uses this to it's advantage by returning the correct page ID straight from the MySQL cache and doesn't require the extra looping step afterwards. Interesting to see the different approaches to the same problems.
  2. Hi all I have big troubles with my DB backups and phpMyAdmin. I can't manage to import a backup. The phpMyAdmin export settings are left to the defaults. The error message I get: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `caches` (`name`, `data`, `expires`) VALUES ('' at line 11 When I delete the complete 'cache' section there are almost for all tables the same errors. (part of the dump attached) I had this problem before and back then (couple months ago) I think I copied almost every table individually. I thought it was specific to that DB. But I can't do a dump/import of any of my PW installations. MySQL: 5.6.27 PHP version: 7.0.11 phpMyAdmin: Anybody knows that problem? Or what to do? phpMyAdmin SQL Dump.sql
  3. I've been asked to look into migrating an existing site into Magento & Stripe. I haven't mentioned to my client whether he would consider Processwire because I wasn't sure how to do the accounting side of things using PW. He currently has a bespoke site (PHP / MySQL) and 1 of his biggest problems is that there are some bugs with the accounting side of things and he has to reconcile his accounts manually. As much as I like PW, I don't know how easy it would be generate various sales and accounting report using PW. The only way I can currently think of is to store each sale as a page and I would have to write various get functions with filters and loop through them to get totals. I never thought I'd say this but I'm missing SQL right now Any thoughts, suggestions or opinions would be welcome here.
  4. pw 3.0.36 I just installed on a new site and received this warning when I accessed the admin url. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'ProcessLogger' for key 'class' Is that anything to worry about? The admin and site appear to be working fine. I just want to avoid issues down the road if there is a problem somewhere.
  5. Hi guys I have a problem with a specific filter/selector I try to achieve. The following filter causes a SQL-Error. This error also appears when I want to sort subfields(options and page fields - multi and single select) in the lister or with the API. Some Infos Processwire Version: 2.7.3 ListerPro Version: 1.0.8 Media Manager: 0.0.6 PHP-Version: 7.0.8-0 UBUNTU MySQL-Version: 5.7.13-0ubuntu0.16.04.2-log - (Ubuntu) I tried changing the sql_mode many times: DEFAULT IS: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NO_ENGINE_SUBSTITUTION I tried all above but with minimal effect. When I remove "ONLY_FULL_GROUP_BY" it doesn't cause a SQL-Error but it still can't find the page. Also sorting subfields start working. But everything works fine locally on a fresh blank install with the media manager and listerpro. My local MySQL Version is 5.6.25 and PHP version is 5.6. ----------------------------------------------------------- The Intention why I am asking (last post): ----------------------------------------------------------- Some other Processwire Topics related to sql_modes: I wanted to ask in the forum before I try it on github: ----------------------------------------------------------- Some related links to sql_modes: Greetings Orkun
  6. Is there an easy way to get back the SQL query generated by a specific processwire selector? I have what appears to be a cartesian product and/or groupwise maximum bug in a selector, but I'm not sure how to confirm it. I'm querying for a set of pages with a specific template which are related to the current page. The returned pages include a URL field and a file field. The selector looks like this: $grades = $pages->find('template=grade,include=all,classification.title="'.$page->title.'",sort=series,sort=title'); "classification" is a page field. Series and title are text fields. I'm iterating through the results and outputting three text fields, a URL field, and a file (->url) field. On one of the nine pages using this query, it should only return one row, but it returns two. The text fields are identical for both rows. The URL and file fields are empty in the first row and populated in the second row. The other eight pages all work as expected with no duplication. Thanks, Jason
  7. Creating separate thread as last one was a bit buried. Apologies. I think our VPS provider has been having issues today with their servers and when I tried going to one of our sites we were getting "Unable to complete this request errors". When I turned on debugging, I get the following error Fatal error: Exception: SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql_daf_0.MYI' (Errcode: 30) Which sounds to me like it's a problem accessing/writing to the database (on our server)? Could anyone confirm if that sounds right? Cheers guys.
  8. is it somehow possible to get PW running without SQL - maybe as a file based CMS, saving everything in a single(?) xml or multiple txt files? i know, there are a lot of downsides using files, but for some small projects it would be a great alternative!
  9. Hi all, I'm tweaking a search engine that's built using PW selectors. I'm wondering if there is a way to set the selector to find word fragments, for example the user searches on 'grass seed' and I want to find fields that have the words 'grasses' and 'seeding' (or 'grassy' and 'seeds' for another example). I know I can use the %= selector, but my options there are body%=grass seed or body%=grass|seed, neither of which return just what I want. I could switch to using raw SQL (body LIKE 'grass%' AND body LIKE 'seed%') but I'd rather stick with PW selectors if I can. Thanks!
  10. Hey, My company asked me how Processwire handles SQL Injections, i was quite sure this was done somewhere but after some scanning through the code and the documentation. I noticed I couldn't really find an answer to the question. Because security is a big issue I would like to ask where and how processwire handles SQL injections? Big thanks! Greetings, Harm.