robeh
Posts: 17
|
| Posted: 09/18/2007, 6:23 PM |
|
I'm having a weird problem in that my editable grid won't display all the fields in a search. The Where clause is custom in BeforeBuildSelect, and I'm pretty sure it's correct because I printed out the result, and tried it in PhpMyAdmin. But the only fields that get displayed are the parsha and Kohen fields. The correct number of rows get displayed, I just get "Select Value" for all the other fields. Any idea how to fix this? For what it's worth, here's my custom code:
$cyear = CCGetFromGet("s_year", 0);
if ($cyear != 0)
{
$LeiningSchedule->ds->Where = "year = ".$cyear;
}
$cparsha = CCGetFromGet("s_parsha", "");
if ($cparsha != "")
{
if ($LeiningSchedule->ds->Where != "")
$LeiningSchedule->ds->Where .= " AND ";
if (strstr($cparsha, "Shmini") == "")
$LeiningSchedule->ds->Where .= "BINARY parsha like '%".$cparsha."%'";
else if ((strstr($cparsha, "Shmini") != "") && (strstr($cparsha, "Atzeret") != ""))
$LeiningSchedule->ds->Where .= "BINARY parsha like '%Atzeret%'";
else if ((strstr($cparsha, "Shmini") != "") && (strstr($cparsha, "Atzeret") == ""))
$LeiningSchedule->ds->Where .= "BINARY parsha like '%Shmini%' AND BINARY parsha NOT like '%Atzeret%' AND BINARY parsha NOT like '%Pesach%'";
}
$cleiner = CCGetFromGet("s_Leiner", "");
if ($cleiner != "")
{
if ($LeiningSchedule->ds->Where != "")
$LeiningSchedule->ds->Where .= " AND ";
$LeiningSchedule->ds->Where .= "(Kohen = '".$cleiner."' OR Levi = '".$cleiner."' OR Shlishi = '".$cleiner."' OR Revii = '".$cleiner."' OR Chamishi = '".$cleiner."' OR Shishi = '".$cleiner."' OR Shvii = '".$cleiner."' OR Maftir = '".$cleiner."')";
}
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 09/19/2007, 8:35 AM |
|
You WHERE is in the BeforeBuildSelect.
If you comment this outt, so it is not executed, will there still be result rows?
And if there are result rows, is your grid now displaying all fields correctly?
If not, then it must be in the Visual Query Builder:
Make sure that the FIELDS in VQB (the select part) have all the original names!
Make the alias column of the SELECT to be the names used in the grid.
Situation:
Suppose building the grid through the wizzard on tableX.
The VQB will have SELECT *, and all fields are selected. the grid is generated having the original fieldnames as bound value.
Then we go back into VQB and make a relation (JOIN), the field names will now be tablex.fieldname, so there is a discrepancy between the VQB fieldnames and the grid's fieldnames.
The soulution is in providing 'alias'es in VQB.
simply look at the select pane in VQB and give each used field an alias like this:
tablex.field1 alias field1
Hope this helps, explains and solves your problem.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
DonP
|
| Posted: 09/19/2007, 2:52 PM |
|
Could it be something as simple has having the wrong Data Type set for the
field in your grid? For example, if it's set to Integer when the field
contains text, it will not show.
DonP
"robeh" <robeh@forum.codecharge> wrote in message
news:546f07a2856a55@news.codecharge.com...
> I'm having a weird problem in that my editable grid won't display all the
> fields
> in a search. The Where clause is custom in BeforeBuildSelect, and I'm
> pretty
> sure it's correct because I printed out the result, and tried it in
> PhpMyAdmin.
> But the only fields that get displayed are the parsha and Kohen fields.
> The
> correct number of rows get displayed, I just get "Select Value" for all
> the
> other fields. Any idea how to fix this? For what it's worth, here's my
> custom
> code:
>
> $cyear = CCGetFromGet("s_year", 0);
> if ($cyear != 0)
> {
> $LeiningSchedule->ds->Where = "year = ".$cyear;
> }
> $cparsha = CCGetFromGet("s_parsha", "");
> if ($cparsha != "")
> {
> if ($LeiningSchedule->ds->Where != "")
> $LeiningSchedule->ds->Where .= " AND ";
> if (strstr($cparsha, "Shmini") == "")
> $LeiningSchedule->ds->Where .= "BINARY parsha like '%".$cparsha."%'";
> else if ((strstr($cparsha, "Shmini") != "") && (strstr($cparsha,
> "Atzeret")
> != ""))
> $LeiningSchedule->ds->Where .= "BINARY parsha like '%Atzeret%'";
> else if ((strstr($cparsha, "Shmini") != "") && (strstr($cparsha,
> "Atzeret")
> == ""))
> $LeiningSchedule->ds->Where .= "BINARY parsha like '%Shmini%' AND BINARY
> parsha NOT like '%Atzeret%' AND BINARY parsha NOT like '%Pesach%'";
> }
> $cleiner = CCGetFromGet("s_Leiner", "");
> if ($cleiner != "")
> {
> if ($LeiningSchedule->ds->Where != "")
> $LeiningSchedule->ds->Where .= " AND ";
> $LeiningSchedule->ds->Where .= "(Kohen = '".$cleiner."' OR Levi =
> '".$cleiner."' OR Shlishi = '".$cleiner."' OR Revii = '".$cleiner."' OR
> Chamishi
> = '".$cleiner."' OR Shishi = '".$cleiner."' OR Shvii = '".$cleiner."' OR
> Maftir
> = '".$cleiner."')";
> }
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
|