I have an url which is looking like following:
http://url/app/my.php?my=1,2&limit=2&lastid=0
Where the my paramater length can vary, but is always seperated by a comma. This i would like to add into a mysql query, which i've tried to do like following:
$limit = $_GET['limit'];
$lastid = $_GET['lastid'];
$my = $_GET['my'];
$all_news = $con->prepare("SELECT news.id, news.title, news.url, news.image_url, news.date, news.news_text, news.referer_img from news, team, contain WHERE team.id in (?) AND team.id = contain.team_id AND contain.news_id = news.id ORDER BY news.date DESC LIMIT ?, ?");
$all_news->bind_param("iii", $my, $lastid, $limit);
$all_news->execute();
$all_news->bind_result($id, $title, $url, $image_url, $date, $news_text, $referer_img);
I've tried both binding it as a string and int, but te $my array does not seem to work in the query? do i need to explode it and then implode the $my array? or what am i doing wrong?