Hallo allemaal,

Ik ben bezig met een pagina waarop alle ledengegevens staan van een Virtual Airlines. Ik wil deze gegevens mooi weergeven in een tabel. Er staan nu 3 test leden in de database en het script weergeeft ook mooi 3 tabellen, maar hij laat de gegevens niet zien. (nu alleen nog aan het begin van de tabel: $rij->pilootnummer) Hij laat dat gewoon als tekst zien, ik heb al vanalles geprobeerd maar het lukt me niet om het goed te doen. (note: ben pas begonnen met php ;D)

Kunnen jullie mij helpen?

<?php 
					include ("data.inc");
$global_dbh = mysql_connect($hostname, $username, $password); 
mysql_select_db($db, $global_dbh);

$sql = "SELECT * FROM airbelgium";
$res = mysql_query($sql);

while ($rij = mysql_fetch_object($res))
{ echo'<table border="0" width="100%">
						<tr>
							<td colspan="4" bgcolor="#C0C0C0">
							<p align="center">
							<font face="Century Gothic" size="2">Member Pilot 
							ID: ABB $rij->pilootnummer</font></td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Pilot ID</font></td>
							<td width="25%" bgcolor="#F8F8F8">
							<font face="Century Gothic" size="2">ABB</font></td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Flight 
							Simulator</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Name</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">IVAO Member</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Sex</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">IVAO</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Date of Birth</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">VATSIM</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Country</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Globalsim</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">City</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">FPI</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Email</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="50%" bgcolor="#F8F8F8" colspan="2">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">MSN</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">ABB Admin</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">ICQ</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">ABB Admin ID</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="100%" bgcolor="#F8F8F8" colspan="4">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Flown Hours</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Previous VA 
							Name</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Rules Acception</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Previous VA 
							Pilot ID</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">User Comments</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Previous VA 
							Flown Hours</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="25%" bgcolor="#EFEFEF">&nbsp;</td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
							<td width="25%" bgcolor="#EFEFEF">
							<font face="Century Gothic" size="2">Previous VA 
							Website</font></td>
							<td width="25%" bgcolor="#F8F8F8">&nbsp;</td>
						</tr>
						<tr>
							<td width="100%" bgcolor="#EFEFEF" colspan="4">&nbsp;</td>
						</tr>
						<tr>
							<td width="100%" bgcolor="#FFFFFF" colspan="4">&nbsp;</td>
						</tr>
						<tr>
							<td width="100%" bgcolor="#FFFFFF" colspan="4">&nbsp;</td>
						</tr>
<tr>
							<td width="100%" bgcolor="#FFFFFF" colspan="4">&nbsp;</td>
						</tr>
					</table>';}
?>
Alle variablen tussen de haakjes uit halen.

Voorbeeld:
$rij->pilootnummer
daar maken wij even van:
'.$rij->pilootnummer.'

Dat zou moeten werken. Veel succes er mee!
probeer eens: $rij['pilootnummer']; ipv: $rij->pilootnummer
Jelmer schreef op 02.06.2005 20:38

$rij->pilootnummer
daar maken wij even van:
'.$rij->pilootnummer.'


Hey dat werkt!

Ikzelf had al eens geprobeerd ".$rij->pilootnummer." maar dat werkte niet, dus ik dacht dat het met ' ook niet zou werken, maar dus toch.

Hartstikke Bedankt!

(hier kan wat mij betrefd een slotje op)
Zim schreef op 02.06.2005 20:39
probeer eens: $rij['pilootnummer']; ipv: $rij->pilootnummer


Hij gebruikt toch echt fetch_object...
ff opgezocht op php.net, was verward met fetch_array! tanx

Reageren