HTML5 Data Bindings Support Product Page
Answered
How to reference database value within PHP code itself?
Asked 17 Jul 2015 01:48:44
1
has this question
17 Jul 2015 01:48:44 Windy City posted:
I'm working on a page that uses HTML5 Data Bindings for my MySQL database. How do I go about referencing/testing a database values from within PHP code itself? I see that I can use provided {{Variable}} placeholder elsewhere on the page to insert my data in HTML. But it doesn't work when I try to test database variables in PHP itself. Any help with the right coding and syntax would be great!Sorry if this is a basic question. I've worked in ASP but finally moving over to MySQL.
Replies
Replied 17 Jul 2015 07:28:27
17 Jul 2015 07:28:27 Teodor Kuduschiev replied:
Hello,
You cannot use the databindings variables inside PHP code.
DMXzone Data Bindings variables are being rendered client-side, while PHP code is being executed server-side. You cannot mix them.
You cannot use the databindings variables inside PHP code.
DMXzone Data Bindings variables are being rendered client-side, while PHP code is being executed server-side. You cannot mix them.
Replied 19 Aug 2015 07:53:22
19 Aug 2015 07:53:22 Jim Elliott replied:
I have got around this by purchasing a class "smplPDO" from CodeCanyon.net for $5. One of the best purchases ever.
It becomes as simple as:
$myvar = $db->getvar('mytable',array('filterfieldname'=>filterfieldvalue),'fieldname');
There is a load more in it as well!
It becomes as simple as:
$myvar = $db->getvar('mytable',array('filterfieldname'=>filterfieldvalue),'fieldname');
There is a load more in it as well!