Re: PHP control structure
| From: | Tamara Temple | Date: | Thu, 14 Jul 2011 02:33:53 +0000 |
| Subject: | Re: PHP control structure | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314051@lists.php.net to get a copy of this message | ||
On Jul 12, 2011, at 10:11 PM, Chris Stinemetz wrote:
Hey all, I would like to add an if statement to the following function so that the value 1 is assigned "corporate" and the value is 2 assign "standard" to it. Would you show me an example on adding it to the below function? If there is a better way to reassign the value please share. Thank you, Chris public function ShowType() { $sql = "SELECT DISTINCT store_type FROM store_list WHERE id_markets=$_POST[id]"; $res = mysql_query($sql,$this->conn); $Type = '<option value="0">store type...</option>'; while($row = mysql_fetch_array($res)) { $Type .= '<option value="' . $row['id_store'] . '">' . $row['store_type'] . '</option>'; } return $Type; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpI'm really not at all clear what you want to do here. Where and how are the values going to be used? Where is it determined something is "corporate" or "standard"? What do these things mean in the context of your application?