PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 23rd, 2004, 10:18 AM
tarka tarka is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 15 tarka User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Code:
$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!

Reply With Quote
  #2  
Old August 23rd, 2004, 10:32 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
Create a loop (probably a for loop) that goes through all entries in the array appending ' OR field=value' in the appropriate place in your sql.

Hope this helps,

-KM-

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > using an array within a mysql query??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway