issues binding a result using a recordset to populate field in a repeating table.
Using two sql tables, inventory and manufacturer
There are two fields in my manufacturer table; manufacturers id (integer) and manufacturers name (text)
Using DA ive created an insert, search and results page, based on the inventory table.
The insert page records the manufacturer id from a dynamic select, populated by a recordset using my manufacturer table as the source
The search page has a select search option populated by a recordset showing the manufacturers name in my manufacturer table.
When a user selects a manufacture name in their query, the search logic uses the manufacturer id to search the same value stored in the inventory table
In the repeating table on the results page, I have used a recordset to return the manufactuer name, not the stored ID.
The recordset for this task is configured as follows;
$rsMakeResult = new WA_MySQLi_RS("rsMakeResult",$devicesCOMM,1);
$rsMakeResult->setQuery("SELECT * FROM manufacturer WHERE manufacturer.manID=?");
$rsMakeResult->bindParam("i", "".($WADAinventory_v1->getColumnVal("mobMake")) ."", "-1"); //result
What is presenting for each record in the repeating table, is the same manufacturer.manName (text value) for each record, not the actual manufacture name present in each record.
It seems when a query is executed using the 'All' option, the recordset is not cycling past the first record in my inventory table and using the first value to populate each record returned in the search results.
(The 'all' option value = 0 in my recordset)
So im seeing "Nokia" (incorrectly) appear for every record
Its not clear to me why?
*** update ***
Penny has dropped! Resolved
I took the main recordset and edited it in the query builder by creating a join between my inventory and manufacture table.
This created a new bind in the recordset which i then selected and placed in my repeating table.