Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Dostanie sie do obiektu
koniol2
post
Post #1





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 27.08.2010

Ostrzeżenie: (0%)
-----


Kod
$stmt = $dbh->prepare("SELECT zapisy.id,zapisy.imie,zapisy.nazwisko,miasto,klub,plci.plec,zapisy.id FROM zapisy,plci WHERE zapisy.plec = plci.id LIMIT $limit,$offset");
    
    $stmt->execute();
    $result = $stmt->fetchAll(PDO::FETCH_OBJ);
    return $result;


w wyniku dostaje objec


Kod
array (size=10)
  0 =>
    object(stdClass)[3]
      public 'id' => string '1' (length=1)
      public 'imie' => string 'asdas' (length=5)
      public 'nazwisko' => string 'aaaaaaaaaaaaaaa' (length=15)
      public 'miasto' => string 'asd' (length=3)
      public 'klub' => null
      public 'plec' => string 'Kobieta' (length=7)
  1 =>
    object(stdClass)[4]
      public 'id' => string '2' (length=1)
      public 'imie' => string 's' (length=1)
      public 'nazwisko' => string 'd' (length=1)
      public 'miasto' => string 'dddd' (length=4)
      public 'klub' => string 'ddd' (length=3)
      public 'plec' => string 'Kobieta' (length=7)
  2 =>


jak sie dostac do id kazdego obiektu
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 01:19