Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-04-2011, 05:03 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 106
somequestion is on a distinguished road
Default About mysql problem

I'd like to make format string when table is updated.

there are 2 table member and item.

member table
-memberId
-PurchasedItems

item table
-itemId
-memberId

if query is like below i want to add format string like "1,2" to itemList in member table.
so how can i change this?
Code:
SELECT distinct itemId FROM `item` WHERE memberId = 1123
// item 1,2

and also make it trigger to update automatically.
how can i change this too??
Code:
CREATE TRIGGER `member_item_Trigger` BEFORE INSERT ON `item`
 FOR EACH ROW BEGIN
 
UPDATE member SET itemList = (SELECT distinct itemId FROM item WHERE memberId = NEW.memberId)  WHERE memberId = New.memberId;

END;
somequestion is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 479
15 members and 464 guests
7twenty7, AlanFloyd, AppsBlogger, David-T, HemiMG, iAppDeveloper, imac74, Jaxen66, lovoyl, mutantskin, Paul Slocum, SLIC, solardrift, unicornleo, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,683
Threads: 94,131
Posts: 402,932
Top Poster: BrianSlick (7,990)
Welcome to our newest member, unicornleo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:16 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0