Hi there, I'm having two big issues to achieve my objective.
1st Issue:
I have an external source that allows a user to insert 0 or more keywords which are posted to a PHP file with this names: keyword0, keyword1, keyword2, etc... How do I get this files in PHP ?
I know if it was just one keyword I could retrieve it like this:
Syntax:
$keyword=$_POST[keyword];
But in this case it can be 0, just 1 or "infinite" keywords. Can you help me please?
2nd Issue:
Once I have this keyword values ''stored'' in php variables e.g. ($keyword0, $keyword1, etc) I need to make a query to my DB with this multiple possible keywords. I already have an N-to-N relationship set. It's something like this:
Picture
P_ID Pic
1 LA.jpg
2 NY.jpg
3 MI.jpg
4 SE.jpg
5 DA.jpg
Keywords
K_ID Keywords
1 beach
2 sun
3 cold
4 hot
5 sea
PicKey
PK_ID P_ID K_ID
1 1 1
2 1 2
3 1 4
4 1 5
5 2 3
5 2 5
I know for example for one keyword it would be something like :
Syntax:
mysql_query("SELECT P.Pic FROM Picture P, Keywords K, PicKey PK WHERE P.P_ID=PK.P_ID AND K.K_ID=PK.K_ID AND K.Keyword="beach"
But how about for multiple keywords ? Which can be one or more depending on the number of keywords posted by the user.
I would really appreciate some help with this. Everything is blury for me know. I don't have enough knowledge to complete this.
Thank you very much