kev1n wrote:This is what it should look like:
- Code: Select all
SELECT * FROM Channels
WHERE
((Word = '#nuBrowseTitle0_dropdown#' AND LOCATE('#', '#nuBrowseTitle0_dropdown#') <> 1 )
OR '#nuBrowseTitle0_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle0_dropdown#') = 1)
AND
((Type = '#nuBrowseTitle1_dropdown#' AND LOCATE('#', '#nuBrowseTitle1_dropdown#') <> 1 )
OR '#nuBrowseTitle1_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle1_dropdown#') = 1)
Note that there is no final semicolon (;)
kev1n wrote:Can you upload a picture of your table title names (of the Browse screen)?
var data3 = ["", "input", "word", "image"]; // static values to be added to the dropdown
addBrowseTitleDropDown(3, data3);
var data4 = ["", "text", "nuDate", "nuScroll"]; // static values to be added to the dropdown
addBrowseTitleDropDown(4, data4);
((word = '#nuBrowseTitle3_dropdown#' AND LOCATE('#', '#nuBrowseTitle3_dropdown#') <> 1 )
OR '#nuBrowseTitle3_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle3_dropdown#') = 1)
AND
((number = '#nuBrowseTitle4_dropdown#' AND LOCATE('#', '#nuBrowseTitle4_dropdown#') <> 1 )
OR '#nuBrowseTitle4_dropdown#' = '' OR LOCATE('#', '#nuBrowseTitle4_dropdown#') = 1
Alohajoe5 wrote:Yep. It's working great with the static values! Column/indexes all written correctly. This appears to be the same javascript for the static values though. How would I go about dynamically populating that list with unique values from the column?
function sqlWords() {
return "SELECT DISTINCT word FROM Channels";
}
function getBase64JsonDTString($sql) {
$result = nuRunQuery($sql);
$a = array();
while ($row = db_fetch_row($result)) {
$a[] = $row;
}
return base64_encode(json_encode( $a ));
}
$w = getBase64JsonDTString(sqlWords());
$js = "
function getWords() {
return atob('$w');
}
";
nuAddJavascript($js);
var data3 = JSON.parse(getWords());
addBrowseTitleDropDown(3,data3);