Hallo,
Ik ben voor een website bezig met een script om onder andere woordenlijsten uit een database te halen maar nu geeft ie deze error als ik naar de pagina ga:
Dit is de code van de pagina:
Dit is een dump van de tabel waar de gegevens instaan:
Iemand een idee wat de fout is?
Alvast Bedankt!
Ik ben voor een website bezig met een script om onder andere woordenlijsten uit een database te halen maar nu geeft ie deze error als ik naar de pagina ga:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in WAARHETSCRIPTSTAAT.php on line 12 Dit is de code van de pagina:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/defined"]defined[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]DIRECT_URL[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../includes/config.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$url[/COLOR] [COLOR= #007700]=[/COLOR] DIRECT_URL [COLOR= #007700].[/COLOR] [COLOR= #DD0000]index.php?p=woordenlijstbekijk[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: $url"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$wordlistsql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `wordlists` WHERE `id` = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$id[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wordlistsql[/COLOR][COLOR= #007700])) {[/COLOR]
[COLOR= #0000BB]$wordlist[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$worlistsql[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$wordlist[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]leerjaar[/COLOR][COLOR= #007700]];
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Voer aub een id in[/COLOR][COLOR= #007700];
}[/COLOR]
?> Dit is een dump van de tabel waar de gegevens instaan:
-- phpMyAdmin SQL Dump
-- version 2.11.9.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generatie Tijd: 23 Jun 2009 om 15:25
-- Server versie: 5.0.67
-- PHP Versie: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `test`
--
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `wordlists`
--
CREATE TABLE IF NOT EXISTS `wordlists` (
`id` int(11) NOT NULL auto_increment,
`leerjaar` int(8) NOT NULL,
`book` varchar(255) NOT NULL,
`chapter` varchar(255) NOT NULL,
`uid_of_writer` varchar(255) NOT NULL,
`wordlist` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Gegevens worden uitgevoerd voor tabel `wordlists`
--
INSERT INTO `wordlists` (`id`, `leerjaar`, `book`, `chapter`, `uid_of_writer`, `wordlist`) VALUES
(1, 3, Blaat, 8, 1, Test); Iemand een idee wat de fout is?
Alvast Bedankt!

