Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] problem z DB
shoes
post 9.07.2008, 15:46:47
Post #1





Grupa: Zarejestrowani
Postów: 50
Pomógł: 0
Dołączył: 16.05.2008

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


Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\sf_sandbox\apps\myapp\modules\mymodule\templates\zalogowanoSuccess.php on line 105

od strony:
  1. <?php
  2. $dbhost = "localhost";
  3. $dbuser = "root";
  4. $dbpassword ="krasnal";
  5. $dbdatabase = "sklep";
  6. $db = mysql_connect($dbhost, $dbuser, $dbpassword);
  7. mysql_select_db($dbdatabase, $db); 
  8. $a='wewe';
  9. $sql3 = "SELECT * FROM users WHERE Login=". $a . ";" ;
  10. $result = mysql_query($sql3);
  11. $row4 = mysql_fetch_assoc($result);
  12. if ($row4['UserId']) {
  13. echo 'coo'. $row4['UserId']. $_SESSION['dana'];
  14. ?>
Go to the top of the page
+Quote Post
nospor
post 9.07.2008, 15:47:51
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




zobacz jaki masz konretnie blad
http://nospor.pl/php-faq-n29.html#faq-6


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
kosmos
post 9.07.2008, 15:52:49
Post #3





Grupa: Zarejestrowani
Postów: 367
Pomógł: 17
Dołączył: 4.03.2008

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


Masz błąd w zapytaniu przeanalizuj ten fragment kodu.

  1. <?php
  2. $sql3 = "SELECT * FROM users WHERE Login=". $a . ";" ;
  3. ?>


@nospor
dlaczego ja nie znałem tej stronki questionmark.gif smile.gif)
Już dodana do ulubionych smile.gif

Ten post edytował kosmos 9.07.2008, 15:54:07
Go to the top of the page
+Quote Post
nevt
post 9.07.2008, 15:58:33
Post #4





Grupa: Przyjaciele php.pl
Postów: 1 595
Pomógł: 282
Dołączył: 24.09.2007
Skąd: Reda, Pomorskie.

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


może ułatwię koledze analizę i pokażę, co widzi MySQL:
  1. SELECT * FROM users WHERE Login=wewe;

EDIT: pomyłka...


--------------------

-
Oh no, my young coder. You will find that it is you who are mistaken, about a great many things... -
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 12.06.2025 - 14:47