I dont know whether it's a duplicate one or not?
Here is what i'm trying:
<?php
session_start();
include('db.php');
$valid_data=$_POST['data'];
if(isset($_POST['data']))
{
$list = isset($_SESSION['strtpnt1']) ? $_SESSION['strtpnt1'] : array();
$_SESSION['strtpnt1'][] =$valid_data;
$a=implode(',',$_SESSION['strtpnt1']);
}
?>
when i use print_r for $_SESSION['strtpnt1'] i could see like this:
array (size=5)
0 => string 'trivandrum' (length=10)
1 => string 'kochi' (length=5)
2 => string 'nagercoil' (length=9)
3 => string 'thrissur' (length=8)
I found nothing wrong with that
when i echoed the imploded variable i find the value like this:
trivandrum,kochi,nagercoil,thrissur
When i tested the imploded data in wampserver phpmyadmin's sql like this i could get an error message:
select start from tbl_place where start NOT IN(trivandrum,kochi,nagercoil,thrissur)
the error message is:
Unknown column 'trivandrum' in 'where clause'
But the query works when string value is passed ie 'trivandrum','kochi' etc.
i dont know what is wrong with my query ...here is the query part
$sql21 = "select start from tbl_place where start NOT IN('".$a."')";