Jump to content

Unknown column '8190ef16bc01b56546027a349806ad2a' in 'where clause'


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>";
}
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.