Bezig met een site, ik krijg geen resultaten uit mijn database
Ik ben bezig met een portfoliosite, en een tijdje lang kreeg ik mijn resultaten te zien. Nu niet meer. Ziet iemand een fout in mijn coding? :(
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css"/>
<title>Jake Rowsell</title>
</head>
<body>
<div id="container">
<div id="logo"> <a href="index.php"><img src="logo.png" border="0px"/></a></div>
<div id="menu"> <a href="about.php"><img src="about.png" border="0px" /></a> <a href="select.php"><img src="portfolio.png" border="0px" /> </a> </div>
<div id="maincontent">
</div>
<div id="filtermenu">
<form action="select.php" method="post">
Search:
<p>
<input name="Graphic" type="checkbox" value="yes" />
Graphic<br />
<input name="Interactive" type="checkbox" value="yes"/>
Interactive<br />
<input name="Websites" type="checkbox" value="yes" />
Websites</p>
Sort by:
<p>
<input name="group1" type="radio" value="DATE DESC"/>
Newest<br />
<input name="group1" type="radio" value="DATE ASC" />
Oldest<br />
<input name="group1" type="radio" value="VIEWS" />
Most viewed</p>
<input name="Search!" type="submit" value="Filter" id="button"/>
</form>
</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css"/>
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
error_reporting(E_ALL);
include("connection.php");
if(isset($_POST['Graphic']) &&
$_POST['Graphic'] == 'yes')
{
$result1 = "graphic";
}
if(isset($_POST['Interactive']) &&
$_POST['Interactive'] == 'yes')
{
$result2 = "interactive";
}
if(isset($_POST['Websites']) &&
$_POST['Websites'] == 'yes')
{
$result3 = "websites";
}
$order = $_POST['group1'];
$result = mysql_query("SELECT * FROM jake_portfolio WHERE CAT = '$result1' OR CAT = '$result2' OR CAT ='$result3' ORDER BY $order LIMIT 0,4");
$checked = "checked";
?>
error_reporting(E_ALL);
include("connection.php");
if(isset($_POST['Graphic']) &&
$_POST['Graphic'] == 'yes')
{
$result1 = "graphic";
}
if(isset($_POST['Interactive']) &&
$_POST['Interactive'] == 'yes')
{
$result2 = "interactive";
}
if(isset($_POST['Websites']) &&
$_POST['Websites'] == 'yes')
{
$result3 = "websites";
}
$order = $_POST['group1'];
$result = mysql_query("SELECT * FROM jake_portfolio WHERE CAT = '$result1' OR CAT = '$result2' OR CAT ='$result3' ORDER BY $order LIMIT 0,4");
$checked = "checked";
?>
<title>Jake Rowsell</title>
</head>
<body>
<div id="container">
<div id="logo"> <a href="index.php"><img src="logo.png" border="0px"/></a></div>
<div id="menu"> <a href="about.php"><img src="about.png" border="0px" /></a> <a href="select.php"><img src="portfolio.png" border="0px" /> </a> </div>
<div id="maincontent">
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
<?php
while($row = mysql_fetch_array($result)){ ?>
<div id="workpreview">
<div id="previewimage"><img src="<?php echo $row['IMG']; ?>" /></div>
<div id="previewtitle"><?php echo $row['TITLE']; ?></div>
<div id="previewdesc"><?php echo $row['DESCR']; ?></div>
</div>
<?php }; ?>
while($row = mysql_fetch_array($result)){ ?>
<div id="workpreview">
<div id="previewimage"><img src="<?php echo $row['IMG']; ?>" /></div>
<div id="previewtitle"><?php echo $row['TITLE']; ?></div>
<div id="previewdesc"><?php echo $row['DESCR']; ?></div>
</div>
<?php }; ?>
</div>
<div id="filtermenu">
<form action="select.php" method="post">
Search:
<p>
<input name="Graphic" type="checkbox" value="yes" />
Graphic<br />
<input name="Interactive" type="checkbox" value="yes"/>
Interactive<br />
<input name="Websites" type="checkbox" value="yes" />
Websites</p>
Sort by:
<p>
<input name="group1" type="radio" value="DATE DESC"
Code (php)
Newest<br />
<input name="group1" type="radio" value="DATE ASC" />
Oldest<br />
<input name="group1" type="radio" value="VIEWS" />
Most viewed</p>
<input name="Search!" type="submit" value="Filter" id="button"/>
</form>
</div>
</div>
</body>
</html>
Gewijzigd op 14/09/2011 17:21:54 door Jake rowsell
- Toon relevante code
- Zet ze tussen [code] en [/code]-tags
- Zet ze tussen [code] en [/code]-tags
Er is dus een soort filteroptie om verschillende categorien te bekijken en te organiseren, die zichzelf onthoud, maar de resultaten doen het niet meer..
Toevoeging op 14/09/2011 17:22:45:
/\ gedaan, Ook zie ik bij mijn webadmin het volgende:
Error
The additional features for working with linked tables have been deactivated. To find out why click here.
PMA Database ... not OK[ Documentation ]
General relation features Disabled
Toevoeging op 14/09/2011 17:22:45:
/\ gedaan, Ook zie ik bij mijn webadmin het volgende:
Error
The additional features for working with linked tables have been deactivated. To find out why click here.
PMA Database ... not OK[ Documentation ]
General relation features Disabled
Zie mijn vorige post.
Ik denk dat het probleem in de verbinding met de tables zit? Ik krijg met dit:
niets te zien..
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?php
include("connection.php");
$res = mysql_query("SELECT * FROM jake_portfolio");
while($row = mysql_fetch_array($res)){
echo $res['ID'];
}
?>
include("connection.php");
$res = mysql_query("SELECT * FROM jake_portfolio");
while($row = mysql_fetch_array($res)){
echo $res['ID'];
}
?>
niets te zien..
echo $row['ID'];
Gewijzigd op 14/09/2011 18:25:38 door Robert dat ben ik
Ohja, Robert, thanks, maar hij doet het nog niet. :/ Ik heb de connection getest, en die doet het wel, maar hij laat niets uit de tables zien?! Ik begin te denken dat er iets mis is met de database?
Maak er eens een nette foutafhandeling bij.
En zet je code eens tussen codetags....




