Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mysql Ergebnisse in ein Array schreiben.

Empfohlene Antworten

Veröffentlicht

Guten Tag, ich habe ein Problem.

Ich habe folgende MySQL Abfrage:

$sel = "SELECT Organisationseinheit.Organisation, Prozesse.PROZ_ID AS Prozess_ID, Prozesse.Prozessname, Sum( ProzLeistungsDaten.Eingang ) AS Summe, ProzLeistungsDaten.DatumJJWW

FROM Organisationseinheit

INNER JOIN (

Prozesse

INNER JOIN ProzLeistungsDaten ON Prozesse.PROZ_ID = ProzLeistungsDaten.PROZ_ID

) ON Organisationseinheit.Org_ID = Prozesse.Organisatinseinheit

WHERE (

(

(

Prozesse.PROZ_ID

) NOT

IN ( 58, 60, 61, 65, 66, 67, 68, 73, 74, 75, 76, 78, 79, 81, 147, 148, 149, 150, 151 )

)

)

AND Organisationseinheit.Org_ID = 2

GROUP BY Organisationseinheit.Organisation, Prozesse.Prozessname, ProzLeistungsDaten.DatumJJWW

HAVING ProzLeistungsDaten.DatumJJWW LIKE '0524'";

$query = mysql_query ("$sel");

while ($result = mysql_fetch_array($query,MYSQL_ASSOC))

{

$summen = array( $result[Prozess_ID] => $result[summe] );

}

Leider schreibt er die Werte nicht in das Array hinein und ich bekomme eine leere Seite zurück, wenn ich z.B. eingebe:

echo $summen[15];

für die Summe der Prozess-ID 15.

Kann mir da jemand helfen?

while ($result = mysql_fetch_array($query,MYSQL_ASSOC))

{

$summen = array( $result[Prozess_ID] => $result[summe] );

}

Versuche es mal so:


$summen = array();
while ($result = mysql_fetch_array($query,MYSQL_ASSOC)) {
$summen[$result['Prozess_ID']] = $result['Summe'];
}
[/PHP]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.