Tik systeem

Gestart doorShahiem11 reacties42 weergaven

12 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hi,

Voor mijn Harry Potter site, heb ik een Tik systeem gemaakt. emoMaar hij weergeeft maar 1 bericht, kan iemand me daarbij helpen.

$tik = $core->mysql->query("SELECT * FROM tikken WHERE id = ".$_GET[id]);
        while($fetche = $core->mysql->fetch($tik))
        {
            
            $tik1 = $core->mysql->query("SELECT naam FROM leden WHERE id = ".$_GET[id]);
            $fetche1 = $core->mysql->fetch($tik1);
            
            $tik2 = $core->mysql->query("SELECT naam FROM leden WHERE id = ".$fetche[lid_id]);
            $fetche2 = $core->mysql->fetch($tik2);
            
            echo <h1>Tikken</h1>
            .ucfirst(htmlentities($fetche2[naam])). .$core->mysql->escape($fetche[actie]). .ucfirst(htmlentities($fetche1[naam])).<br />;
        
        }
0
Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet een while gebruiken in je qeury. (denk dat je die al hebt)
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
heb je een dump van je tabel? santabaard
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Machine: localhost
-- Genereertijd: 27 Jun 2010 om 18:20
-- Serverversie: 5.1.36
-- PHP-Versie: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `hc`
--

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

--
-- Tabelstructuur voor tabel `tikken`
--

CREATE TABLE IF NOT EXISTS `tikken` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lid_id` int(11) NOT NULL,
  `actie` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Gegevens worden uitgevoerd voor tabel `tikken`
--

INSERT INTO `tikken` (`id`, `lid_id`, `actie`) VALUES
(1, 1, schopt),
(2, 1, kietelt),
(3, 1, knuffelt),
(4, 1, knuffelt);
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$tik = $core->mysql->query("SELECT * FROM tikken WHERE lid_id = ".$_GET[id]);
        while($fetche = $core->mysql->fetch($tik))
        {
            
            $tik1 = $core->mysql->query("SELECT naam FROM leden WHERE id = ".$_GET[id]);
            $fetche1 = $core->mysql->fetch($tik1);
            
            $tik2 = $core->mysql->query("SELECT naam FROM leden WHERE id = ".$fetche[lid_id]);
            $fetche2 = $core->mysql->fetch($tik2);
            
            echo <h1>Tikken</h1>
            .ucfirst(htmlentities($fetche2[naam])). .$core->mysql->escape($fetche[actie]). .ucfirst(htmlentities($fetche1[naam])).<br />;
        
        }
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
oja, dankjewel biggrin
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
emoGraag gedaan heur biggrin
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ah, nu krijg ik:

Notice: Undefined variable: fetche2 in C:wampwwwhogwartsprofiel.php on line 85
mept Shahiem

Notice: Undefined variable: fetche2 in C:wampwwwhogwartsprofiel.php on line 86
knijpt Shahiem

Notice: Undefined variable: fetche2 in C:wampwwwhogwartsprofiel.php on line 87
kietelt Shahiem

Notice: Undefined variable: fetche2 in C:wampwwwhogwartsprofiel.php on line 88
zoent Shahiem

Notice: Undefined variable: fetche2 in C:wampwwwhogwartsprofiel.php on line 89
knuffelt Shahiem



Notice: Undefined variable: fetche2 in C:wampwwwhogwartsprofiel.php on line 90


Code:

$tik1 = $core->mysql->query("SELECT * FROM leden WHERE id = ".$_GET[id]."") or die(mysql_error());
        $fetche1 = $core->mysql->fetch($tik1);
        
        $tik = $core->mysql->query("SELECT lid_id FROM tikken WHERE lid_id = ".$_GET[id]) or die(mysql_error());

        while($fetche = $core->mysql->fetch($tik))
        {    
        
            $tik2 = $core->mysql->query("SELECT naam FROM leden WHERE id = ".$fetche[lid_id]."") or die(mysql_error());
            $fetche2 = $core->mysql->fetch($tik2);
            
            echo .ucfirst(htmlentities($fetche2[naam])). .$core->mysql->escape(htmlentities($fetche[actie])). .ucfirst(htmlentities($fetche1[naam])).<br />;
        }
            echo <h1>Tik .ucfirst(htmlentities($fetche1[naam])).</h1>;
                    
        if(isset($_POST[submit]))
        {
            
            $errorMelding = ;
            
            if(trim($_POST[actie]) === )
            {
                $errorMelding .= Welke actie wil je nou doen?;
            }
            
                if(!empty($errorMelding))
                {
                    echo <br /><div class="error">.$errorMelding.</div>;
                }
                else
                {
                    $core->mysql->query("INSERT INTO
                                    tikken
                                (
                                    lid_id,
                                    actie
                                    
                                ) VALUES (
                                    ".$core->leden->ledeninfo[eigen][id].",
                                    ".$core->mysql->escape(htmlentities($_POST[actie]))."
                                ) ") or die(mysql_error());
                                    
                                    echo <div class="goede-melding">Je hebt succesvol getikt!</div>;
                }
            }
    ?>
    <form action="" method="post">
    
        <INPUT TYPE=radio name=actie value=mept selected=selected> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?> mept [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?></input><br />
        <INPUT TYPE=radio name=actie value=knijpt> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?> knijpt [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?></input><br />
        <INPUT TYPE=radio name=actie value=kietelt> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?> kietelt [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?></input><br />
        <INPUT TYPE=radio name=actie value=zoent> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?> zoent [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?></input><br />
        <INPUT TYPE=radio name=actie value=knuffelt> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?> knuffelt [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?></input><br />
        <INPUT TYPE=radio name=actie> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?>  <INPUT TYPE=text class="text" name=actie value= maxlength=30> [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetche1[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]));[/COLOR] ?></input><br /><br />
             <input type="submit" class="text" name="submit" value="- Tik -" />
         </form>
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$fetche2 bestaat alleen in de while wink
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maar als ik hem uitt de while haal, lukt ie ook nietconfused
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
En als je er $fetche1 van maakt?
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan komt er je eigen id te staan.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren