Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]mysql_fetch_array()
meehow18
post
Post #1





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 10.01.2010

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


Siemka mam taki bład

mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 11

a to mój skrypt.

  1. <?php
  2.  
  3. include ('config.php');
  4.  
  5.  
  6.  
  7.  
  8. $test= $_GET['kod'];
  9.  
  10. $result=mysql_query("SELECT * FROM premium WHERE kod == $test");
  11. $dane=mysql_fetch_array($result);
  12.  
  13. if($dane) {
  14. echo 'kod istnieje';
  15. }


Ten post edytował meehow18 26.07.2010, 11:42:53
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
meehow18
post
Post #2





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 10.01.2010

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


  1. $sql = "SELECT * FROM premium WHERE kod = $test";
  2. echo 'ZAPYTANIE:'.$sql;
  3. mysql_query($sql) or die('BŁĄD:'.mysql_error());


poprawiłem na =
i
ZAPYTANIE:SELECT * FROM premium WHERE kod = BŁĽD:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Ten post edytował meehow18 26.07.2010, 12:48:03
Go to the top of the page
+Quote Post

Posty w temacie


Closed TopicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 04:44