database

Permalink Browser Info Environment
Is there a way to interact with the database ? As exemple, i'd like to search into the database some elements for feeding fields created with Block Designer, or add new elements in the database using Blck Designer.

Type: Pre-Sale
Status: Resolved
crostif
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

I'm not sure what you mean. Can you give a "working" example or some scenario what steps you want to take?

Kind regards,

Ramon
crostif replied on at Permalink Reply
crostif
OK. Let's take an exemple.
I have a database table named "plants". It contain these columns : id, name, family. This table contains some 4000 rows and i want interact with it using a block created by block designer.
1- I'd like to create a block which would look into the table for searching and modifying plants throughout a form
2- I'd like to create a block which would add a plant in the table.
Php code can be added in Blck designer, but how can i link fields to the code ?
ramonleenders replied on at Permalink Reply
ramonleenders
Have you seen this video?

https://www.youtube.com/watch?v=A2sY1NUA3-E...

If you just build the complete Block as you want it using Block Designer (+ Pro), you can then copy the table name of the table created by Block Designer and rename the table of all the plants you have to the copied table name?

Let's say you have a table called "myPlants". Block Designer will created something like "btPlantsPlantEntries". Rename your myPlants to btPlantsPlantEntries. Make sure you used the same column names though, or alter your column names in YOUR existing table (myPlants). Does that make sense, or do you want to do something more complicated?

If I'm not understanding your complete question, you could try with some screenshots too.

concrete5 Environment Information

# concrete5 Version
Core Version - 5.7.4.2
Version Installed - 5.7.4.2
Database Version - 20150504000000

# concrete5 Packages
Ajax Page List (0.9), Block Designer (1.2.3), C5DK TwentyTwenty Image (1.0.1), File Reader (2.0.1), Fruitful (1.2), HTML+PHP Code Block (1.0.0), Package Designer (0.9.0), PDF Viewer (1.0.1), Responsive Embed (1.0.0), Vivid Carousel (1.0.1), Zoomer (1.0.1).

# concrete5 Overrides
blocks/testbd/controller.php, blocks/testbd/composer.php, blocks/testbd/icon.png, blocks/testbd/view.php, blocks/testbd/config.json, blocks/testbd/form.php, blocks/testbd/add.php, blocks/testbd/edit.php, blocks/testbd/db.xml, blocks/testbd, blocks/test/form.php, blocks/test/config.json, blocks/test/composer.php, blocks/test/edit.php, blocks/test/db.xml, blocks/test/add.php, blocks/test/icon.png, blocks/test/controller.php, blocks/test/view.php, blocks/test, blocks/arboretum_liste_plante/form.php, blocks/arboretum_liste_plante/composer.php, blocks/arboretum_liste_plante/controller.php, blocks/arboretum_liste_plante/config.json, blocks/arboretum_liste_plante/edit.php, blocks/arboretum_liste_plante/view.php, blocks/arboretum_liste_plante/db.xml, blocks/arboretum_liste_plante/icon.png, blocks/arboretum_liste_plante/add.php, blocks/arboretum_liste_plante, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/sl_SI/LC_MESSAGES/messages.mo, languages/sl_SI/LC_MESSAGES, languages/sl_SI, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, blocks/testbd/controller.php, blocks/testbd/composer.php, blocks/testbd/icon.png, blocks/testbd/view.php, blocks/testbd/config.json, blocks/testbd/form.php, blocks/testbd/add.php, blocks/testbd/edit.php, blocks/testbd/db.xml, blocks/testbd, blocks/test/form.php, blocks/test/config.json, blocks/test/composer.php, blocks/test/edit.php, blocks/test/db.xml, blocks/test/add.php, blocks/test/icon.png, blocks/test/controller.php, blocks/test/view.php, blocks/test, blocks/arboretum_liste_plante/form.php, blocks/arboretum_liste_plante/composer.php, blocks/arboretum_liste_plante/controller.php, blocks/arboretum_liste_plante/config.json, blocks/arboretum_liste_plante/edit.php, blocks/arboretum_liste_plante/view.php, blocks/arboretum_liste_plante/db.xml, blocks/arboretum_liste_plante/icon.png, blocks/arboretum_liste_plante/add.php, blocks/arboretum_liste_plante, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/sl_SI/LC_MESSAGES/messages.mo, languages/sl_SI/LC_MESSAGES, languages/sl_SI, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
fpm-fcgi

# PHP Version
5.5.22

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, ionCube Loader, json, libxml, mbstring, mcrypt, memcache, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib.

# PHP Settings
max_execution_time - 300
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - -1
max_input_vars - 16000
memory_limit - 512M
post_max_size - 64M
sql.safe_mode - Off
upload_max_filesize - 64M
memcache.max_failover_attempts - 20
mysql.max_links - Unlimited
mysql.max_persistent - 0
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 1440
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 32000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.