[Link].
com
Skip to content
Board index ‹ PHPMaker ‹ General Discussion (PHPMaker)
Change font size
Print view
FAQ
Register
Login
ListOptions_Rendered: Error in my SELECT statement
Post a reply
7 posts • Page 1 of 1
ListOptions_Rendered: Error in my SELECT statement
by mpol_ch » Sat Nov 01, 2014 9:30 pm
Hello
I am using the following code to get two values to be shown. When I visit the table for first time then
everything is fine, But when i reload the table or move the the next page then I am receiving the following
error:
"Failed to execute SQL. Error: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '' at line 1"
Where should I check?
thanks
Mpol_ch
function ListOptions_Rendered() {
// Example:
$BasisWert=ew_ExecuteScalar("SELECT Basis FROM abzugview WHERE Id=".$this->Id->CurrentValue);
$AbzugsWert=ew_ExecuteScalar("SELECT Abzug FROM abzugview WHERE Id=".$this->Id-
>CurrentValue);
$this->ListOptions->Items["basis"]->Body = $BasisWert;
$this->ListOptions->Items["abzug"]->Body = $AbzugsWert;
}
mpol_ch
Posts: 620
Joined: Mon Nov 26, 2012 9:56 pm
Top
Re: ListOptions_Rendered: Error in my SELECT statement
by mobhar » Mon Nov 03, 2014 10:18 am
Try this:
if ($this->Id->CurrentValue <> "") {
$BasisWert=ew_ExecuteScalar("SELECT Basis FROM abzugview WHERE Id=".$this->Id->CurrentValue);
$AbzugsWert=ew_ExecuteScalar("SELECT Abzug FROM abzugview WHERE Id=".$this->Id-
>CurrentValue);
$this->ListOptions->Items["basis"]->Body = $BasisWert;
$this->ListOptions->Items["abzug"]->Body = $AbzugsWert;
mobhar
Posts: 6313
Joined: Wed Jun 05, 2013 2:11 pm
Top
Re: ListOptions_Rendered: Error in my SELECT statement
by mpol_ch » Mon Nov 03, 2014 5:24 pm
Hello mobhar
thanks a lot for your contribution. It works now.
mpol_ch
mpol_ch
Posts: 620
Joined: Mon Nov 26, 2012 9:56 pm
Top
Re: ListOptions_Rendered: Error in my SELECT statement
by mpol_ch » Tue Nov 04, 2014 12:24 am
Hello
Is that possible to have the the aggregate (SUM) field for the both fields "basis" and "abzug"?
And how can I format them bold and align them "align-text:right"?
thanks
mpol_ch
mpol_ch
Posts: 620
Joined: Mon Nov 26, 2012 9:56 pm
Top
Re: ListOptions_Rendered: Error in my SELECT statement
by scs » Tue Nov 04, 2014 7:24 am
$BasisWert=ew_ExecuteScalar("SELECT sum(Basis) as Basic FROM abzugview WHERE Id=".$this->Id-
>CurrentValue);
$AbzugsWert=ew_ExecuteScalar("SELECT sum(Abzug) as Abzug FROM abzugview WHERE Id=".$this-
>Id->CurrentValue);
$this->fieldname->CellAttrs["style"] = "font-weight: bold; text-align: right;";
scs
Posts: 495
Joined: Fri Jan 04, 2013 9:37 pm
Top
Re: ListOptions_Rendered: Error in my SELECT statement
by mpol_ch » Tue Nov 04, 2014 5:08 pm
hello scs
thanks for your contribution. The format part is OK. But what I meant with Aggretagation SUM was "How
can I get the SUM of each row at the button of each view like in PHPMAKER List Page->Aggragate->Total
Right now I am getting the result per Row in the list page...
thanks any way for your support.
mpol_ch
mpol_ch
Posts: 620
Joined: Mon Nov 26, 2012 9:56 pm
Top
Re: ListOptions_Rendered: Error in my SELECT statement
by mobhar » Wed Nov 05, 2014 12:33 pm
Similar to this post: [Link]?f=4&t=26923&p=103838#p103838
mobhar
Posts: 6313
Joined: Wed Jun 05, 2013 2:11 pm
Top
Display posts from previous: All posts Sort by Post time Ascending Go
Post a reply
7 posts • Page 1 of 1
Return to General Discussion (PHPMaker)
Board index
Delete all board cookies • All times are UTC + 8 hours
Powered by phpBB® Forum Software © phpBB Group