Multiple $_GET Variables And Dropdown List WHERE Clause

Discuss MySQL Ajax Table Editor Paid Version

Multiple $_GET Variables And Dropdown List WHERE Clause

Postby jshenn » Tue Feb 09, 2016 11:52 pm

Am trying to use a $_GET variable in my query_select to filter a dropdown list. Table displays, but when I click Add, dropdown shows values that WHERE clause = something other than $_GET variable value. Here is the code:

<script type="text/javascript">
trackHistory = false;
// Add GET Variables Here To Enable Filter Access
var ajaxUrl = '<?php echo $_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&'.$_GET["teamAId"]; ?>';
toAjaxTableEditor('update_html','')
</script>

<?php
}

function initiateEditor()
{
$tableColumns['id'] = array('display_text' => 'Id', 'perms' => 'TVQSXO');
$tableColumns['matchId'] = array('display_text' => 'MatchId', 'perms' => 'EVCTAXQSHO');
$tableColumns['teamAId'] = array('display_text' => 'TeamId', 'perms' => 'EVCTAXQSHO');

$tableColumns['playerId'] = array('display_text' => 'Player Id', 'perms' => 'EVCTAXQSHO', 'select_query' => "SELECT id, lastName FROM players WHERE teamId = '".$_GET["teamAId"]."'", 'default' => '');

$tableColumns['strike'] = array('display_text' => 'Strikes', 'perms' => 'EVCTAXQSHO');
$tableColumns['spare'] = array('display_text' => 'Spares', 'perms' => 'EVCTAXQSHO');
$tableColumns['open'] = array('display_text' => 'Opens', 'perms' => 'EVCTAXQSHO');

$tableName = 'gameResultsDev';
$primaryCol = 'id';
$errorFun = array(&$this,'logError');
$permissions = 'EAVIDQCSXHO';

$this->Editor = new AjaxTableEditor($tableName,$primaryCol,$errorFun,$permissions,$tableColumns);
$this->Editor->setConfig('tableInfo','cellpadding="1" width="1000" class="mateTable"');
$this->Editor->setConfig('orderByColumn','game','frame');
$this->Editor->setConfig('addRowTitle','Add Game Result');
$this->Editor->setConfig('editRowTitle','Edit Game Result');
// Add Filters Here Using GET Variables Included Above
$this->Editor->setConfig('sqlFilters', "matchId= '".$_GET["id"]."'");
}
jshenn
 
Posts: 3
Joined: Thu Oct 27, 2011 9:34 pm

Return to Paid Version

Who is online

Users browsing this forum: No registered users and 0 guests