tippytarka
Programmer
using an array within a mysql query??
i'm using a select multiple html menu ....the user has a choice of selections where any number of those selections can be contained into the array "job_title_id[]" ...which then goes to the msql query below. currently the mysql query captures only the first selection hence.... $job_title_id[0]. how do i adjust the query (or i guess the $job_title_id[0] array inside the query?) to capture all the selected content?
$sql_job_title_count = ("SELECT COUNT(*) FROM p1_list_creative
WHERE p1_list_creative.country_id = '".$country_id."'
AND p1_list_creative.job_title_id = '".$job_title_id[0]."'");
$result_job_title_count = mysql_query($sql_job_title_count);
$num_job_title_count = mysql_result($result_job_title_count,0,0);
print ($num_job_title_count);
cheers!
i'm using a select multiple html menu ....the user has a choice of selections where any number of those selections can be contained into the array "job_title_id[]" ...which then goes to the msql query below. currently the mysql query captures only the first selection hence.... $job_title_id[0]. how do i adjust the query (or i guess the $job_title_id[0] array inside the query?) to capture all the selected content?
$sql_job_title_count = ("SELECT COUNT(*) FROM p1_list_creative
WHERE p1_list_creative.country_id = '".$country_id."'
AND p1_list_creative.job_title_id = '".$job_title_id[0]."'");
$result_job_title_count = mysql_query($sql_job_title_count);
$num_job_title_count = mysql_result($result_job_title_count,0,0);
print ($num_job_title_count);
cheers!