[Php-avanzado] Leo: A ver que te parece esto...

Silverzero silverzero.52 en gmail.com
Vie Nov 27 11:36:31 ARST 2009


2009/11/27 Leonardo Tadei - Pegasus Tech Supply <leonardot en pegasusnet.com.ar
>

> Hola Carolina,
>
>        ahora los votos están bien.
>
>        Lo de "no me di cuenta y me quedó en la cabeza el funcionamiento q
> habias planteado anteriormente." se me escapa: la versión que tenía una
> sola tabla de votos, tenía un discriminador que era clave foránea del
> tipo de cosa, pero no un "voto" entero. La idea era tener un
> "tipo_de_cosa" y no un "tipo_de_voto".
>

No, es que ademas de confundirme con eso, se me mezclo con la tabla que
estaba usando de id no autoincremental que venia con el ajaxrater que estaba
usando que votaba por ip, entonces ahi te ponia la cantidad de veces
votado...re distraida!


>        Mandame así como está pasado en limpio para archivarlo como la
> normalización de tu proyecto.
>

acá va!

>
>        Seguimos!
>

saludos!
Carolina.

-- phpMyAdmin SQL Dump
-- version 2.11.9.5
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 27-11-2009 a las 11:31:44
-- Versión del servidor: 5.0.81
-- Versión de PHP: 5.2.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Base de datos: `salimas_sitio`
--

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

--
-- Estructura de tabla para la tabla `actividades`
--

CREATE TABLE IF NOT EXISTS `actividades` (
  `id` int(11) NOT NULL auto_increment,
  `fecha` date NOT NULL,
  `desde` date NOT NULL,
  `hasta` date NOT NULL,
  `horario` varchar(50) collate utf8_unicode_ci NOT NULL,
  `titulo` varchar(50) collate utf8_unicode_ci NOT NULL,
  `descripcion` text collate utf8_unicode_ci NOT NULL,
  `imagen` varchar(50) collate utf8_unicode_ci NOT NULL,
  `url` varchar(50) collate utf8_unicode_ci NOT NULL,
  `precio` varchar(50) collate utf8_unicode_ci NOT NULL,
  `id_visitante` int(11) NOT NULL,
  `id_lugar` int(11) NOT NULL,
  `id_stat` int(2) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=2 ;

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

--
-- Estructura de tabla para la tabla `actividadesXcat`
--

CREATE TABLE IF NOT EXISTS `actividadesXcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_act` int(11) NOT NULL,
  `id_cat` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `actividadesXsubcat`
--

CREATE TABLE IF NOT EXISTS `actividadesXsubcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_act` int(11) NOT NULL,
  `id_subcat` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `actividades_cat`
--

CREATE TABLE IF NOT EXISTS `actividades_cat` (
  `id` int(11) NOT NULL auto_increment,
  `nombre` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `actividades_subcat`
--

CREATE TABLE IF NOT EXISTS `actividades_subcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_actividad_cat` int(11) NOT NULL,
  `nombre` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `diccionario`
--

CREATE TABLE IF NOT EXISTS `diccionario` (
  `id` int(11) NOT NULL auto_increment,
  `frase` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=38 ;

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

--
-- Estructura de tabla para la tabla `eventos`
--

CREATE TABLE IF NOT EXISTS `eventos` (
  `id` int(11) NOT NULL auto_increment,
  `fecha` date NOT NULL,
  `desde` date NOT NULL,
  `hasta` date NOT NULL,
  `horario` varchar(50) collate utf8_unicode_ci NOT NULL,
  `titulo` varchar(50) collate utf8_unicode_ci NOT NULL,
  `descripcion` text collate utf8_unicode_ci NOT NULL,
  `imagen` varchar(50) collate utf8_unicode_ci NOT NULL,
  `url` varchar(100) collate utf8_unicode_ci NOT NULL,
  `precio` varchar(50) collate utf8_unicode_ci NOT NULL,
  `id_visitante` int(11) NOT NULL,
  `id_lugar` int(11) NOT NULL,
  `id_stat` int(2) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=4 ;

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

--
-- Estructura de tabla para la tabla `eventosXcat`
--

CREATE TABLE IF NOT EXISTS `eventosXcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_eve` int(11) NOT NULL,
  `id_cat` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `eventosXsubcat`
--

CREATE TABLE IF NOT EXISTS `eventosXsubcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_eve` int(11) NOT NULL,
  `id_subcat` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `eventos_cat`
--

CREATE TABLE IF NOT EXISTS `eventos_cat` (
  `id` int(11) NOT NULL auto_increment,
  `nombre` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `eventos_subcat`
--

CREATE TABLE IF NOT EXISTS `eventos_subcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_evento_cat` int(11) NOT NULL,
  `nombre` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `localidades`
--

CREATE TABLE IF NOT EXISTS `localidades` (
  `cod_loc` int(4) NOT NULL auto_increment,
  `cod_prov` int(2) NOT NULL,
  `desc` varchar(31) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`cod_loc`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=2383 ;

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

--
-- Estructura de tabla para la tabla `lugares`
--

CREATE TABLE IF NOT EXISTS `lugares` (
  `id` int(11) NOT NULL auto_increment,
  `fecha` date NOT NULL,
  `nombre` varchar(50) collate utf8_unicode_ci NOT NULL,
  `direccion` varchar(50) collate utf8_unicode_ci NOT NULL,
  `telefono` varchar(50) collate utf8_unicode_ci NOT NULL,
  `email` varchar(50) collate utf8_unicode_ci NOT NULL,
  `horario` varchar(50) collate utf8_unicode_ci NOT NULL,
  `precio` varchar(50) collate utf8_unicode_ci NOT NULL,
  `descripcion` text collate utf8_unicode_ci NOT NULL,
  `imagen` varchar(50) collate utf8_unicode_ci NOT NULL,
  `url` varchar(50) collate utf8_unicode_ci NOT NULL,
  `id_visitante` int(11) NOT NULL,
  `cod_loc` int(4) NOT NULL,
  `id_stat` int(2) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=11 ;

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

--
-- Estructura de tabla para la tabla `lugaresXcat`
--

CREATE TABLE IF NOT EXISTS `lugaresXcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_lug` int(11) NOT NULL,
  `id_cat` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `lugaresXsubcat`
--

CREATE TABLE IF NOT EXISTS `lugaresXsubcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_lug` int(11) NOT NULL,
  `id_subcat` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `lugares_cat`
--

CREATE TABLE IF NOT EXISTS `lugares_cat` (
  `id` int(11) NOT NULL auto_increment,
  `nombre` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `lugares_subcat`
--

CREATE TABLE IF NOT EXISTS `lugares_subcat` (
  `id` int(11) NOT NULL auto_increment,
  `id_lugar_cat` int(11) NOT NULL,
  `nombre` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `provincias`
--

CREATE TABLE IF NOT EXISTS `provincias` (
  `cod_prov` int(2) NOT NULL,
  `desc` varchar(30) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`cod_prov`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Estructura de tabla para la tabla `status`
--

CREATE TABLE IF NOT EXISTS `status` (
  `id` int(11) NOT NULL,
  `stat` varchar(10) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Estructura de tabla para la tabla `visitantes`
--

CREATE TABLE IF NOT EXISTS `visitantes` (
  `id` int(11) NOT NULL auto_increment,
  `fecha` date NOT NULL,
  `nombres` varchar(50) collate utf8_unicode_ci NOT NULL,
  `apellidos` varchar(50) collate utf8_unicode_ci NOT NULL,
  `alias` varchar(50) collate utf8_unicode_ci NOT NULL,
  `email` varchar(50) collate utf8_unicode_ci NOT NULL,
  `pass` varchar(50) collate utf8_unicode_ci NOT NULL,
  `avatar` varchar(50) collate utf8_unicode_ci NOT NULL,
  `ocupacion` varchar(50) collate utf8_unicode_ci NOT NULL,
  `about` text collate utf8_unicode_ci NOT NULL,
  `intereses` text collate utf8_unicode_ci NOT NULL,
  `url` varchar(50) collate utf8_unicode_ci NOT NULL,
  `id_stat` int(2) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=3 ;

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

--
-- Estructura de tabla para la tabla `votos_actividades`
--

CREATE TABLE IF NOT EXISTS `votos_actividades` (
  `id` int(11) NOT NULL auto_increment,
  `puntaje` int(11) NOT NULL,
  `id_ref` int(11) NOT NULL,
  `id_visitante` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `votos_eventos`
--

CREATE TABLE IF NOT EXISTS `votos_eventos` (
  `id` int(11) NOT NULL auto_increment,
  `puntaje` int(11) NOT NULL,
  `id_ref` int(11) NOT NULL,
  `id_visitante` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;

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

--
-- Estructura de tabla para la tabla `votos_lugares`
--

CREATE TABLE IF NOT EXISTS `votos_lugares` (
  `id` int(11) NOT NULL auto_increment,
  `puntaje` int(11) NOT NULL,
  `id_ref` int(11) NOT NULL,
  `id_visitante` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1 ;
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://www3.fi.mdp.edu.ar/cgi-bin/mailman/private/php-avanzado/attachments/20091127/3497df15/attachment-0001.htm 


Más información sobre la lista de distribución Php-avanzado