Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MySQL][PHP]Co jest zle?
Dexter1479
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 20.12.2010

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


Elo mam taki problem odpalilem X-Nove wszystko porobilem instalacje etc. i chcialem zwiekszyc szybkosc gry, floty etc. ale wyskakuje mi jakis blad no i nie wiem co zrobic ;/ Moglby ktos mi powiedziec co mam tu zmienic lub cos?

Kod
Fatal error: Call to a member function add() on a non-object in /virtual/t/e/testowabydexter.ugu.pl/db/mysql.php on line 38
Go to the top of the page
+Quote Post
cabana
post
Post #2





Grupa: Zarejestrowani
Postów: 88
Pomógł: 0
Dołączył: 25.05.2010

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


pokaż plik mysql.php bo przecież jasnowidzami nie jesteśmy (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
Dexter1479
post
Post #3





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 20.12.2010

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


  1. <?php
  2.  
  3. function doquery($query, $table, $fetch = false){
  4. global $link, $debug, $xnova_root_path;
  5. // echo $query."<br />";
  6. require($xnova_root_path.'config.php');
  7.  
  8.  
  9.  
  10. if(!$link)
  11. {
  12. $link = mysql_connect($dbsettings["server"], $dbsettings["user"],
  13. $dbsettings["pass"]) or
  14. $debug->error(mysql_error()."<br />$query","SQL Error");
  15. //message(mysql_error()."<br />$query","SQL Error");
  16.  
  17. mysql_select_db($dbsettings["name"]) or $debug->error(mysql_error()."<br />$query","SQL Error");
  18. }
  19. // por el momento $query se mostrara
  20. // pero luego solo se vera en modo debug
  21.  
  22.  
  23.  
  24. $sql = str_replace("{{table}}", $dbsettings["prefix"].$table, $query);
  25.  
  26.  
  27. $sqlquery = mysql_query($sql) or
  28. $debug->error(mysql_error()."<br />$sql<br />","SQL Error");
  29. //print(mysql_error()."<br />$query"."SQL Error");
  30.  
  31.  
  32. unset($dbsettings);//se borra la array para liberar algo de memoria
  33.  
  34. global $numqueries,$debug;//,$depurerwrote003;
  35. $numqueries++;
  36. //$depurerwrote003 .=;
  37. $debug->add("<tr><th>Query $numqueries: </th><th>$query</th><th>$table</th><th>$fetch</th></tr>");
  38.  
  39. if($fetch)
  40. { //hace el fetch y regresa $sqlrow
  41. $sqlrow = mysql_fetch_array($sqlquery);
  42. return $sqlrow;
  43. }else{ //devuelve el $sqlquery ("sin fetch")
  44. return $sqlquery;
  45. }
  46.  
  47. }
  48.  
  49.  
  50.  
  51. // Created by Perberos. All rights reversed (C) 2006
  52. ?>


Ten post edytował Dexter1479 20.12.2010, 22:17:17
Go to the top of the page
+Quote Post
Mephistofeles
post
Post #4





Grupa: Zarejestrowani
Postów: 1 182
Pomógł: 115
Dołączył: 4.03.2009
Skąd: Myszków

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


Wcześniej działało? Musiałeś coś popsuć, a to nietrudne przy tak beznadziejnym skrypcie, z użyciem globali i innego śmietnika.
Go to the top of the page
+Quote Post
Dexter1479
post
Post #5





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 20.12.2010

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


Nie, nie dzialalo wlasnie
Go to the top of the page
+Quote Post
Wicepsik
post
Post #6





Grupa: Zarejestrowani
Postów: 1 575
Pomógł: 299
Dołączył: 26.03.2009

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


To zapraszam na forum tego skryptu. Na pewno ktoś miał problemy takie same jak ty, jeśli po ściągnięciu od razu sąbłędy.
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: 23.08.2025 - 08:17