Any luck with above request. I have the same problem. Want to create a drop down list with single record from database..
Thread Starter
wdhppr
(@wdhppr)
Ok – I have found a way that is working for me. I use the HTML code to generate the drop down <select> <form> and then use another plugin ‘php everywhere’ to insert returned value into abase shortcode. Gotta love that PHP do_shortcode() function.
Currently I have hard coded the <form> <select> <options> in my page for the dropdown. This solves my input to Drop Down for search in abase. Next step is to see if I can do what NSRS is asking.
Hi wdhppr,
Can you post your php code please ? I’m very interested to see how to interact with abase variable.
For the drop down, if you have a foreign key to a table with the list you want in drop down, you simply have to tell it in the shortcode.
Example :
You have a table contact with a id_title (that is a foreign key to the primary key on title table) and title table has just the key + title
If you put an update or insert form with table=”contact” elements=”name,surname,id_title|title”, [Abase] will create the dropdown list with every titles in table title for you. Very convenient because you don’t have to hard code anything
Stephane
Me too!
Can you please post PHP Code??
Hi wdhppr, can you tell us how you insert returned value into abase shortcode? Will be pleasure for answer
Thread Starter
wdhppr
(@wdhppr)
Ok – Sorry been out of it for a while but to embed PHP in my abase page I installed the PHP Anywhere Plugin. This allowed me to embed my own PHP code into my page:
<?php
echo ‘<h2>Department: ‘;
$dept=$_POST[‘Department’];
echo $dept;
echo ‘</h2>
‘;
echo do_shortcode( “[abase table=’krmcconnect’ columns=’Firstname,Lastname,Title,Telephone,Extension,email’ where=’Department LIKE \”%$dept%\”‘ order=’Lastname’ limit=300]”);
?>
do_shortcode in the PHP (https://codex.wordpress.org/Function_Reference/do_shortcode) lets me take the posted selection into the abase shortcode.
Hello wdhppr! I’m trying to do somethink but it still don’t work/ can you help me?
<?php
echo ‘<h2>Область: ‘;
$obl=$_POST[‘Область’];
echo $obl;
echo ‘</h2>’;
echo do_shortcode(‘[abase form=”1,search” table=”Refery” columns=”ID,Фамилия,Категория$Поиск” elements=”ID,Фамилия,Категория”
where=”Область LIKE “$obl””]’);
?>