Autor Zpráva
Milan Sobotka
Profil
Dobrý den.
Našel jsem na internetu celkem dobré příklady na hlasovaní a pod. a mají být napojeny na databazi My Sql. To mi bouhžel absolutně nejde a nevím si s tím rady, protže na tomto webu, z kterého tento příklad čerpám neuvedl, jak se má vůbec ta databáze jmenovat nebo jsem to nepochopil... http://www.w3bees.com/2013/09/voting-system-with-jquery-php-and-mysql.html
Za pomoc předem děkuji.
Generation
Profil *
Milan Sobotka:
A co mysliš že je toto?
CREATE TABLE IF NOT EXISTS `voting` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(45) NOT NULL,
  `last_name` varchar(45) NOT NULL,
  `film_info` text NOT NULL,
  `vote` int(8) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
);
Sennin
Profil
Máš hosting alebo pracuješ v Xamppe či ím podobné?

Ale proste si zaregistruješ databázu (vytvoríš si ju)
prihlásiš sa do databázy a vytvoríš tabuľku napr. hlasovanie no a do tej dabuľky dáš cez SQL príkaz
CREATE TABLE IF NOT EXISTS `voting` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(45) NOT NULL,
  `last_name` varchar(45) NOT NULL,
  `film_info` text NOT NULL,
  `vote` int(8) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
);

vytvoríš si config.php a doň zadáš
# db configurations
define('DB_HOST',    'localhost'); <-- Tvoje DB pripojenie väčšinou localhost
define('DB_USER',    'root'); <-- užívateľské meno databázy
define('DB_PASS',    'root'); <-- heslo do databázy
define('DB_NAME',    'mydb'); <-- názov databázy

# db connect
function dbConnect($close=true){
  global $link;

  if (!$close) {
    mysql_close($link);
    return true;
  }

  $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die('Could not connect to MySQL DB ') . mysql_error();
  if (!mysql_select_db(DB_NAME, $link))
    return false;
}
Vytviríš si dokument index.php
<?php
include('config.php');
# connect mysql db
dbConnect();
$query = mysql_query(
  'SELECT id, first_name, last_name, film_info, vote 
  FROM  voting
  LIMIT 0 , 15');
?>
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>jQUery Voting System</title>
</head>
<body>
  <div class="wrap">
    <?php while($row = mysql_fetch_array($query)): ?>
    <div class="item" data-postid="<?php echo $row['id'] ?>" data-score="<?php echo $row['vote'] ?>">
      <div class="vote-span"><!-- voting-->
        <div class="vote" data-action="up" title="Vote up">
          <i class="icon-chevron-up"></i>
        </div><!--vote up-->
        <div class="vote-score"><?php echo $row['vote'] ?></div>
        <div class="vote" data-action="down" title="Vote down">
          <i class="icon-chevron-down"></i>
        </div><!--vote down-->
      </div>

      <div class="post"><!-- post data -->
        <h2><?php echo $row['first_name'].' '.$row['last_name']?></h2>
        <p><?php echo $row['film_info'] ?></p>
      </div>
    </div><!--item-->
    <?php endwhile?>
  </div>
  <?php dbConnect(false); ?>
</body>
</html>
Css súbor
/* voting style */
.vote-span{
  width: 60px;
  float: left;
  margin: 5px 0;
}
.vote, .vote-score{
  clear: both;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-align: center;
  color: #333;
  font-size: 1.8em;
  font-weight: bold;
}
.vote-score{cursor: text}
Jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
  // ajax setup
  $.ajaxSetup({
    url: 'ajaxvote.php',
    type: 'POST',
    cache: 'false'
  });

  // any voting button (up/down) clicked event
  $('.vote').click(function(){
    var self = $(this); // cache $this
    var action = self.data('action'); // grab action data up/down 
    var parent = self.parent().parent(); // grab grand parent .item
    var postid = parent.data('postid'); // grab post id from data-postid
    var score = parent.data('score'); // grab score form data-score

    // only works where is no disabled class
    if (!parent.hasClass('.disabled')) {
      // vote up action
      if (action == 'up') {
        // increase vote score and color to orange
        parent.find('.vote-score').html(++score).css({'color':'orange'});
        // change vote up button color to orange
        self.css({'color':'orange'});
        // send ajax request with post id & action
        $.ajax({data: {'postid' : postid, 'action' : 'up'}});
      }
      // voting down action
      else if (action == 'down'){
        // decrease vote score and color to red
        parent.find('.vote-score').html(--score).css({'color':'red'});
        // change vote up button color to red
        self.css({'color':'red'});
        // send ajax request
        $.ajax({data: {'postid' : postid, 'action' : 'down'}});
      };

      // add disabled class with .item
      parent.addClass('.disabled');
    };
  });
});
</script>
A nakoniec vytvoríš ajaxvote.php
include('config.php');
# start new session
session_start();
dbConnect();
if ($_SERVER['HTTP_X_REQUESTED_WITH']) {
  if (isset($_POST['postid']) AND isset($_POST['action'])) {
    $postId = (int) mysql_real_escape_string($_POST['postid']);
    # check if already voted, if found voted then return
    if (isset($_SESSION['vote'][$postId])) return;
    # connect mysql db
    

    # query into db table to know current voting score 
    $query = mysql_query("
      SELECT vote
      from voting
      WHERE id = '{$postId}' 
      LIMIT 1" );

    # increase or dicrease voting score
    if ($data = mysql_fetch_array($query)) {
      if ($_POST['action'] === 'up'){
        $vote = ++$data['vote'];
      } else {
        $vote = --$data['vote'];
      }
      # update new voting score
      mysql_query("
        UPDATE voting
        SET vote = '{$vote}'
        WHERE id = '{$postId}' ");

      # set session with post id as true
      $_SESSION['vote'][$postId] = true;
      # close db connection
      
    }
  }
}
dbConnect(false);
V podstate máš všetko na dlani akurát je na tebe ta databáza ako si ju nazveš je na tebe tak isto aj prihlasovacie údaje a všetko okolo toho.
Milan Sobotka
Profil
no mam ucet na endore. No to je on. ja nevedel, jestli se nejak musi ta databaze jmenovat. akorat je tu problem, ze mi to haze chybu ze nemam opravneni k vytvareni nove databaze i tabulky... :(


Proste mi to nepovolí udělat novou databázi a přes to se dál bohužel nedostanu... :(
Sennin
Profil
Milan Sobotka:
akorat je tu problem, ze mi to haze chybu ze nemam opravneni k vytvareni nove databaze i tabulky... :(
No s týym ti ja už nepomôžem ja som u **** <-- nechcem robiť reklamu a na endore som ešte ani nebol :) hádam niekto iný alebo podpora na endore snáď..

samozrejme že sa musí :)
Milan Sobotka
Profil
hm. přesto ale děkuji. :D


Ted nekde ctu ze mám opravneni jen na jednu databazi... tak to bude asi ono. ale do ni bych mohl si udelat ty tabulky ne? je to jedno v jaky databazi? :D
Sennin
Profil
Milan Sobotka:
Proste mi to nepovolí udělat novou databázi a přes to se dál bohužel nedostanu... :(
Akurát som sa registroval haha pre zábavu no teda cez čo ideš?

MyISAM
- alebo -
InnoDB



Milan Sobotka:
Samozrejme že je do akej databázy no samozrejme k nej musíš mať prístupové údaje
tam si vytvoríš tabuľku napr. hlasovanie a do nej v príkaze SQL vložíš viz vyššie ten príkaz :)
Milan Sobotka
Profil
ted uz chapu ale zatim mazu vsechny nepotrebne databaze. :D
Sennin
Profil
hej takže som rád :)
Milan Sobotka
Profil
aa. uz mi to jde. uz jsem se dostal na vytvorit tabulku tak co ted s tim? :DDDD


no a takze ted vytvorit tabulku ale s kolika sloupci? ja vim, je to se mnou tezky ale tohle jsem proste nikdy nechapal! :D
Sennin
Profil
si v phpMyAdmin-e?
Tam klikneš na názov databázy a hore bude menu a v ňom SQL
a do tej textarei vložíš
CREATE TABLE IF NOT EXISTS `voting` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(45) NOT NULL,
  `last_name` varchar(45) NOT NULL,
  `film_info` text NOT NULL,
  `vote` int(8) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
);
A Klikneš na Vykonaj toť vše :)
Milan Sobotka
Profil
Ahaáááááááá. :D takze tohle co to napsalo je dobre? MySQL vrátil prázdný výsledek (tj. nulový počet řádků). (Dotaz trval 0.0064 sekund.)
Sennin
Profil
Milan Sobotka:
Áno teraz vykonaj ostatné úkony a mal by si fičať
Nezabudni že do config.php musíš zadať pripojenie k DB
# db configurations
define('DB_HOST',    'localhost'); <-- ostava localhost
define('DB_USER',    'root'); <-- užívateľské meno databázy
define('DB_PASS',    'root'); <-- heslo do databázy
define('DB_NAME',    'mydb'); <-- názov databázy
Milan Sobotka
Profil
takze mysto localhost co? jsem nepochopil. :D misto root jak se jmenuje uzivatel misto druhyho root heslo db a mysto mydb nazev db.???
Sennin
Profil
Milan Sobotka:
1. localhost nemeň ten ostáva
2. áno
3. áno
4. áno
Milan Sobotka
Profil
jo vlastne local host je toto https://sql9.endora.cz my to vypadlo. :D


aha. :D
Sennin
Profil
Milan Sobotka:
To už nie je podstatné ty len potrebuješ vedieť že je na localhost-e :)
Milan Sobotka
Profil
no tak jsem udelal vse jak jste rekli a ted uz to na index.php nepise nic. psalo to ze se to neni pripojeny k db ale ted uz vubec nic tak asi se stala nekde chyba... :D :(


a to jak tam jeste u toho je ten soubor voting.sgl tak co s nim? neni to nahodou ze se to ma dat taky do ty db???

-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 06, 2013 at 10:15 AM
-- Server version: 5.5.27
-- PHP Version: 5.4.7

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `proj`
--

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

--
-- Table structure for table `voting`
--

CREATE TABLE IF NOT EXISTS `voting` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`first_name` varchar(45) NOT NULL,
`last_name` varchar(45) NOT NULL,
`film_info` text NOT NULL,
`vote` int(8) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=201 ;

--
-- Dumping data for table `voting`
--

INSERT INTO `voting` (`id`, `first_name`, `last_name`, `film_info`, `vote`) VALUES
(1, 'PENELOPE', 'GUINESS', 'Animation: ANACONDA CONFESSIONS; Children: LANGUAGE COWBOY; Classics: COLOR PHILADELPHIA, WESTWARD SEABISCUIT; Comedy: VERTIGO NORTHWEST; Documentary: ACADEMY DINOSAUR; Family: KING EVOLUTION, SPLASH GUMP; Foreign: MULHOLLAND BEAST; Games: BULWORTH COMMANDMENTS, HUMAN GRAFFITI; Horror: ELEPHANT TROJAN, LADY STAGE, RULES HUMAN; Music: WIZARD COLDBLOODED; New: ANGELS LIFE, OKLAHOMA JUMANJI; Sci-Fi: CHEAPER CLYDE; Sports: GLEAMING JAWBREAKER', 450),
(2, 'NICK', 'WAHLBERG', 'Action: BULL SHAWSHANK; Animation: FIGHT JAWBREAKER; Children: JERSEY SASSY; Classics: DRACULA CRYSTAL, GILBERT PELICAN; Comedy: MALLRATS UNITED, RUSHMORE MERMAID; Documentary: ADAPTATION HOLES; Drama: WARDROBE PHANTOM; Family: APACHE DIVINE, CHISUM BEHAVIOR, INDIAN LOVE, MAGUIRE APACHE; Foreign: BABY HALL, HAPPINESS UNITED; Games: ROOF CHAMPION; Music: LUCKY FLYING; New: DESTINY SATURDAY, FLASH WARS, JEKYLL FROGMEN, MASK PEACH; Sci-Fi: CHAINSAW UPTOWN, GOODFELLAS SALUTE; Travel: LIAISONS SWEET, SMILE EARRING', -250),
(3, 'ED', 'CHASE', 'Action: CADDYSHACK JEDI, FORREST SONS; Classics: FROST HEAD, JEEPERS WEDDING; Documentary: ARMY FLINTSTONES, FRENCH HOLIDAY, HALLOWEEN NUTS, HUNTER ALTER, WEDDING APOLLO, YOUNG LANGUAGE; Drama: LUCK OPUS, NECKLACE OUTBREAK, SPICE SORORITY; Foreign: COWBOY DOOM, WHALE BIKINI; Music: ALONE TRIP; New: EVE RESURRECTION, PLATOON INSTINCT; Sci-Fi: WEEKEND PERSONAL; Sports: ARTIST COLDBLOODED, IMAGE PRINCESS; Travel: BOONDOCK BALLROOM', 105),
(4, 'JENNIFER', 'DAVIS', 'Action: BAREFOOT MANCHURIAN; Animation: ANACONDA CONFESSIONS, GHOSTBUSTERS ELF; Comedy: SUBMARINE BED; Documentary: BED HIGHBALL, NATIONAL STORY, RAIDERS ANTITRUST; Drama: BLADE POLISH, GREEDY ROOTS; Family: SPLASH GUMP; Horror: TREASURE COMMAND; Music: HANOVER GALAXY, REDS POCUS; New: ANGELS LIFE, JUMANJI BLADE, OKLAHOMA JUMANJI; Sci-Fi: RANDOM GO, SILVERADO GOLDFINGER, UNFORGIVEN ZOOLANDER; Sports: INSTINCT AIRPORT, POSEIDON FOREVER; Travel: BOONDOCK BALLROOM', 568),
(5, 'JOHNNY', 'LOLLOBRIGIDA', 'Action: AMADEUS HOLY, GRAIL FRANKENSTEIN, RINGS HEARTBREAKERS; Animation: SUNRISE LEAGUE; Children: HALL CASSIDY; Comedy: DADDY PITTSBURGH; Documentary: BONNIE HOLOCAUST, METAL ARMAGEDDON, PACIFIC AMISTAD, POCUS PULP; Drama: CHITTY LOCK, CONEHEADS SMOOCHY; Games: FIRE WOLVES; Horror: COMMANDMENTS EXPRESS, LOVE SUICIDES, PATTON INTERVIEW; Music: BANGER PINOCCHIO, HEAVENLY GUN; New: FRONTIER CABIN, RIDGEMONT SUBMARINE; Sci-Fi: DAISY MENAGERIE, GOODFELLAS SALUTE, SOLDIERS EVOLUTION; Sports: GROOVE FICTION, KRAMER CHOCOLATE, STAR OPERATION; Travel: ENOUGH RAGING, ESCAPE METROPOLIS, SMILE EARRING', 150),
(6, 'BETTE', 'NICHOLSON', 'Action: ANTITRUST TOMATOES; Animation: BIKINI BORROWERS, CROSSROADS CASUALTIES, POTLUCK MIXED, TITANIC BOONDOCK; Children: LANGUAGE COWBOY; Classics: BEAST HUNCHBACK; Documentary: COAST RAINBOW; Family: BANG KWAI; Foreign: CALENDAR GUNFIGHT, MULHOLLAND BEAST; New: WYOMING STORM; Sci-Fi: COLDBLOODED DARLING; Sports: DROP WATERFRONT, KRAMER CHOCOLATE, LESSON CLEOPATRA, LIBERTY MAGNIFICENT, TRADING PINOCCHIO; Travel: IGBY MAKER, SPEED SUIT', -200),
(7, 'GRACE', 'MOSTEL', 'Action: BERETS AGENT, EXCITEMENT EVE; Animation: SLEEPLESS MONSOON, TRACY CIDER; Children: WARLOCK WEREWOLF; Classics: MALKOVICH PET, OCTOBER SUBMARINE; Drama: CONFESSIONS MAGUIRE, DECEIVER BETRAYED, DESTINATION JERK, NECKLACE OUTBREAK, SAINTS BRIDE, SAVANNAH TOWN, TREATMENT JEKYLL; Foreign: COMMAND DARLING, HELLFIGHTERS SIERRA, SCISSORHANDS SLUMS, TOWN ARK, WAR NOTTING; Games: DAZED PUNK; Horror: ARACHNOPHOBIA ROLLERCOASTER, GASLIGHT CRUSADE; New: ANGELS LIFE, BREAKING HOME, SLEEPY JAPANESE, STING PERSONAL; Sci-Fi: OPEN AFRICAN; Sports: ANONYMOUS HUMAN, INSTINCT AIRPORT, POSEIDON FOREVER', 100),
(8, 'MATTHEW', 'JOHANSSON', 'Action: CAMPUS REMEMBER, DANCES NONE; Animation: SUGAR WONKA; Classics: LIGHTS DEER, MALKOVICH PET, TOMORROW HUSTLER; Drama: CONQUERER NUTS, HANGING DEEP, SCORPION APOLLO; Family: INDIAN LOVE; Foreign: BABY HALL, SCHOOL JACKET; Music: CLONES PINOCCHIO, DRIVING POLISH, RUNNER MADIGAN, VANISHING ROCKY; New: FLASH WARS; Sci-Fi: CROWDS TELEMARK; Sports: DURHAM PANKY, LOSER HUSTLER', 1),
(9, 'JOE', 'SWANK', 'Action: PRIMARY GLASS, WATERFRONT DELIVERANCE; Animation: LAWLESS VISION, SUNRISE LEAGUE; Children: CROOKED FROGMEN, SWEETHEARTS SUSPECTS, TIES HUNGER; Classics: SNATCHERS MONTEZUMA; Documentary: MAJESTIC FLOATS, PACIFIC AMISTAD, UNTOUCHABLES SUNRISE; Drama: DALMATIONS SWEDEN, LEBOWSKI SOLDIERS; Family: CHOCOLAT HARRY; Foreign: CHOCOLATE DUCK; Games: CURTAIN VIDEOTAPE; Horror: ANYTHING SAVANNAH, REEF SALUTE; Music: BIRCH ANTITRUST, RUNNER MADIGAN; New: WILD APOLLO; Sports: PERDITION FARGO; Travel: HORROR REIGN, SMILE EARRING, TRAFFIC HOBBIT', 1),
(10, 'CHRISTIAN', 'GABLE', 'Action: LORD ARIZONA, WATERFRONT DELIVERANCE; Animation: PUNK DIVORCE; Children: CROOKED FROGMEN; Classics: JEEPERS WEDDING, PREJUDICE OLEANDER; Comedy: LIFE TWISTED; Documentary: ACADEMY DINOSAUR, MOD SECRETARY, WEDDING APOLLO; Drama: GOLDFINGER SENSIBILITY; Foreign: USUAL UNTOUCHABLES; Games: DIVINE RESURRECTION; Horror: ALABAMA DEVIL, REAP UNFAITHFUL; Music: JAWBREAKER BROOKLYN, WIZARD COLDBLOODED, WON DARES; New: DRAGONFLY STRANGERS; Sci-Fi: VACATION BOONDOCK; Sports: SHAKESPEARE SADDLE; Travel: TROUBLE DATE', -1),
(11, 'ZERO', 'CAGE', 'Action: DANCES NONE, HANDICAP BOONDOCK, STORY SIDE; Animation: CANYON STOCK, HORN WORKING; Children: JERSEY SASSY, TOOTSIE PILOT, UPTOWN YOUNG; Comedy: VELVET TERMINATOR; Documentary: MOD SECRETARY, THIN SAGEBRUSH; Drama: RACER EGG, WEST LION; Family: GANDHI KWAI; Foreign: MEET CHOCOLATE; Games: ENCINO ELF, MOONWALKER FOOL; Horror: STRANGERS GRAFFITI; Music: OLEANDER CLUE; New: ENDING CROWDS, GODFATHER DIARY; Sports: HONEY TIES, IMAGE PRINCESS, LOSER HUSTLER; Travel: WORKER TARZAN', -1),
(12, 'KARL', 'BERRY', 'Action: STAGECOACH ARMAGEDDON; Animation: DARES PLUTO, DOORS PRESIDENT, TELEMARK HEARTBREAKERS; Children: FURY MURDER; Classics: ARIZONA BANG, BOUND CHEAPER; Comedy: PERFECT GROOVE, SWEDEN SHINING; Documentary: HARDLY ROBBERS, INDEPENDENCE HOTEL, SMOKING BARBARELLA, VIRGINIAN PLUTO; Drama: BUNCH MINDS, REUNION WITCHES; Family: DATE SPEED; Foreign: ALLEY EVOLUTION, HIGHBALL POTTER; Horror: ARABIA DOGMA, BOWFINGER GABLES, MONTEREY LABYRINTH, REAP UNFAITHFUL; Music: ALONE TRIP, LUCKY FLYING; New: CLEOPATRA DEVIL, DAY UNFAITHFUL, OKLAHOMA JUMANJI; Sci-Fi: CONNECTICUT TRAMP; Sports: HOLES BRANNIGAN, NOVOCAINE FLIGHT; Travel: LEATHERNECKS DWARFS', 1),
(13, 'UMA', 'WOOD', 'Action: ANTITRUST TOMATOES, CLUELESS BUCKET; Animation: CLASH FREDDY, INCH JET, SNOWMAN ROLLERCOASTER; Children: CABIN FLASH, LEGALLY SECRETARY, MODEL FISH, SPLENDOR PATTON; Classics: GALAXY SWEETHEARTS, STEEL SANTA; Comedy: GROUNDHOG UNCUT, LIFE TWISTED, LION UNCUT; Documentary: HOMEWARD CIDER, METAL ARMAGEDDON, WEDDING APOLLO; Drama: TORQUE BOUND; Family: LOLITA WORLD, SPLASH GUMP; Foreign: FRIDA SLIPPER; Games: GRINCH MASSAGE, MOONWALKER FOOL; Horror: MOTIONS DETAILS, ZHIVAGO CORE; Music: ALONE TRIP, REBEL AIRPORT; New: ATTRACTION NEWTON, CHINATOWN GLADIATOR; Sci-Fi: DAISY MENAGERIE, SOLDIERS EVOLUTION; Sports: DRIVER ANNIE, RIDER CADDYSHACK; Travel: BOONDOCK BALLROOM, LEATHERNECKS DWARFS', 2),
(14, 'VIVIEN', 'BERGEN', 'Action: DRIFTER COMMANDMENTS, EXCITEMENT EVE, HILLS NEIGHBORS; Animation: CLASH FREDDY, DONNIE ALLEY; Children: GORGEOUS BINGO, POLISH BROOKLYN; Classics: LOVELY JINGLE, LOVER TRUMAN, WESTWARD SEABISCUIT; Drama: HOBBIT ALIEN; Foreign: TRAP GUYS; Games: DIRTY ACE, TYCOON GATHERING; Horror: DRUMS DYNAMITE, HIGH ENCINO, JAPANESE RUN, KENTUCKIAN GIANT, STREETCAR INTENTIONS; Music: DRIVING POLISH, ENEMY ODDS, IMPACT ALADDIN; New: SALUTE APOLLO, STOCK GLASS, VOICE PEACH; Sports: CRANES RESERVOIR, MUSSOLINI SPOILERS, SATURDAY LAMBS, TIGHTS DAWN; Travel: ITALIAN AFRICAN', 1),
(15, 'CUBA', 'OLIVIER', 'Action: MONTEZUMA COMMAND, WEREWOLF LOLA; Animation: BORROWERS BEDAZZLED, FLYING HOOK, LUKE MUMMY, THEORY MERMAID; Children: EMPIRE MALKOVICH, MAKER GABLES, NOON PAPI; Classics: BOUND CHEAPER, HYDE DOCTOR; Comedy: KNOCK WARLOCK; Family: APACHE DIVINE, SIEGE MADRE; Foreign: HELLFIGHTERS SIERRA, KISS GLORY; Games: DIVINE RESURRECTION, VOLCANO TEXAS; Horror: EGYPT TENENBAUMS; New: BUTCH PANTHER, OKLAHOMA JUMANJI; Sci-Fi: SOLDIERS EVOLUTION, UNFORGIVEN ZOOLANDER, WONDERLAND CHRISTMAS; Sports: ROSES TREASURE; Travel: CASSIDY WYOMING, FUGITIVE MAGUIRE, SHANE DARKNESS', 2),
(16, 'FRED', 'COSTNER', 'Action: EASY GLADIATOR, ENTRAPMENT SATISFACTION, REAR TRADING; Animation: CAROL TEXAS, INCH JET, MIRACLE VIRTUAL, MISSION ZOOLANDER, THEORY MERMAID; Children: EMPIRE MALKOVICH; Classics: MAGNIFICENT CHITTY; Documentary: BROTHERHOOD BLANKET, DELIVERANCE MULHOLLAND; Drama: DECEIVER BETRAYED, SAINTS BRIDE; Family: BLANKET BEVERLY, EARRING INSTINCT, GABLES METROPOLIS; Foreign: IMPOSSIBLE PREJUDICE; Games: HUMAN GRAFFITI; New: CLEOPATRA DEVIL, EAGLES PANKY; Sci-Fi: CONNECTICUT TRAMP, WEEKEND PERSONAL; Sports: IMAGE PRINCESS, KRAMER CHOCOLATE, SENSE GREEK; Travel: BOONDOCK BALLROOM', 1),
(17, 'HELEN', 'V


jeste si zkusim zaregistrovat jinou novou domenu, protze na ty co to mam to mam ve slozkach takze by to i mohlo byt odkazovanim. ted musim cekat nez bude aktivni...


no tak tim to taky neni. porad je bila obrazovka...


http://www.voting.8u.cz/
Sennin
Profil
Milan Sobotka:
Preto to nič nezobrazuje pretože tabuľku síce vytvorenú máte ale nemáte v nej nič (tabuľka neni naplnená ničím takže to nemá ani čo zobraziť) takže vojdete do tabuľky hore v menu klik na Import vyberiete si voting.sql a klik na vykonaj teraz by tabuľka mala byť naplnená a mala by sa zobraziť aj stránka mne to na prvú šupu zafungovalo :)

a ešte aby som nezabudol

Css súbor

/* general styling */
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-font-smoothing: antialiased;
  -o-font-smoothing: antialiased;
  font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body{
  font: 12px Arial,Tahoma,Helvetica,FreeSans,sans-serif;
  text-transform: inherit;
  color: #333;
  background: #e7edee;
  width: 100%;
}
.wrap{
  width: 720px;
  margin: 15px auto;
  padding: 15px 10px;
  background: white;
  border: 2px solid #DBDBDB;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  overflow: hidden;
}

a{ text-decoration: none; color: #333}
h1{
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 2.8em;
  text-align: center;
  margin: 25px 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
h2{font-size: 1.5em; margin: 8px 0}
.item{
  clear: both;
  margin:0;
  padding: 10px;
  overflow: hidden;
  border-top: 1px solid #DBDBDB;
}
.item:last-child{border-bottom:1px solid #DBDBDB}
.item:hover{background: #f9f9f9}
.post{
  width: 600px;
  float: right;
  overflow: hidden;
}
.post p{text-transform: lowercase;}

/* voting style */
.vote-span{
  width: 60px;
  float: left;
  margin: 5px 0;
}
.vote, .vote-score{
  clear: both;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-align: center;
  color: #333;
  font-size: 1.8em;
  font-weight: bold;
}
.vote-score{cursor: text}

a index.php

<?php
include('config.php');
# connect mysql db
dbConnect();
$query = mysql_query(
  'SELECT id, first_name, last_name, film_info, vote
  FROM  voting
  LIMIT 0 , 15');
?>
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>jQUery Voting System</title>
  <link rel="stylesheet" type="text/css" href="style.css">
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="js/script.js"></script>
</head>
<body>
  <div class="wrap">
    <?php while($row = mysql_fetch_array($query)): ?>
    <div class="item" data-postid="<?php echo $row['id'] ?>" data-score="<?php echo $row['vote'] ?>">
      <div class="vote-span"><!-- voting-->
        <div class="vote" data-action="up" title="Vote up">
          <i class="icon-chevron-up"></i>
        </div><!--vote up-->
        <div class="vote-score"><?php echo $row['vote'] ?></div>
        <div class="vote" data-action="down" title="Vote down">
          <i class="icon-chevron-down"></i>
        </div><!--vote down-->
      </div>

      <div class="post"><!-- post data -->
        <h2><?php echo $row['first_name'].' '.$row['last_name']?></h2>
        <p><?php echo $row['film_info'] ?></p>
      </div>
    </div><!--item-->
    <?php endwhile?>
  </div>
  <?php dbConnect(false); ?>
</body>
</html>
Milan Sobotka
Profil
No tak jsem to tak udelal ale porad bilo. a ten index a css? to uz tam snad mam... :D
Sennin
Profil
Milan Sobotka:
Živá ukážka :) moja stránka
Milan Sobotka
Profil
a to jsi delal ty? nebo kde to je? :D
Sennin
Profil
Milan Sobotka:
Hej to je na mojej stránke takže asi nemáš naplnenú tabuľku keďže to nič nezobrazuje
Milan Sobotka
Profil
ale mam. presne jak jsi rikal jsem to udelal. a jsou tam nejaky veci.. a jak tak na to koukam tak to koukam tak to nefunguje. dam like a po znovu nacteni to tam uz neni...
Sennin
Profil
tak počkaj zobrazí ti to stránku alebo máš problém pri hlasovaní?
Milan Sobotka
Profil
no me to nezobrazi nic. mam prazdnou stranku a jak sis to udelal ty tak jsem to zousel a po refresi uz tam to like zase nebilo...


Paneboze ja jsem kokot!!! :D :D :D :D :D :D :D :D ja sem nevymazal v konfig ty popisky...


no ale stejne to nefunguje. kdyz dam like, tak se to prida a kdyz na tu stranku vztoupim znova tak uz tam ten like dalsi neni...


nevis cim by to nahodou mohlo bejt?


Ono z ty stranky zrejmne nefunguje vic veci, ted zase zkousim komenty a zase se to neulozi! http://www.koments.8u.cz/ a nebo je neco spatne s db moji...

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: