Lookup Table Error

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
skyking
User
Posts: 37

Lookup Table Error

Post by skyking »

I have a table that is using three lookup tables to populate three fields each set as Select in Edit.

When I click on the daoid field pulldown I get the error: Lookup.php(268): Call to a member function getRecordCount() on null

With Debug on, when I load the default daoactivitylist page, debug shows this:

sql: SELECT COUNT(*) FROM recip-name
28 records in it.
sql: SELECT secure AS lf, recip-name AS df, '' AS df2, '' AS df3, '' AS df4 FROM recip-name

sql: SELECT COUNT(*) FROM guilds

sql: SELECT guildid AS lf, guild AS df, '' AS df2, '' AS df3, '' AS df4 FROM guilds

That is two of the three lookup tables. The third lookup table dao-names is not getting used in list or add (and I assume edit and view too)

Why is this lookup table not getting called? It is setup like the other two lookup tables and there are 28 records in it.


arbei
User
Posts: 9382

Post by arbei »

skyking wrote:

I get the error: Lookup.php(268): Call to a member function getRecordCount() on null

That means the table object is not found, make sure you use v2023.8 and have selected the lookup table to generate.


skyking
User
Posts: 37

Post by skyking »

I upgraded to .8

I removed all three lookup tables and no errors, can search, list, edit.

I can add back the guildid field lookup table guilds with link field guildid and display field guild and still no errors

If I then add back the daoid field lookup table dao-names with link field daoid and display field dao-name I can do search but list throws error:

PDO::query(): Argument #1 ($query) cannot be empty

It is not processing SQL queries to the dao-names table correctly it appears. dao-names has 28 records and a manual SQL SELECT query works fine.

I tied using a different lookup table for field daoid and it worked fine, no errors.

When I change it back to the dao-names lookup table it doesn't get queried and fails.


skyking
User
Posts: 37

Post by skyking »

Noticed this in the error display under Sessions:

daocontrib_MySqlEngines Array ( [DB] => Array ( [recip-name] => 1 [dao-activity] => 1 [guilds] => 1 ) )

Notice the lookup table dao-names is missing

recip-name is a separate published table, dao-activity is a published table, guilds is a lookup table


skyking
User
Posts: 37

Post by skyking »

dao-names is not a published table.


arbei
User
Posts: 9382

Post by arbei »

skyking wrote:

dao-names is not a published table.

arbei wrote:

make sure you ... have selected the lookup table to generate.

You still need to generate the <LookupTable>.php even the table is not used for List/View, etc..


skyking
User
Posts: 37

Post by skyking »

Thank you very much for that suggestion.

I generated the dao_names.php and it's now included in the SQL queries and populates the daoid field pulldown.


Post Reply