Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Dupliciranje mysql unosa

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
ToDD



Joined: 05 May 2005
Posts: 83
Location: Zagreb

PostPosted: 28.03.2006 22:16    Post subject: Dupliciranje mysql unosa Add user to your forum ignore list Reply with quote

Evo kako najlakše napraviti da dupliciram neki unos?

znaci imam jedan unos i može li se nekako napravit isti takav da ovog uopće ne SELECTiram.


ako s te me skuzili Very Happy
Back to top
View user's profile Send private message MSN Messenger
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 28.03.2006 22:37    Post subject: Add user to your forum ignore list Reply with quote

pa okini dva inserta i bok:)

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
Granda



Joined: 11 Aug 2005
Posts: 51

PostPosted: 29.03.2006 09:09    Post subject: Add user to your forum ignore list Reply with quote

Ako želiš iste podatke a drugačiji ID okini dva puta insert, no ako hočeš dva puta isti ID onda moraš raditi select.
Back to top
View user's profile Send private message
Adrian



Joined: 02 Apr 2004
Posts: 692
Location: Around & about

PostPosted: 29.03.2006 11:14    Post subject: Add user to your forum ignore list Reply with quote

Nisam siguran za sintaksu, al pošto pretpostavljam da si možda mislio da dupliciraš unos neko vrijeme nakon što je unešen u bazu, a ne odmah (za što su ti dečki već odgovorili),

INSERT INTO tablica ( SELECT * FROM tablica WHERE id = 12 )

Sintaksa naravno ne ide ovako, trebalo bi naredbu podesit stvarnoj tablici, ali možda ti "nesting" iliti "učahuravanje" upita pomogne.

_________________
The quest for certainty blocks the search for meaning. Uncertainty is the very condition to impel a man to unfold his powers.
http://origami.hr
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 29.03.2006 11:30    Post subject: Add user to your forum ignore list Reply with quote

Ne trebaju zagrade kod INSERT ... SELECT jer to nije subquery Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 29.03.2006 15:19    Post subject: Add user to your forum ignore list Reply with quote

Granda wrote:
Ako želiš iste podatke a drugačiji ID okini dva puta insert, no ako hočeš dva puta isti ID onda moraš raditi select.


Zapravo ne moraš, mysql_insert_id()...
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 29.03.2006 15:27    Post subject: Add user to your forum ignore list Reply with quote

ToDD: meni dupliciranje jednog te istog unosa smrdi na nekaj loše. Ne mogu zamislit situaciju u kojoj aplikacija duplicira row pri unosu a da to ima nekog smisla
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Granda



Joined: 11 Aug 2005
Posts: 51

PostPosted: 29.03.2006 16:37    Post subject: Add user to your forum ignore list Reply with quote

Quote:
meni dupliciranje jednog te istog unosa smrdi na nekaj loše. Ne mogu zamislit situaciju u kojoj aplikacija duplicira row pri unosu a da to ima nekog smisla


Recimo hočeš site na beskonačno jezika, a svi podaci su ti u bazi...
Back to top
View user's profile Send private message
ToDD



Joined: 05 May 2005
Posts: 83
Location: Zagreb

PostPosted: 29.03.2006 21:25    Post subject: Add user to your forum ignore list Reply with quote

ma ovo je fora.

dupliciram privatnu poruku i dupliciranom unosu stavim kao spremljenu( duplicirani unos mijenjam Very Happy). jer mi mogu i primatelj i pošiljatelj spremit pa bi bilo problema.

uglavnom Adrian mi je riješio problem. hvala svima
Back to top
View user's profile Send private message MSN Messenger
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 29.03.2006 22:47    Post subject: Add user to your forum ignore list Reply with quote

Pa vidiš da sam znao da si loše to smislio. Jer istu poruku duplicirati samo zato što je referencirana sa dva mjesta je nadasve glupo Confused mislim, to je ista poruka, ne? a nakon slanja je ni pošiljatelj ni primatelj ne može editirati, tako da će i ostati ista do kraja

Ako znaš normalne forme (database normalization) jasno ti je da dva usera mogu referencirat istu stvar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ToDD



Joined: 05 May 2005
Posts: 83
Location: Zagreb

PostPosted: 30.03.2006 18:38    Post subject: Add user to your forum ignore list Reply with quote

gle, jedan spremi poruku iz inboxa, a ovaj koji je slao iz outboxa. i oboje spreme u spremljeno.
e sad ovaj jedan pobrise tu poruku i jebga Very Happy
Back to top
View user's profile Send private message MSN Messenger
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 30.03.2006 18:50    Post subject: Add user to your forum ignore list Reply with quote

Pobriše referencu, a ne poruku.
Kad se zadnja referenca makne onda garbage-collectaš poruke za izbrisat (nešto kao u dynamic typed jezicima)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group