![]() |
Multiple category and sub-category insertion
Hello,
I have discovered, quite by accident, that adding categories and sub-categories makes use of a delimiter for multiple entries: PHP Code:
PHP Code:
PHP Code:
PHP Code:
So my tip is the above, and my question is this: Is there a delimiter in place to allow for multiple entries when adding categories and subcategories? |
Yes the slash allows for one under one under and so on, unfortunately doesn't simply allow all one under so have to move them, but is still quicker than typing them all in.
|
Quote:
|
perhaps you could add a delimiter. I am not entirely sure what you programmed everything in, nor how difficult it would be to add a delimiter.
Maybe a simple php explode on | would work along with a basic foreach with the SQL insert. ie: PHP Code:
You would, of course, fix it to fit the tables used, error checking, etc. |
preg_split() is another method to use if you want more control as well as preg_match_all().
Point is..lots of ways to do it. explode can be more memory intensive then the above two options. |
All times are GMT -5. The time now is 10:29 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.