You are not logged in.

Discussion

Mehrere DIV Container mit AJAX aktualisieren

1

Sunday, June 13th 2010, 3:55pm

so gehts mit while

Naja, mit while geht das so:

PHP Quellcode

1
2
3
4
5
6
7
8
9
function getTextMYSQL($identfier) {
	$sql = "SELECT * FROM mitglieder ORDER BY userid DESC LIMIT 0,2";
	$res = mysql_query($sql);
	$text = "";
	while($row = mysql_fetch_array($res)) {
		$text .= '<a href="'.$row['userid'].'">'.$row['username'].'</a>';
	}
	return $text;
}
  • Go to the top of the page

2

Thursday, June 10th 2010, 1:51pm

Whileabfrage

Wie kriege ich denn jetzt eine DB Abfrage in der callback.php hin mit ner while abfrage... das klappt bei mir nicht..

Also will anstatt

Source code

1
2
3
4
              $sql = "SELECT * FROM mitglieder ORDER BY RAND() LIMIT 0,2";
        $res = mysql_query($sql);
        $row = mysql_fetch_array($res);
        return 'Username:'.$row['username'];


mit while arbeiten also die letzten 10 user ausgeben

das klappt aber leider nicht

mfg
  • Go to the top of the page

3

Sunday, March 7th 2010, 1:40pm

Beispiele

Ich habe Beispiele für MySQL ergänzt.
  • Go to the top of the page

4

Saturday, March 6th 2010, 12:37pm

top

top erklährt ;)
nur eins noch: wie sieht die callback aus, wenn ichs aus der datenbank hole?


alla "SELECT * FROM ... WHERE name = update1"; oder wie?

da steig ich noch ned ganz durch

gruß adi
  • Go to the top of the page

Lexikon 4.1.3, developed by www.viecode.com