NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page SQL issue to display 1 product in 2 places

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 12-03-2010, 09:01 AM THREAD STARTER               #1 (permalink)
Senior Member
 
Ziggery.com's Avatar
Join Date: Feb 2008
Location: 192.168.1.1
Posts: 2,719
Ziggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond repute
 



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)
Ziggery.com is offline   Reply With Quote
Old 12-03-2010, 11:20 AM   #2 (permalink)
NamePros Member
Join Date: Nov 2006
Location: Toronto
Posts: 136
Blindkilla has a spectacular aura aboutBlindkilla has a spectacular aura about
 



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.
Blindkilla is offline   Reply With Quote
Old 12-03-2010, 12:58 PM THREAD STARTER               #3 (permalink)
Senior Member
 
Ziggery.com's Avatar
Join Date: Feb 2008
Location: 192.168.1.1
Posts: 2,719
Ziggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond repute
 



Originally Posted by Blindkilla View Post
Can't you just build a query like:
????: NamePros.com http://www.namepros.com/programming/690073-sql-issue-display-1-product-2-a.html

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.

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)
Ziggery.com is offline   Reply With Quote
Old 12-03-2010, 05:52 PM   #4 (permalink)
NamePros Regular
 
baxter's Avatar
Join Date: Apr 2006
Posts: 360
baxter is just really nicebaxter is just really nicebaxter is just really nicebaxter is just really nice
 


Ethan Allen Fund Save The Children
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" />
then in aspx get the item element from the request and extract the arrays keys.
????: 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>)
I'm not a aspx coder but you can use its join function I believe to get the comma seperated id's from the array.

Hope that helps

Jay
__________________
Canadian Domain Registrar Ready.ca
baxter is offline   Reply With Quote
Old 12-04-2010, 06:02 PM   #5 (permalink)
JFS
NamePros Regular
 
JFS's Avatar
Join Date: Oct 2005
Location: Portugal
Posts: 886
JFS has much to be proud ofJFS has much to be proud ofJFS has much to be proud ofJFS has much to be proud ofJFS has much to be proud ofJFS has much to be proud ofJFS has much to be proud ofJFS has much to be proud ofJFS has much to be proud of
 



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
}
with that all that are checked its passed onto the second page and you can treat that easy.
????: 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
JFS is offline   Reply With Quote
Old 12-04-2010, 06:16 PM THREAD STARTER               #6 (permalink)
Senior Member
 
Ziggery.com's Avatar
Join Date: Feb 2008
Location: 192.168.1.1
Posts: 2,719
Ziggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond reputeZiggery.com has a reputation beyond repute
 



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)
Ziggery.com is offline   Reply With Quote
Reply


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

 
All times are GMT -7. The time now is 02:40 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger