Guten Abend,
es ist schon sehr lange her, als ich das letzte mal mit PHP programmiert habe. Und wie der Anfang immer so ist, stehe ich wieder auf dem Schlauch. Bin gerade dabei mir ein Lagerverwaltungsprogramm zu schreiben.
Mein Ziel ist die Erstellung von assoziierte Arrays deren Inhalte aus einer MySQL Tabelle aufgefüllt werden.
Mein genaueres Problem ist die mysql_query bzw. die while-Schleife (while($row = mysql_fetch_array($result)){...}
), die die Anfrage in ein Array sammelt. Ich weiß nicht ob fetch_array der richtige Weg ist.
Ich kann mich noch zu meinen Programmierzeiten in C daran erinnern, dass man dort die arrays so array[][] assoziieren konnte. Gibt es sowas auch in PHP?
Vielleicht etwas zu viel, aber hier der Code abschnitt wo ich es einbauen möchte:
[code lang=html<div id="content">
<div class="style_5">
Neu Kommissionierung
</div>
<div class="style_6" >
<table cellspacing="0" cellpadding="0" border="0">
<tr bgcolor="#E5E5E5">
<td width="10px" height="20px" align="left"> </td>
<td width="120px" height="20px" align="left"><b>Artikel-Nr.</b></td>
<td width="300px" height="20px" align="left"><b>Artikelbeschreibung</b></td>
<td width="50px" height="20px" align="center"><b>€ / St.</b></td>
<td width="80px" height="20px" align="right"><b>Bestand</b></td>
<td width="50px" height="20px" align="right"> </td>
<td width="150px" height="20px" align="left"><b>Kommissionierung</b></td>
</tr>
<tr>
<td width="10px" height="20px" align="left" valign="top"> </td>
<td width="120px" height="20px" align="left" valign="top">
<select style="width:120px;" name="select1">
<option>Art.-Nr. auswählen</option>
<option value="item1">Artikel-Nr.: aus der MySQL Tabelle ca. 60 Art-Nr.:</option>
<option value="...">...</option>
</select>
</td>
<td width="300px" height="20px" align="left" valign="top"><?PHP echo"die passende Artikelbeschreibung aus der MySQL-Tabelle"; ?></td>
<td width="50px" height="20px" align="center" valign="top"><?PHP echo"der passender Preis aus der MySQL-Tabelle"; ?></td>
<td width="80px" height="20px" align="right" valign="top"><?PHP echo"der passender Bestand aus der MySQL-Tabelle"; ?></td>
<td width="50px" height="20px" align="right" valign="top"> </td>
<td width="150px" height="20px" align="left" valign="top"><input type="text" name="komm1_bis_num_rows_der_mysql_abfrage" /></td>
</tr>
</table>
</div>
</div>[/code]
Wünsche allen noch ein schönen Abend noch.