Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]problem z mysqli, Wyrzuca błąd
gajek87
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 22.02.2005

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


Witam, mam problem z mysqli wyrzuca mi błąd i nie wiem czemu :/ na starym serwerze działało, na nowym jest błąd:

Warning: mysqli_errno() expects exactly 1 parameter, 0 given in D:\WebServ\httpd\mr\api\getname.php on line 18

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in D:\WebServ\httpd\mr\api\getname.php on line 22

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\WebServ\httpd\mr\api\getname.php on line 24

  1. <?php
  2.  
  3. $ref = $_GET["ref"];
  4.  
  5.  
  6.  
  7. $con = mysqli_connect("localhost", "login", "haslo", "baza");
  8. // Check connection
  9. if (mysqli_connect_errno()) {
  10. echo "Błąd połączenia z MySQL: " . mysqli_connect_error() . " skontaktuj się z informatyką.";
  11. }
  12.  
  13. mysqli_set_charset($con, "utf8");
  14.  
  15. $sql = "SELECT nazwa FROM referencje WHERE referencja = ".$ref.";";
  16. $result = mysqli_query($con, $sql);
  17.  
  18. if (mysqli_errno()) {
  19. echo "Błąd zapytania MySQL: " . mysqli_error() . " skontaktuj się z informatyką.";
  20. }
  21.  
  22. $row_cnt = mysqli_num_rows($result);
  23.  
  24. while ($result = mysqli_fetch_array($result)) {
  25. echo $result["nazwa"];
  26. }
  27.  
  28.  
  29. echo $row_cnt;
  30.  
  31.  
  32.  
  33. ?>


Ten post edytował gajek87 28.05.2015, 12:08:52
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 - 20:52