Jump to content

Unknown column '8190ef16bc01b56546027a349806ad2a' in 'where clause'


jnerotrix

Recommended Posts

Ok my last topic was to big 6 pages it got confusing

 

I am making a survey site that after you click on a survey its supposed to be hidden to the user who clicked it

 

I currently get this error and i dont know how to fix it

 

Unknown column '8190ef16bc01b56546027a349806ad2a' in 'where clause'

 

8190ef16bc01b56546027a349806ad2a is the member id... it has a hash

8190ef16bc01b56546027a349806ad2a = 0

 

What my thing does is saves member_id and survey_id to table completed_surveys

and its supposed to check if the user has already seen this survey and if they have then it doesnt show it so heres the code i have for it

 

not sure whats wrong

 

<?php
mysql_connect("localhost", "sex1800_admin", "***") or die(mysql_error()); //add you password
mysql_select_db("sex1800_loginbux") or die(mysql_error());

$query = "SELECT * FROM survey JOIN completed_surveys ON survey.id!=completed_surveys.survey_id WHERE member_id={$_SESSION['userid']}";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<tr><td><a href=\"survey.php?id={$row['id']}\">{$row['title']}</a></td></tr>";
}
?>

 

<?php
mysql_connect("localhost", "sex1800_admin", "***") or die(mysql_error()); //add you password
mysql_select_db("sex1800_loginbux") or die(mysql_error());

$query = "SELECT * FROM survey JOIN completed_surveys ON survey.id!=completed_surveys.survey_id WHERE member_id='{$_SESSION['userid']}'";
$result = mysql_query($query) or die(mysql_error());

echo mysql_num_rows($result);

die();
while($row = mysql_fetch_array($result)){
echo "<tr><td><a href=\"survey.php?id={$row['id']}\">{$row['title']}</a></td></tr>";
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.