[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - Waarschijnlijk hele domme fout.. maar het lukt niet :P
aan alle goede dingen komt een eind, webmasterplein.net 2003 - 2013
wij danken jullie voor al mooie momenten die dankzij dit forum ontstonden - Derk, Rutger en Stef

Waarschijnlijk hele domme fout.. maar het lukt niet :P

Je komt er niet helemaal uit bij het scripten? Übergoede functie geschreven? Alles met betrekking tot scripting, kun je hier terecht.

Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 11:50

hallo iedereen.

ik heb een klein stukje php script in mijn menu dat maar niet wilt werken
hier de code:
[code="php"]<?php
$gb_id = $_SESSION['gb_id'];
include("dbconnect.php");
$query1 = "SELECT clanID FROM gebruiker WHERE gb_id = '$gb_id'";
$clanslct = mysql_query($query1) or die(mysql_error());
$query2 = "SELECT naam FROM clan WHERE ID = '$clanslct'";
$result = mysql_query($query2) or die(mysql_error());
if(mysql_fetch_array($result) != '0'){
echo "<li><a class=\"menu\" href=\"index.php?p=clnprfl&n=" . $result . "\">Clan Profiel</a></li>";
}
?>[/code]

de bedoeling is dus dat het script eerst de clan selecteerd die bij de gebruiker hoort.
dan kijkt hij of het niet clan 0 is..
als dat niet zo is dan laat hij een link ziet (de n in de link staat voor naam van de clan).. alleen inplaats van de naam staat er Resource id #8

ik weet echt niet wat dat inhoud en ik weet ook niet wat ik dus moet doen om het te laten zien zoals ik wil!

nou dat was het zoon beetje! dus weet iemand het??
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor Remi » 09 aug 2006 12:35

[code="php"]<?php
$gb_id = $_SESSION['gb_id'];
include("dbconnect.php");
$query1 = "SELECT clanID FROM gebruiker WHERE gb_id = '$gb_id'";
$clanslct = mysql_query($query1) or die(mysql_error());
$query2 = "SELECT naam FROM clan WHERE ID = '$clanslct'";
$result = mysql_query($query2) or die(mysql_error());
if(mysql_fetch_array($result) != '0'){
echo "<li><a class=\"menu\" href=\"index.php?p=clnprfl&n=" . $result['naam']. "\">Clan Profiel</a></li>";
}
?>[/code]

Zo dacht ik.
Avatar gebruiker
Remi
wmpr
 
Berichten: 3010
Geregistreerd: 04 apr 2006 15:22

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 12:43

nu staat er helemaal niks achter de n ..
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor Rik » 09 aug 2006 12:45

[code="php"]<?php
$gb_id = $_SESSION['gb_id'];
include("dbconnect.php");
$query1 = "SELECT clanID FROM gebruiker WHERE gb_id = '$gb_id'";
$clanslct = mysql_query($query1) or die(mysql_error());
$query2 = "SELECT naam FROM clan WHERE ID = '$clanslct'";
$result = mysql_query($query2) or die(mysql_error());
if(mysql_fetch_array($clanslct) != '0'){
echo "<li><a class=\"menu\" href=\"index.php?p=clnprfl&n=" . $result['naam']. "\">Clan Profiel</a></li>";
}
?>[/code]
Mischien dit?
Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 12:48

nope.. krijg nu een warning:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/wp/ingame/menu.php on line 14
[code="php"] if(mysql_fetch_array($result['naam']) != '0'){[/code] = line 14
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 12:55

ik kom er net ook achter dat de controle of het niet 0 is ook niet werkt.

komt mischien doordat Resource id #8 niet hetzelfde is als 0 ??
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor Remi » 09 aug 2006 14:52

[code="php"]<?php
gb_id = $_SESSION['gb_id'];
include("dbconnect.php");
$query1 = "SELECT * FROM gebruiker WHERE gb_id = '$gb_id'";
$clanslct = mysql_query($query1) or die(mysql_error());
$query2 = "SELECT * FROM clan WHERE ID = '$clanslct'";
$result = mysql_query($query2) or die(mysql_error());
if(mysql_fetch_array($clanslct) != '0'){
echo "<li><a class=\"menu\" href=\"index.php?p=clnprfl&n=" . $result['naam']. "\">Clan Profiel</a></li>";
}
?> [/code]
Probeer is even dit.
Avatar gebruiker
Remi
wmpr
 
Berichten: 3010
Geregistreerd: 04 apr 2006 15:22

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 15:03

dit kan lijkt me niet.. want bij $query2 moet hij het dus doen als ID hetzelfde is als alles van gebruiker!

maar ik zal het voor de zekerheid toch ff proberen Wink
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 15:08

nee sorry.. dit werkt ook niet.

en ik heb het ook ff wel hetzelfde als die van jouw, alleen dan in $query1 de * vervangen voor clanID en dat werkt ook niet Sad
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor Remi » 09 aug 2006 15:57

HEt lijkt er op $result niet klopt of de query die er achter hangt. COntroleer of alles met je database/ table klopt.
Avatar gebruiker
Remi
wmpr
 
Berichten: 3010
Geregistreerd: 04 apr 2006 15:22

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 17:16

had ik al geprobeerd.. maar ik heb het voor de zekerheid nog een keer geprobeerd..

in mijn mysql werkt het wel gewoon!
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 09 aug 2006 17:32

hmm..
ik heb het denk ik al een beetje door..
in profiel.php gebruik ik dit:
[code="php"]$query = "SELECT gb_id, functie, clanID, actief FROM gebruiker WHERE gb_id = '$gb_id'";
$result = mysql_query($query) or die(mysql_error());[/code]
als ik dan $result echo krijg ik Resource id #11 als antwoord.. maar profiel.php werkt wel (waarscheinlijk) dankzij [code="php"]while ($row = mysql_fetch_array($result)){
[/code]
want waar ik een gegeven uit de database wil laten zien gebruik ik $row['gegeven_dat_ik_wil_laten_zien'] ..

ik zou alleen niet weten hoe ik dat in mijn menu wil laten gebruiken!

PS.: ik heb gewoon $row = mysql_fetch_array($result); en $row = mysql_fetch_array($clanslct); al geprobeert maar dat werkt niet..
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Waarschijnlijk hele domme fout.. maar het lukt niet :P

Berichtdoor libia » 10 aug 2006 22:49

ik (eigenlijk mijn vader) heb het probleem opgelost!!

het was eigenlijk niet echt moeilijk Razz

[code="php"]<?php
$gb_id = $_SESSION['gb_id'];
include("dbconnect.php");

$sql = "SELECT c.naam AS naam FROM gebruiker g, clan c WHERE g.clanID = c.ID AND g.clanID != 0 AND gb_id = '$gb_id'";
$result = mysql_query($sql);
$nrows = mysql_num_rows($result);
if($nrows == 1) {
$row = mysql_fetch_array($result);
$naam=$row['naam'];

echo "<li><a class=\"menu\" href=\"index.php?p=clnprfl&n=" . $naam . "\">Clan Profiel</a></li>";
}
?>[/code]
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!


Keer terug naar PHP, ASP, SQL



cron