Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 09.09.06 14:07 
ausblenden Quelltext
1:
2:
3:
$query = mysql_query("SELECT * FROM user WHERE name='$name' AND password='".SHA1($password)."'");
if (mysql_num_rows($query) > 0) {
  $id =

id ist ein Feld in der Tabelle "user". Wie komm ich nun an den Wert? Gibt es was anderes als das hier:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
$query = mysql_query("SELECT * FROM user WHERE name='$name' AND password='".SHA1($password)."'");
if (mysql_num_rows($query) > 0) {
  while ($assoc = mysql_fetch_assoc($query)) {
         $id = $assoc['id'];
  }
}

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
wunsiedler
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 506
Erhaltene Danke: 4

Win7

BeitragVerfasst: Sa 09.09.06 14:54 
ausblenden Quelltext
1:
2:
while($row = mysql_fetch_array($result)) 
    echo $row['id'];

oder
ausblenden Quelltext
1:
2:
while ($row = mysql_fetch_object ($result)) 
    echo $row -> id;


kommt überall das gleicher heraus, ist halt nur eine andere schreibweise.

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Moderiert von user profile iconKlabautermann: Delphi-Tags durch Code-Tags ersetzt ;)
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 09.09.06 14:58 
Ok danke.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot