Lid |
|
Hoi,
Ik wou berichten ophalen uit mn inbox en heb de volgende code, alleen... krijg dus een syntax fout en ik zie em niet.
<?php
session_start();
include_once('config.php');
if($logged_in == 1)
{
$db->query("SELECT * FROM leden WHERE username = '".$_SESSION['user']."' AND hash = '".$_SESSION['hash']."' AND `ip` = '".$client['ip']."' LIMIT 1") or die (mysql_error());
$rij = $db->fetch();
// inbox
$query = mysql_query("SELECT * FROM inbox WHERE to = '".$rij->username."'") or die (mysql_error());
while ($show = mysql_fetch_object())
{
echo $show->date." ".$show->subject." ".$rij->from."<a href='roman_area.php?messageid=".$rij->messageid."'>[Delete]</a><br />";
}
}
?>
<?php include_once('config.php'); if($logged_in == 1) { $db->query("SELECT * FROM leden WHERE username = '".$_SESSION['user']."' AND hash = '".$_SESSION['hash']."' AND `ip` = '".$client['ip']."' LIMIT 1") or die (mysql_error()); $rij = $db->fetch(); // inbox { echo $show->date." ".$show->subject." ".$rij->from."<a href='roman_area.php?messageid=".$rij->messageid."'>[Delete]</a><br />"; } } ?>
Dit is de fout:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to = ''' at line 1
|