Forum



02:39

23/05/2012

I have a select input that chooses and populates a jQgrid (#1). When a row is selected on this jQgrid (#1), a second jQgrid (#2) is populated. This is where the problem comes in. Here is the rowselect:
onSelectRow: function(id){
if(id == null)
{
id=0;
if($("#ship").jqGrid('getGridParam','records') >0 )
{
$("#ship").jqGrid('setGridParam',{url:"ship.php?uic="+id});
$("#ship").jqGrid('setCaption',"That UIC: "+id).trigger('reloadGrid');
}
}
else
{
$("#ship").jqGrid('setGridParam',{url:"ship.php?uic="+id});
$("#ship").jqGrid('setCaption',"This UIC: "+id).trigger('reloadGrid');
The file ship.php takes a 6 digit uic code and processes it via:
$uic = $_GET['uic'];
If I use this select statement in ship.php:
$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command ORDER BY $sidx $sord LIMIT $start , $limit";
it passes all the rows of data to jQgrid (#ship). If I put a where clause on my select statement like so:
$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command WHERE UIC = ".$uic." ORDER BY $sidx $sord LIMIT $start , $limit";
No rows are returned.
if I try this:
$query_rsShip = "SELECT UIC, Command_Name, Hull_Number FROM command WHERE UIC != ".$uic." ORDER BY $sidx $sord LIMIT $start , $limit";
Again, I get all the rows
Then I thought, alright, lets get all the rows and filter them separately like so:
while($row = mysql_fetch_array($rsShip,MYSQL_ASSOC)) {
$diff = strcasecmp ( $row['UIC'], $uic);
if ( $diff == 0) {
$s .= "<row id='". $row['UIC']."'>";
$s .= "<cell>". $row['UIC']."</cell>";
$s .= "<cell>". $row['Command_Name']."</cell>";
$s .= "<cell>". $row['Hull_Number']."</cell>";
No rows are returned. If I comment out the if clause, it passes all the rows of data.
I'm completely stumped. I'm not sure what else I could try
Most Users Ever Online: 715
Currently Online:
45 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66