.. finde den Fehler nicht. Kann mir wer helfen?
Who could help me here. Am parsing values with Sessions ... put them into vars and try to echo them ..
It all works fine with :
but in the moment when I extend the WHERE-condition LIKE THIS
Here is the whole php-file:
<!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" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Fast Fertig!</title>
</head>
<body>
</body>
</html>
Who could help me here. Am parsing values with Sessions ... put them into vars and try to echo them ..
It all works fine with :
PHP-Code:
$sql = "SELECT * FROM `customers`
WHERE c_company = '$cname'
";
PHP-Code:
$sql = " SELECT * FROM `customers`
WHERE
c_company = '$cname' AND c_name = '$pname'
";
.. the page stays blank !
Here is the whole php-file:
PHP-Code:
<?php
session_start();
$cname = $_SESSION["con"];
$fname = $_SESSION["fan"];
$pname = $_SESSION["prn"];
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Fast Fertig!</title>
</head>
<body>
PHP-Code:
<?php
$server = 'www.website.at';
$user = 'user';
$pw = 'pw';
$db = 'database';
$verbindung = mysqli_connect($server, $user, $pw);
if ($verbindung){
mysqli_select_db($verbindung, $db);
if (mysqli_error($verbindung)){
echo 'Fehler: '.mysqli_error($verbindung);
}else {
$sql = "
SELECT * FROM `customers`
WHERE
c_company = '$cname' AND
c_name = '$pname'
";
$abfrage = mysqli_query($verbindung, $sql);
while($ev_rec = mysqli_fetch_assoc($abfrage)){
echo '<div>';
echo '<div>';
echo 'Kundennummer: 1963'.$ev_rec['iddb_customer'].'<br>';
echo '<div class="r_align">Firma: '.$ev_rec['c_company'].'</div>';
echo '<div class="r_align">Name: '.$ev_rec['c_famname']." ".$ev_rec['c_name'].'</div>';
echo '<br>';
echo '</div>';
echo '</div>';
}
mysqli_free_result($abfrage);
}
}else {
echo 'Verbindungsfehler: ' . mysqli_connect_error($verbindung);
}
mysqli_close($verbindung);
session_destroy();
?>
</body>
</html>
Kommentar