hulp bij simpele fotopagina
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?
//-- maak eerst de connectie met de database!
$user = "****";
$pass = "****";
$host = "****";
$dbdb = "****";
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
unset($user);
unset($pass);
unset($host);
unset($dbdb);
$resultaten = mysql_query("SELECT *
FROM `album`
WHERE `soort` = 'interieur'");
while ($gegevens = mysql_fetch_object($resultaten))
{
$id = ($gegevens->id);
$foto = ($gegevens->foto);
$fotogroot = ($gegevens->fotogroot);
$soort = ($gegevens->soort);
echo "
<table width=\"475\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"25\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"25\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"25\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
</tr>
<tr>
<td colspan=\"15\" height=\"5\"></td>
</tr>
</table>
\n";
}
?>
//-- maak eerst de connectie met de database!
$user = "****";
$pass = "****";
$host = "****";
$dbdb = "****";
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
unset($user);
unset($pass);
unset($host);
unset($dbdb);
$resultaten = mysql_query("SELECT *
FROM `album`
WHERE `soort` = 'interieur'");
while ($gegevens = mysql_fetch_object($resultaten))
{
$id = ($gegevens->id);
$foto = ($gegevens->foto);
$fotogroot = ($gegevens->fotogroot);
$soort = ($gegevens->soort);
echo "
<table width=\"475\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"25\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"25\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"25\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
<td width=\"10\"></td>
<td width=\"45\"><img src=\"$foto\" border=\"0\"></td>
</tr>
<tr>
<td colspan=\"15\" height=\"5\"></td>
</tr>
</table>
\n";
}
?>
En unset() kan je voor meedere vars gebruiken.
unset($var1, $var2, $var3, $etc);
ja maar die tussen kolommen zijn heel belangrijk voor de uitlijning
(Je stoort me tijdens m'n Nederlands huiswerk, ^^)
ok thanks
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
# Database gegevens
$user = "****";
$pass = "****";
$host = "****";
$dbdb = "****";
# Connectie leggen
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
# Unsetten
unset($user);
unset($pass);
unset($host);
unset($dbdb);
# Query
$resultaten = mysql_query("SELECT * FROM `album` WHERE `soort` = 'interieur'");
# Tabel starten
echo '<table width="475" border="0" cellpadding="0" cellspacing="0"><tr>';
# Loopje
while($data = mysql_fetch_array($resultaten)
{
echo '<td width="45"><img src="' . $data['foto'] . '" border="0"></td>';
echo '<td width="10"> </td>';
}
# Tabel eindigen
echo '</tr></table>';
?>
# Database gegevens
$user = "****";
$pass = "****";
$host = "****";
$dbdb = "****";
# Connectie leggen
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
# Unsetten
unset($user);
unset($pass);
unset($host);
unset($dbdb);
# Query
$resultaten = mysql_query("SELECT * FROM `album` WHERE `soort` = 'interieur'");
# Tabel starten
echo '<table width="475" border="0" cellpadding="0" cellspacing="0"><tr>';
# Loopje
while($data = mysql_fetch_array($resultaten)
{
echo '<td width="45"><img src="' . $data['foto'] . '" border="0"></td>';
echo '<td width="10"> </td>';
}
# Tabel eindigen
echo '</tr></table>';
?>
werkt niet???? blanco pagina
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?
//-- maak eerst de connectie met de database!
$user = "***";
$pass = "***";
$host = "***";
$dbdb = "***";
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
unset($user);
unset($pass);
unset($host);
unset($dbdb);
$resultaten = mysql_query("SELECT * FROM `album` WHERE `soort` = 'interieur'");
$aantalFotos = mysql_num_rows($resultaten);
echo "<table width=\"475\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
for($i=0;$i<$aantalFotos;$i+=8){
echo "<tr>";
for($j=0;$j<8;$j++){
$fotoNaam=mysql_result($r,$i+$j,"foto");
echo "<td><img src='".$fotoNaam."' border=0></td>";
}
echo "</tr>";
}
echo "</table>";
?>
//-- maak eerst de connectie met de database!
$user = "***";
$pass = "***";
$host = "***";
$dbdb = "***";
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
unset($user);
unset($pass);
unset($host);
unset($dbdb);
$resultaten = mysql_query("SELECT * FROM `album` WHERE `soort` = 'interieur'");
$aantalFotos = mysql_num_rows($resultaten);
echo "<table width=\"475\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
for($i=0;$i<$aantalFotos;$i+=8){
echo "<tr>";
for($j=0;$j<8;$j++){
$fotoNaam=mysql_result($r,$i+$j,"foto");
echo "<td><img src='".$fotoNaam."' border=0></td>";
}
echo "</tr>";
}
echo "</table>";
?>
Je src is niet goed dan, check die maar eens ...
En ook nog die kolommen ertussen (10 pixels en 25 pixels)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?
//-- maak eerst de connectie met de database!
$user = "***";
$pass = "***";
$host = "***";
$dbdb = "***";
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
unset($user);
unset($pass);
unset($host);
unset($dbdb);
$resultaten = mysql_query("SELECT * FROM `album` WHERE `soort` = 'interieur'");
$aantalFotos = mysql_num_rows($resultaten);
echo "<table width=\"475\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
for($i=0;$i<$aantalFotos;$i+=8){
echo "<tr>";
for($j=0;$j<8;$j++){
$fotoNaam=mysql_result($resultaten,$i+$j,"foto");
echo "<td><a href=\"foto.php?id=$id\"><img src='".$fotoNaam."' border=0></a></td>";
}
echo "</tr>";
}
echo "</table>";
?>
//-- maak eerst de connectie met de database!
$user = "***";
$pass = "***";
$host = "***";
$dbdb = "***";
if (!mysql_select_db($dbdb, mysql_connect($host, $user, $pass)))
{
echo "Kan geen verbinding maken met de database.";
exit();
}
unset($user);
unset($pass);
unset($host);
unset($dbdb);
$resultaten = mysql_query("SELECT * FROM `album` WHERE `soort` = 'interieur'");
$aantalFotos = mysql_num_rows($resultaten);
echo "<table width=\"475\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
for($i=0;$i<$aantalFotos;$i+=8){
echo "<tr>";
for($j=0;$j<8;$j++){
$fotoNaam=mysql_result($resultaten,$i+$j,"foto");
echo "<td><a href=\"foto.php?id=$id\"><img src='".$fotoNaam."' border=0></a></td>";
}
echo "</tr>";
}
echo "</table>";
?>