← Desenvolvimento

Ajuda com sql :S

Lida 2520 vezes

Offline

Tartaruga 
Membro
Mensagens 2908 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

tou a instalar um ficheiro... mas n sei como é que faço isto:

You should have a database server running already. Create on your database server a database named as the $dbname variable value in the ‘config.inc.php’. The file ‘tables.sql’ contains the SQL code (working at least with MySQL) to create the needed tables. Use this file ‘as is’ for MySQL server or modify it as needed to create all the needed database tables.

o que está no ficheiro tables.sql é isto:
Código: [Seleccione]
--
-- Table structure for table `sc_bookmarks`
--

CREATE TABLE `sc_bookmarks` (
  `bId` int(11) NOT NULL auto_increment,
  `uId` int(11) NOT NULL default '0',
  `bIp` varchar(40) default NULL,
  `bStatus` tinyint(1) NOT NULL default '0',
  `bDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `bModified` datetime NOT NULL default '0000-00-00 00:00:00',
  `bTitle` varchar(255) NOT NULL default '',
  `bAddress` text NOT NULL,
  `bDescription` varchar(255) default NULL,
  `bHash` varchar(32) NOT NULL default '',
  PRIMARY KEY  (`bId`),
  KEY `sc_bookmarks_usd` (`uId`,`bStatus`,`bDatetime`),
  KEY `sc_bookmarks_hui` (`bHash`,`uId`,`bId`),
  KEY `sc_bookmarks_du` (`bDatetime`,`uId`)
);

-- --------------------------------------------------------

--
-- Table structure for table `sc_tags`
--

CREATE TABLE `sc_tags` (
  `id` int(11) NOT NULL auto_increment,
  `bId` int(11) NOT NULL default '0',
  `tag` varchar(32) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `sc_tags_tag_bId` (`tag`,`bId`),
  KEY `sc_tags_bId` (`bId`)
);

-- --------------------------------------------------------

--
-- Table structure for table `scUsers`
--

CREATE TABLE `sc_users` (
  `uId` int(11) NOT NULL auto_increment,
  `username` varchar(25) NOT NULL default '',
  `password` varchar(40) NOT NULL default '',
  `uDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `uModified` datetime NOT NULL default '0000-00-00 00:00:00',
  `name` varchar(50) default NULL,
  `email` varchar(50) NOT NULL default '',
  `homepage` varchar(255) default NULL,
  `uContent` text,
  PRIMARY KEY  (`uId`)
);

-- --------------------------------------------------------

--
-- Table structure for table `sc_watched`
--

CREATE TABLE `sc_watched` (
  `wId` int(11) NOT NULL auto_increment,
  `uId` int(11) NOT NULL default '0',
  `watched` int(11) NOT NULL default '0',
  PRIMARY KEY  (`wId`),
  KEY `sc_watched_uId` (`uId`)
);


É no phpMyAdmin né?
Offline

fpware 
Fundador
Mensagens 15318 Gostos 7
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Sim é no phpmyadmin:

CPanel > MySQL® Databases > phpMyAdmin (que está bem no fundo da página) > escolhes a bd em questão no menú do lado esquerdo > escolhe SQL no menú de topo > coloca o código na caixa e executa.
Offline

Tartaruga 
Membro
Mensagens 2908 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

só isso? :S ja tinha feito isso, mas deu erro :(
Offline

Tartaruga 
Membro
Mensagens 2908 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

ah ja sei o que pode ser...

no file config.inc.php

$dbtype = 'mysql4';
$dbhost = 'localhost';
$dbport = '3306';

não devia por outro número na dbport?
Offline

Tartaruga 
Membro
Mensagens 2908 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

o erro que dá é este... :S

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@yabuga.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.yabuga.com Port 80
Offline

fpware 
Fundador
Mensagens 15318 Gostos 7
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Citação de: "Tartaruga"
só isso? :S ja tinha feito isso, mas deu erro :(


Espera lá, que erro é que deu?

Tenta em vez de colares o texto que está no tables.sql, ir a import, coloca lá o ficheiro tables.sql e executa.
Offline

Tartaruga 
Membro
Mensagens 2908 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

Importação finalizada com sucesso, 4 consultas executadas.

Mas na pagina principal continua a n aparecer nada... não tera a ver com a dbport ?
Offline

BlueEagle 
Membro
Mensagens 2221 Gostos 1
Troféus totais: 31
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

Apaga o .htacess da pasta  :wink:
Offline

Tartaruga 
Membro
Mensagens 2908 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

Grande BlueEagle!!! LOLOL

Aquilo aparece em quase todos os scripts é uma especia de protecção para quando se está a intalar o script não é?
Offline

BlueEagle 
Membro
Mensagens 2221 Gostos 1
Troféus totais: 31
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

pode ter a ver com isso ou veio um .htacess estragado  :mrgreen:
Offline

Tartaruga 
Membro
Mensagens 2908 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

ah... mas agora está tudo ok :D Muito Obrigado!
Offline

BlueEagle 
Membro
Mensagens 2221 Gostos 1
Troféus totais: 31
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

Citação de: "Tartaruga"
ah... mas agora está tudo ok :D Muito Obrigado!


de nada  :wink: