Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
Hallo!
mysql_fetch_array()
Gruss Dr Dau
PS: schaue Dir mal "PHP für dich" an, da werden ein paar Grundlagen zu PHP/MySQL erklärt.
$result = mysql_query("SELECT name FROM smilies_name");
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
$row[0];
}
echo $search = $row[0];
$names=array();
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
$names[]=$row['name'];
}
echo "<pre>";
var_dump($names);
echo "</pre>"
-> Wie kann das ein? Du speicherst eine Variable in einer Variable, beides ist kein Array. <-
Hm, noch keine Ahnung vom Umgang mit MySQL und Arrays..?!
Setz doch mal das echo in die while-Schleife, dann siehst Du, dass die Anweisung ALLE Einträge findet. Du musst natürlich in der Schleife den gefundenen Wert $row['name'] in ein weiteres Array speichern..
Nur macht es in vielen Fällen wenig Sinn, die Daten in einem separaten Array zu speichern, wo man doch schon in dieser Schleife das Eigentliche anstellen kann, wie zB Ausgabe..PHP:$names=array(); while ($row = mysql_fetch_array($result, MYSQL_NUM)) { $names[]=$row['name']; } echo "<pre>"; var_dump($names); echo "</pre>"
Zum Ansehen:
http://www.php-einfach.de/php-tutorial/php-array.php
http://www.schattenbaum.net/php/
mfg chmee
array(53) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL [4]=> NULL [5]=> NULL [6]=> NULL [7]=> NULL [8]=> NULL [9]=> NULL [10]=> NULL [11]=> NULL [12]=> NULL [13]=> NULL [14]=> NULL [15]=> NULL [16]=> NULL [17]=> NULL [18]=> NULL [19]=> NULL [20]=> NULL [21]=> NULL [22]=> NULL [23]=> NULL [24]=> NULL [25]=> NULL [26]=> NULL [27]=> NULL [28]=> NULL [29]=> NULL [30]=> NULL [31]=> NULL [32]=> NULL [33]=> NULL [34]=> NULL [35]=> NULL [36]=> NULL [37]=> NULL [38]=> NULL [39]=> NULL [40]=> NULL [41]=> NULL [42]=> NULL [43]=> NULL [44]=> NULL [45]=> NULL [46]=> NULL [47]=> NULL [48]=> NULL [49]=> NULL [50]=> NULL [51]=> NULL [52]=> NULL }
OK Danke!
aber komischerweise gibt mir das Array nur NULL aus:
Code:array(53) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL [4]=> NULL [5]=> NULL [6]=> NULL [7]=> NULL [8]=> NULL [9]=> NULL [10]=> NULL [11]=> NULL [12]=> NULL [13]=> NULL [14]=> NULL [15]=> NULL [16]=> NULL [17]=> NULL [18]=> NULL [19]=> NULL [20]=> NULL [21]=> NULL [22]=> NULL [23]=> NULL [24]=> NULL [25]=> NULL [26]=> NULL [27]=> NULL [28]=> NULL [29]=> NULL [30]=> NULL [31]=> NULL [32]=> NULL [33]=> NULL [34]=> NULL [35]=> NULL [36]=> NULL [37]=> NULL [38]=> NULL [39]=> NULL [40]=> NULL [41]=> NULL [42]=> NULL [43]=> NULL [44]=> NULL [45]=> NULL [46]=> NULL [47]=> NULL [48]=> NULL [49]=> NULL [50]=> NULL [51]=> NULL [52]=> NULL }
Die Anzahl der Inhalte (53) ist aber korrekt.
Hast Du noch eine Idee?