Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> mysql_numrows();, Blad
andy84
post
Post #1





Grupa: Zarejestrowani
Postów: 165
Pomógł: 0
Dołączył: 14.11.2005
Skąd: London

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


witam to moj skrypt
  1. <?
  2. $username="root";
  3. $password="";
  4. $dbname="formularz";
  5. mysql_connect(localhost,$username,$password);
  6. @mysql_select_db($dbname) or die("unable to connect to database");
  7. $query="SELECT*FORM dane";
  8. $result=mysql_query($query);
  9.  
  10. $num=mysql_numrows($result);
  11.  
  12. echo "<b><center>Customer informations</center></b><br><br><br>";
  13.  
  14. $i=0;
  15. while ($i<$num){
  16. $first=mysql_result($result,$i,'first');
  17. $last=mysql_result($result,$i,'last');
  18. $email=mysql_result($result,$i,'email');
  19. $address=mysql_result($result,$i,'address');
  20. $city=mysql_result($result,$i,'city');
  21. $town=mysql_result($result,$i,'town');
  22. $zip=mysql_result($result,$i,'zip');
  23. $tel=mysql_result($result,$i,'tel');
  24. $fax=mysql_result($result,$i,'fax');
  25. $service=mysql_result($result,$i,'option');
  26. $comment=mysql_result($result,$i,'comment');
  27.  
  28. echo "$first $last<br>$email<br>$address<br>$city<br>$town<br>$zip<br>$tel<br>$fax<br>$service<br>$comment";
  29. $i++;
  30. }
  31. ?>

nie iwemczemu mysql_numrows mi wywala blad (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) jak dubluje jakis temat to przepraszam moze poprostu nie szukame dobrze
Go to the top of the page
+Quote Post
ikioloak
post
Post #2





Grupa: Zarejestrowani
Postów: 416
Pomógł: 0
Dołączył: 8.01.2004

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


bo to nie jest funkcja mysql_numrows() tylko mysql_num_rows()
Go to the top of the page
+Quote Post
andy84
post
Post #3





Grupa: Zarejestrowani
Postów: 165
Pomógł: 0
Dołączył: 14.11.2005
Skąd: London

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


Cytat(ikioloak @ 2005-11-19 11:23:12)
bo to nie jest funkcja mysql_numrows() tylko mysql_num_rows()

zmenilem to i nadal to samo (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\appserv\www\websignuk\bazawebsign\index.php on line 9

kod wyglada j/w ze zmienionym mysql_numrows na mysql_num_rows
Go to the top of the page
+Quote Post
ghostrider
post
Post #4





Grupa: Zarejestrowani
Postów: 135
Pomógł: 0
Dołączył: 30.09.2005
Skąd: k-rk

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


  1. <?php
  2. $result = mysql_query("SELCT * FROM dane");
  3.  
  4. if (!is_resource($result)) {
  5. }
  6. ?>


trzeba sprawdzac czy sie niema bledu w zapytaniu SQL.

Ten post edytował ghostrider 19.11.2005, 12:36:26
Go to the top of the page
+Quote Post
andy84
post
Post #5





Grupa: Zarejestrowani
Postów: 165
Pomógł: 0
Dołączył: 14.11.2005
Skąd: London

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


Cytat(ghostrider @ 2005-11-19 11:35:57)
  1. <?php
  2. $result = mysql_query("SELCT * FROM dane");
  3.  
  4. if (!is_resource($result)) {
  5. }
  6. ?>


trzeba sprawdzac czy sie niema bledu w zapytaniu SQL.

  1. <?
  2. $username="root";
  3. $password="";
  4. $dbname="formularz";
  5. mysql_connect(localhost,$username,$password);
  6. @mysql_select_db($dbname) or die("unable to connect to database");
  7. $query="SELECT*FORM dane";
  8. if (!is_resource($result)) {
  9. }
  10. $result=mysql_query($query);
  11. $num=mysql_num_rows($result);
  12.  
  13. echo "<b><center>Customer informations</center></b><br><br><br>";
  14.  
  15. $i=0;
  16. while ($i<$num){
  17. $first=mysql_result($result,$i,'first');
  18. $last=mysql_result($result,$i,'last');
  19. $email=mysql_result($result,$i,'email');
  20. $address=mysql_result($result,$i,'address');
  21. $city=mysql_result($result,$i,'city');
  22. $town=mysql_result($result,$i,'town');
  23. $zip=mysql_result($result,$i,'zip');
  24. $tel=mysql_result($result,$i,'tel');
  25. $fax=mysql_result($result,$i,'fax');
  26. $service=mysql_result($result,$i,'option');
  27. $comment=mysql_result($result,$i,'comment');
  28.  
  29. echo "$first $last<br>$email<br>$address<br>$city<br>$town<br>$zip<br>$tel<br>$fax<br>$service<br>$comment";
  30. $i++;
  31. }
  32. ?>

no i teraz bledow nie ma ( nie ma nic na stronie :| nie mam pojecia co jest z tym
Go to the top of the page
+Quote Post
ghostrider
post
Post #6





Grupa: Zarejestrowani
Postów: 135
Pomógł: 0
Dołączył: 30.09.2005
Skąd: k-rk

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


Cytat
  1. <?php
  2. $query="SELECT*FORM dane";
  3. if (!is_resource($result)) {
  4. }
  5. $result=mysql_query($query);
  6. $num=mysql_num_rows($result);
  7. ?>


ma byc:
  1. <?php
  2.  
  3. $query="SELECT*FORM dane";
  4. $result=mysql_query($query);
  5.  
  6. if (!is_resource($result)) {
  7. }
  8. $num=mysql_num_rows($result);
  9. ?>
Go to the top of the page
+Quote Post
andy84
post
Post #7





Grupa: Zarejestrowani
Postów: 165
Pomógł: 0
Dołączył: 14.11.2005
Skąd: London

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


Cytat(ghostrider @ 2005-11-19 11:47:57)
Cytat
  1. <?php
  2. $query=&#092;"SELECT*FORM dane";
  3. if (!is_resource($result)) {
  4. }
  5. $result=mysql_query($query);
  6. $num=mysql_num_rows($result);
  7. ?>


ma byc:
  1. <?php
  2.  
  3. $query="SELECT*FORM dane";
  4. $result=mysql_query($query);
  5.  
  6. if (!is_resource($result)) {
  7. }
  8. $num=mysql_num_rows($result);
  9. ?>

dobra mastery odkrylem co jest dzieki pomogles ostatnia komenda if

jak sie przyjzycie to glupi by tlko na to wpadl napisalem
$query="SELECT*FORM dane"; <---
a powinno byc (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

$query="SELECT*FROM dane"; <co za glupi blad prawda dwie literki przestawione dzieki chlopaki (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) ( sory jezeli sa jakies dziewczyny w tej konwersacji (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
nospor
post
Post #8





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




Przenosze na MySql. W końcu tego konkretnie dotyczy problem, wiec czemu od razu tam sie nie znalazł?
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 24.08.2025 - 21:27