Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> funkcja licząca zapytania
nightspirit
post
Post #1





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 31.08.2004
Skąd: Bydgoszcz, Polska

Ostrzeżenie: (10%)
X----


Jaka jest funkcja licząca zapytania mysql ? (IMG:http://forum.php.pl/style_emoticons/default/guitar.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nightspirit
post
Post #2





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 31.08.2004
Skąd: Bydgoszcz, Polska

Ostrzeżenie: (10%)
X----


  1. <?php
  2.  
  3. class MySQLDB {
  4. var $iNumberQueries = 0;
  5. var $resource;
  6. function MySQLDB () {
  7. $this->resource = mysql_connect();
  8. }
  9. function query($query) {
  10. $this->iNumberQueries++;
  11. return new MySQLResult($query);
  12. }
  13. }
  14. class Result {
  15. function Result($query) {
  16. mysql_query($query);
  17. }
  18. }
  19.  
  20. /* mysql */
  21. $mysql['host'] = 'localhost';
  22. $mysql['login'] = 'root';
  23. $mysql['haslo'] = '';
  24. $mysql['baza'] = 'test';
  25.  
  26. /* mysql.connect */
  27. mysql_connect ($mysql['host'], $mysql['login'], $mysql['haslo']);
  28. mysql_select_db ($mysql['baza']);
  29.  
  30. $re = new Result();
  31. $re -> Result(&#092;"SELECT * FROM `2idw1`\");
  32. print &#092;"<table border=\"1\">\"; 
  33. $ile = '0'; 
  34. while ($rekord = mysql_fetch_array ($query)) 
  35. { 
  36.  
  37. $ile++; 
  38. if ($ile =='1'){ 
  39. print &#092;"<tr><td>\".$rekord['xxx'].\"</td>\"; 
  40. } elseif ($ile=='2'){ 
  41. print &#092;"<td>\".$rekord['xxx'].\"</td></tr>\"; 
  42. $ile = '0'; 
  43. } 
  44. } 
  45. print &#092;"</table>\";
  46. echo '<br><br>';
  47. ?>


co ja zrobiłem (IMG:http://forum.php.pl/style_emoticons/default/laugh.gif) (IMG:http://forum.php.pl/style_emoticons/default/tiredsmiley.gif)
Go to the top of the page
+Quote Post

Posty w temacie


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: 7.10.2025 - 12:58