MySQL Forums
Forum List  »  German

SUM($Variable)
Posted by: Herbert Wolf
Date: October 01, 2016 05:35AM

Guten Tag
Ich komme über ein simples Problem nicht hinweg und hoffe auf Hilfe.
Ich versuche mittels einer Variablen zu summieren.

$value = "Sortea"
Also: $sql = "SELECT DISTINCT Farbe, Artikel, SUM(".$value.") AS Posten
FROM ...

Also: $sql = "SELECT DISTINCT Farbe, Artikel, SUM(Sortea) AS Posten
FROM ... liefert mir das Ergebnis, ich kann aber nur eine Variable aus einer Schleife einsetzen

Ich habe schon alle möglichen Schreibweisen versucht: SUM('".$value."'),SUM(.$value.), ich bekomme einfach keine Ergebnis und auch keine Fehlermeldung.

Ich hoffe, es kann mich jemand über meinen Fehler aufklären.

Options: ReplyQuote


Subject
Views
Written By
Posted
SUM($Variable)
1020
October 01, 2016 05:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.