Forums

I seem to be broken... Why can't I get DB Read to work?

bugeyedcreepy 10 Jan, 2016
So, I've struggled with this for a couple of weeks now, too proud to ask for help but hopefully I'm not beyond redemption...

I can't seem to get something as simple as populating a dropdown list from an external database to work! To wit, I've tried everything I can think of to get it to work, have tried a number of examples from almost every corner of the web but it doesn't seem to work. I've looked at innumerable posts about various versions of various examples, none seem to fit my issue. The debugger I've saved into the form shows it working to a point, complete with a dbase query that perplexingly, asks for only NULL examples of the primary key field for the table that has my data in it.... Why is it doing that? The Query works perfect when run in mysql without the "WHERE 'events'.'eventid' IS NULL" clause on the end, so is this my problem? If so, how do I get MrStupidForm to stop asking for NULL examples from the primary key field??

To be honest, I don't know the relevance of the various php statements plugged into the required cubbyholes in the Chronoforms config and there's nothing anywhere that explains it, nor the relevance to the exact syntax I ought to be using... I'm just driving by google search results now. 😟

Debug:

Data Array

Array
(
    [option] => com_chronoforms5
    [chronoform] => Attendees
    [events] => Array
        (
        )

)

Array
(
)

Errors

Array
(
)

Debug Info

Array
(
    [1] => Array
        (
            [DB Read] => Array
                (
                    [Queries] => Array
                        (
                            [0] => SELECT `events`.`eventid` AS `events.eventid`, `events`.`eventName` AS `events.eventName` FROM `tsvevents` AS `events` WHERE `events`.`eventid` IS NULL
                        )

                )

        )

)
GreyHead 10 Jan, 2016
1 Likes
Hi bugeyedcreepy,

Please see this FAQ

Please put just events in the Data Path box of the element - this should be the same as the Model ID in the DB Read action.

Please set the DB Read to Multi Read Yes as you want multiple results.

Please remove the code you have in the Conditions box - unless you have a value set somehow and want to filter the events listed.

Bob
bugeyedcreepy 10 Jan, 2016
.... GreyHead, If you were a Beautiful, Voluptuous Blonde single lady, I'd marry you! Unfortunately, you aren't such a lady so you'll just have to settle for a coffee or two instead...

Thanks Heaps!

:D
This topic is locked and no more replies can be posted.