Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Skrypt typera - błąd z połączeniem do bazy.
ozeksportu
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 26.02.2013

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


Witam,

Prowadzę stronę internetową o tematyce piłkarskiej i chciałem dołożyć do niej typer, więc wybrałem "Prediction Football", lecz podczas instalacji wywala mi błąd mysql:

  1. Unable TO CREATE DATABASE psor_1. Make sure psor_1 does NOT already exist


Nie mam pojęcia dlaczego, wszystko wpisuje (wydaje mi się) dobrze, lecz cały czas wywala ten błąd. Czym to może być spowodowane? Podkreślę, że mam hosting na płatnym serwerze nazwa.pl.

Pozdrawiam.

Ten post edytował ozeksportu 26.02.2013, 16:28:07
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
pitu
post
Post #2





Grupa: Zarejestrowani
Postów: 476
Pomógł: 96
Dołączył: 10.04.2008
Skąd: Koszalin

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


W błędzie masz informację, że tabela psor_1 istnieje i nie może jej stworzyć.


--------------------
HTML/CSS/JS: jsfiddle
SQL: sqlfiddle
Go to the top of the page
+Quote Post
ozeksportu
post
Post #3





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 26.02.2013

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


Próbowałem już wszelakich sposobów i nie mogę do tego dojść. Tutaj podaję plik, który musi być odpowiednio zmodyfikowany pod moją bazę:

Dodam, że user bazy to: psor_1, nazwa bazy to psor_1 i host to psor.nazwa.pl:3307

Wydaje mi się, że wszystko wpisuje ok, a jednak ciągle coś wywala.

  1. <?php
  2. error_reporting(E_ALL & ~E_NOTICE);
  3. /*********************************************************
  4.  * Author: John Astill (c)
  5.  * Date : 10th December 2001
  6.  * File : systemvars.php
  7.  * Desc : Global data definitions. This is where the
  8.  * : prediction league is configured for the
  9.  * : specific installation.
  10.  ********************************************************/
  11. require "userclass.php";
  12. require "logfunctions.php";
  13. require "error.php";
  14.  
  15. //////////////////////////////////////////
  16. // System variable and configuration
  17. //////////////////////////////////////////
  18. //////////////////////////////////////////
  19. // Constants
  20. //////////////////////////////////////////
  21. define("VERSION","1.12");
  22.  
  23. /////////////////////////////////////////////////
  24. // Default points for scoring, this can be
  25. // set in the config screen.
  26. /////////////////////////////////////////////////
  27. $corrHomeScore = 1;
  28. $corrAwayScore = 1;
  29. $corrMargin = 1;
  30. $corrResult = 1;
  31. $corrScore = 3;
  32.  
  33. //////////////////////////////////////////////////////////////
  34. // Modify the values from here to where you are told to stop.
  35. // The numbers match those in the installation steps in
  36. // the file INSTALL.TXT.
  37. //////////////////////////////////////////////////////////////
  38. //////////////////////////////////////////
  39. // 1.Prediction League Title
  40. // The title of the Prediction League.
  41. // Change the value between the "" to
  42. // give the prediction league the title
  43. // of your choice
  44. //////////////////////////////////////////
  45. $PredictionLeagueTitle = "Prediction Football.com";
  46.  
  47. //////////////////////////////////////////////////////////////
  48. // 2. Header Row
  49. // This is the header to be displayed in
  50. //all the pages. It can contain HTML code.
  51. //////////////////////////////////////////////////////////////
  52. $HeaderRow = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"center\" class=\"TBLHEAD\"><font class=\"TBLHEAD\"><img border=\"0\" src=\"banner.jpg\"></font></td></tr></table>";
  53.  
  54. //////////////////////////////////////////////////////////////
  55. // 3. Database hostname
  56. // Database hostname
  57. // The fqdn of the host containing the
  58. // database
  59. //////////////////////////////////////////////////////////////
  60. $dbaseHost = "psor.nazwa.pl:3307";
  61.  
  62. //////////////////////////////////////////////////////////////
  63. // 4. Base Directory Name
  64. // The directory storing the prediction
  65. // league files
  66. //////////////////////////////////////////////////////////////
  67. $baseDirName = "typer";
  68.  
  69. //////////////////////////////////////////////////////////////
  70. // 5. Username
  71. // User name
  72. // The username to be used for logging
  73. // into the database
  74. //////////////////////////////////////////////////////////////
  75. $dbaseUsername = "psor_1";
  76.  
  77. //////////////////////////////////////////////////////////////
  78. // 6. Password
  79. // Password to be used for logging into
  80. // the database
  81. //////////////////////////////////////////////////////////////
  82. $dbasePassword = "haslo";
  83.  
  84. //////////////////////////////////////////////////////////////
  85. // 7. Database Name.
  86. // This is the name of the database. This *MUST* be the same
  87. // name as the name you used when creating the database.
  88. //////////////////////////////////////////////////////////////
  89. $dbaseName = "psor_1";


Podczas instalacji, gdy zaznaczam by stworzyło tylko tabele (bez bazy) to wyskakuje taki błąd:

  1. Query failed: CREATE TABLE psor_1.pluserdata (lid int NOT NULL , userid int NOT NULL AUTO_INCREMENT, username varchar(32) NOT NULL , password varchar(40), email varchar(60), icon varchar(128), lang varchar(32), usertype smallint, dflths smallint DEFAULT 0, dfltas smallint DEFAULT 0, since DATE, auto enum('Y','N') DEFAULT 'N', PRIMARY KEY (lid,userid));
  2. Incorrect TABLE definition; there can be only one auto COLUMN AND it must be defined AS a KEY


Ten post edytował ozeksportu 26.02.2013, 17:03:36
Go to the top of the page
+Quote Post
weedget
post
Post #4





Grupa: Zarejestrowani
Postów: 16
Pomógł: 2
Dołączył: 7.06.2007
Skąd: Warszawa

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


Jeśli zrobisz tak:
  1. CREATE TABLE psor_1.pluserdata (lid int NOT NULL , userid int NOT NULL AUTO_INCREMENT, username varchar(32) NOT NULL , password varchar(40), email varchar(60), icon varchar(128), lang varchar(32), usertype smallint, dflths smallint DEFAULT 0, dfltas smallint DEFAULT 0, since DATE, auto enum('Y','N') DEFAULT 'N', PRIMARY KEY (userid));


  1. ALTER TABLE `pluserdata` DROP PRIMARY KEY, ADD PRIMARY KEY (`userid`, `lid`);


to powinno zadziałać smile.gif
Go to the top of the page
+Quote Post

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: 20.08.2025 - 23:05