Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'option'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. Hi everyone. I'm trying to echo the values of an array inside HTML's <option> tag. The following should be echod: <option value="Moose Jaw,SK,Canada">Moose Jaw,SK,Canada</option> <option value="Prince Albert,SK,Canada">Prince Albert,SK,Canada</option> <option value="Regina,SK,Canada">Regina,SK,Canada</option> <option value="Saskatoon,SK,Canada">Saskatoon,SK,Canada</option> The code I attempted was: <!DOCTYPE html> <html> <body> <?php $sk=array("Saskatoon","Regina","Moose Jaw", "Prince Albert"); sort($sk); foreach ($sk as $value) { echo '<option value="'.$value.',SK,Canada">'.$value.',SK,Canada</option>'; echo "<br>"; } ?> </body> </html> Pls. note that the values of the array are not sorted alphabetically. The output, however, should be sorted in ascending format and be within the <option> tag after adding the province and country. Any help will be highly appreciated.
  2. Hi everyone, I'm building my own shopping website. I haven't figured out how to populate two dropdown lists with available sizes and colors of a product_id from database. Here is the result I've got from querying database. id product_name style size color price image sku stock 1 Neck Top 104 S White $30.00 104.jpg 104-1 5 2 Neck Top 104 S Black $30.00 104.jpg 104-2 5 3 Neck Top 104 M Red $30.00 104.jpg 104-3 10 4 Neck Top 104 L Blue $30.00 104.jpg 104-4 10 5 Neck Top 104 XL Black $30.00 104.jpg 104-5 5 And here are my tables: tblProduct tblSizes tblColors tblSpecific_Products id id id id product_name size color product_id style size_id price color_id image stock category (tops,dresses,bottoms,...) subcategory (bodycon,work,evening,cocktail) Is there any way I can have it done without duplicating the values in each dropdown list? Also for each product_id, how can I store 3 different images (front view,back view and side view) for each color? Does it mean I have to create another attribute table for those images and store their names in database? I'm confused.
×
×
  • Create New...