| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Feb 2008 Location: 192.168.1.1
Posts: 2,719
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | SQL issue to display 1 product in 2 places Hi all, Just running into a small issue with displaying a product, here's the scenario: Page 1 lists ALL of the inventory Page 2 is suppose to list ONLY the inventory we want to list via a checkbox from the back end BUT it also has to display on Page 1 So in a nutshell. All inventory on page 1, only selected inventory on page 2. My programmer is scratching his head on this one, I think he's been at his computer too long LOL btw, the pages are in aspx with a SQL server DB. Thanks ~Z
__________________ Kruncher.com - For Sale At Sedo - 14 Years Old. Ziggery.com for sale, offers welcome (Domain name Only) |
| | |
| | #2 (permalink) |
| NamePros Member Join Date: Nov 2006 Location: Toronto
Posts: 136
![]() ![]() | Can't you just build a query like: Select * from inventory where inventory id = 1 or id = 2 or id = 3 Just substituting and adding on more OR clauses for the amount of check boxes previously selected. |
| | |
| | THREAD STARTER #3 (permalink) | ||||
| Senior Member Join Date: Feb 2008 Location: 192.168.1.1
Posts: 2,719
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
That's exactly what I said to him, I think he's having a brain fart or something!! I'll take all suggestions to this issue, apart from get another programmer LOL
__________________ Kruncher.com - For Sale At Sedo - 14 Years Old. Ziggery.com for sale, offers welcome (Domain name Only) | ||||
| | |
| | #4 (permalink) |
| NamePros Regular Join Date: Apr 2006
Posts: 360
![]() ![]() ![]() ![]() | Basically on page 1 you have a list of items, in the checkbox use the input like follows: Code: <input type="checkbox" name="item[<ITEMID>]" value="1" /> ????: NamePros.com http://www.namepros.com/showthread.php?t=690073 In the following page use the sql: Code: Select * from inventory where inventory id IN (<ITEM IDS SEPERATED BY COMMA>) Hope that helps Jay
__________________ Canadian Domain Registrar Ready.ca |
| | |
| | #5 (permalink) |
| NamePros Regular Join Date: Oct 2005 Location: Portugal
Posts: 886
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | on the page that lists all you have all your checkbox itens numbered. on the second page ( this is php but its easy to convert to asp or alike ): Code: while ($sql_1=mysql_fetch_array($your_query_string)){
$contador = $contador +1;
if(isset($_POST['C'.$contador]) && $_POST['C'.$contador] == 'ON'){
//that checked what checkbox was active, and since you did list them all at above...
$item_name=$sql_1['property_name'];
// and such :P
} ????: NamePros.com http://www.namepros.com/showthread.php?t=690073 i did that a long time ago and you can improve it, but it works ( no security or such there but you get the point ). also its 2 am i may sound a bit confusing sorry
__________________ João Fernandes Silva Free Resources - Image Hosting - Allergy Info Hosting - NP-Hosting.com - in beta, accepting orders |
| | |
| | THREAD STARTER #6 (permalink) |
| Senior Member Join Date: Feb 2008 Location: 192.168.1.1
Posts: 2,719
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You guys all rock....Thanks to everyone who contributed this...Now working like a charm
__________________ Kruncher.com - For Sale At Sedo - 14 Years Old. Ziggery.com for sale, offers welcome (Domain name Only) |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re-invent Launches FREE SQL 2005 Hosting | reinventme | Web Hosting Offers | 0 | 04-20-2006 09:51 AM |
| Website and Application Content Databases | odditysoftware | Content For Sale | 8 | 01-20-2006 04:34 AM |
| Connecting to your SQL Database using Enterprise Manager | priyanka[imported] | Web Hosting Discussion | 1 | 12-07-2004 03:21 PM |