Simon: MySQL - Problem beim Auslesen - kompliziert

Beitrag lesen

Hi,

$abfrage2 = "SELECT text FROM tabelle LIMIT $row, 3";

sorry, ich hatte da die variablen nochmal umbenannt.

das sollte $row1 heissen.

hier nochmal neu:
 _____________________
 | id | name  | text  |
 _____________________|
 | 1  | name1 | text1 |
 ---------------------|
 | 2  | name2 | text2 |
 ---------------------|
 | 3  | name3 | text3 |
 ---------------------|
 | 4  | name4 | text4 |
 ---------------------|
 | 5  | name5 | text5 |
 ---------------------|
 | 6  | name6 | text6 |
 ---------------------|

<?
//HIER DIE MYSQL-VERBINDUNG

mysql_connect("localhost","user","passwort") or die ("Keine Verbindung moeglich");
mysql_select_db("usrdb_kontadbi_linkleser") or die ("Die Datenbank existiert nicht");

//AB HIER WIRD NACH EINER id GESUCHT, DIE ZU name2 GEHÖRT
//DAS WÄRE DANN LAUT TABELLE id=2

$abfrage1  = "SELECT id FROM tabelle WHERE name='name2'";
$ergebnis1 = mysql_query($abfrage1);
while($row1 = mysql_fetch_object($ergebnis1))
{
echo $row1->id;
}

//AB HIER SOLLEN AB DER ZEILE MIT  HILFE VON id=2 DIE NÄCHSTEN 3 text
//AUSGEGEBEN WERDEN - DAS SIND text3 , text4 UND text5

$abfrage2 = "SELECT text FROM tabelle LIMIT $row1, 3";
$ergebnis2 = mysql_query($abfrage2);
while($row2 = mysql_fetch_object($ergebnis2))
{
echo $row2->text;
}
?>

Hoffentlich machen es die Kommentare verständlicher ?! x)