homepage Welcome to WebmasterWorld Guest from 54.205.247.203
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Value in a dropdown box
jebriskham




msg:4482638
 5:09 pm on Aug 7, 2012 (gmt 0)

Wonder if anyone here can help please. I posted this query on another forum a few days ago, but haven't really got the answer to my problem.

I am a complete novice with PHP and require some assistance if possible please.

This URL pulls up a stats page for a local football club. There are several different match types, League, Cup etc. If you select the "All" option it gives all results including; Bounce Game, Friendly and Testimonial.

[briskham.co.uk...]

I would like to add another option in the Match Type drop-down list that will be called "All Competitive" and for this to include all match types apart from; Friendly, Bounce Game, Testimonial - MatchTypeID - 6, 8 and 9.

I understand that I think I need a statement along the lines of:

"WHERE MatchTypeId NOT IN (6,8,9)"

But I haven't got a clue how to structure this, or where to add it.

The block of script that currently makes the call is as follows:

?>
</select>
<select name="matchtype">
<option value="0"><?= $txt_all ?></option>
<?php
while($data = mysql_fetch_array($get_types))
{
if($data['MatchTypeID'] == $defaultmatchtypeid)
echo "<option value=\"$data[MatchTypeID]\" SELECTED>$data[MatchTypeName]</option>\n";
else
echo "<option value=\"$data[MatchTypeID]\">$data[MatchTypeName]</option>\n";
}
mysql_free_result($get_types);
?>

Could someone help put together the code I need so that this will work please?

Many thanks

 

jebriskham




msg:4483022
 6:10 pm on Aug 8, 2012 (gmt 0)

Hi folks - would really appreciate it if someone could help me out with this one please.

mvaz




msg:4483222
 3:38 pm on Aug 9, 2012 (gmt 0)

Hi jebriskham

The selection options are derived from the database, so you will need to modify the database and then structure your query as required.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved