Wow!
This all sounds great but I'm in a process of getting it all fit together in my mind.
So what I've got right now is a table where I output article titles from my database.
Next to each article I put a check box where I write each particular article's uniques ID:
<input type=checkbox name=aID value=".$ad->ads_id.">
So I assume at the end I'll put a submit button that will get checked values and place it into my quiry string, right?
I use a class to make calls to my db so my code may look a bit different. Normally, if I had one value, my code will look like this:
if ($articles = $db->get_results("SELECT * FROM myArticles WHERE art_id = $aID"))
{
foreach ($articles as $art)
{
echo $art->art_title."<p>".$art->art_summary;
}
}
else {
echo "No results";
}
So given all the great suggestions should my code be looking somewhat like that?
if ($articles = $db->get_results("SELECT * FROM myArticles WHERE art_id IN (';
$in = array();
foreach ($_POST['aID'] as $box) {
$in[] = $box;
}
$articles .= implode(',', $in) . ')';"))
{
foreach ($articles as $art)
{
echo $art->art_title."<p>".$art->art_summary;
}
}
else {
echo "No results";
}
So as you can see I was not sure where and how to include magic_quotes_gpc and addslashes / stripsplashes.
I need help putting this masterpiece together!