Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]problem z tablicami
kalit
post
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 1
Dołączył: 22.02.2009
Skąd: Pomorze : D

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


Witam. Mam taki problem a dokładnie z tym (dodam że jest to robione z pomocą Zend Framework):


  1. $profil = $show->show_user($this->_request->getParam("user"));
  2. if(is_array($profil)){
  3. $this->view->error_text = "A";
  4. }
  5. elseif($profil == 1) $this->view->error_text = "Parametr nie jest zmienną ID !!";
  6. elseif($profil == 2)$this->view->error_text = "Nie ma takiego użytkownika";
  7.  


Ciągle wyświetla mi warunek "Parametr nie jest zmienną ID exclamation.gif" chodź sprawdzam czy jest to zmienna array

Tu dodam jak wygląda funkcja show_user():


  1. public function show_user($id){
  2.  
  3. $sql_user = $this->fetchAll($this->select()->where("id = ?",$id));
  4.  
  5. if(count($sql_user) != 0){
  6. return $sql_user;
  7. }
  8. //nie ma takiego użytkonwika o tym ID
  9. else return 2;
  10. }
  11. //$id nie jest liczbą !!
  12. else return 1;
  13.  
  14. }


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 - 21:44