[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
Pagina 1 van 1

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

BerichtGeplaatst: 09 aug 2006 11:50
door libia
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??

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

BerichtGeplaatst: 09 aug 2006 12:35
door Remi
[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.

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

BerichtGeplaatst: 09 aug 2006 12:43
door libia
nu staat er helemaal niks achter de n ..

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

BerichtGeplaatst: 09 aug 2006 12:45
door Rik
[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?

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

BerichtGeplaatst: 09 aug 2006 12:48
door libia
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

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

BerichtGeplaatst: 09 aug 2006 12:55
door libia
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 ??

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

BerichtGeplaatst: 09 aug 2006 14:52
door Remi
[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.

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

BerichtGeplaatst: 09 aug 2006 15:03
door libia
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

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

BerichtGeplaatst: 09 aug 2006 15:08
door libia
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

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

BerichtGeplaatst: 09 aug 2006 15:57
door Remi
HEt lijkt er op $result niet klopt of de query die er achter hangt. COntroleer of alles met je database/ table klopt.

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

BerichtGeplaatst: 09 aug 2006 17:16
door libia
had ik al geprobeerd.. maar ik heb het voor de zekerheid nog een keer geprobeerd..

in mijn mysql werkt het wel gewoon!

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

BerichtGeplaatst: 09 aug 2006 17:32
door libia
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..

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

BerichtGeplaatst: 10 aug 2006 22:49
door libia
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]