Forums

DB Read instructions

Fogg 22 Mar, 2015
Hi,

I am trying to use the DB Read function to get data from a table into a form, however it doesn't seem to be working.

I have configured the DB Read function with the following conditions:

<?php
return array('minPrice' => $form->data['minPrice']);
return array('maxPrice' => $form->data['maxPrice']);
return array('bedrooms' => $form->data['bedrooms']);
?>

In my form a hidden fields with ID's minPrice, maxPrice and bedrooms but they don't seem to be updating from the database.

Any thoughts/hints as to what I am doing wrong??
GreyHead 22 Mar, 2015
Hi Fogg,

Please see this FAQ and check the section 'To use AND'.

Bob
Fogg 23 Mar, 2015
Hi Bob,

Thanks for the quick response, I have made the changes as outlined in the FAQ you gave me.

Unfortunately I still cannot get it to work.

Screen shots of the DB Read and the text box I would like to update from the database can be found at: http://gthomesco.co.uk/errors/

I would appreciate your thoughts as to what I am doing wrong?

Regards

Wayne Fogg
GreyHead 23 Mar, 2015
Hi Wayne,

What are you actually trying to do here? The Conditions box entry looks OK - but you have Multi set to No so you will only read one record.

Where do you have the DB Read? It will only update the Hidden values if it is in the On Load event - but then presumably the values of MinPrice, maxPrice and bedRooms aren’t set so the Conditions will all fail and you will get nothing back?

Bob
Fogg 23 Mar, 2015
Hi Bob,

I have a specific issue where I am pulling info from a third party and need to display that info in an iframe otherwise it displays outside of the website.

So I am currently saving the form data into a database and then calling joomla article that has a form within the iframe that needs to pull the data from the DB to pass onto the third party so the results are displayed in the iframe.

I have put a couple more screen shots into the folder as follows:

http://gthomesco.co.uk/errors/on_load.PNG
http://gthomesco.co.uk/errors/table.PNG

The DB Read is within the On Load section before the HTML Render.

If you need anything more please let me know.
GreyHead 23 Mar, 2015
Hi Wayne,

I'm not a lot clearer :-( Where do the values of minPrice, etc come from and what do you want them to do?

Bob

Putting a form in an article in an iFrame sounds very complex . . .
This topic is locked and no more replies can be posted.