karker Posted June 2, 2011 Share Posted June 2, 2011 hi; $giden = $_GET['sehir_part']+1; $url = '31.php?sehir_part='.$giden.''; //$erkek_top = 7 for($q=1;$q<=7;$q++) { //i want insert into to mysql in here ; but its doing only one inserting so i want be 7 more insert } header( 'refresh:1;url=31.php?sehir_part='.$giden) and in every page loading i want inserting to mysql againg pls helpme thx Quote Link to comment Share on other sites More sharing options...
mikesta707 Posted June 2, 2011 Share Posted June 2, 2011 Ok. think about what you are asking for a minute, and what information you have given us. No one here knows what you want to insert, what your database table looks like, what information needs to go into it, etc. How can you expect us to help you if all you do is show us a for loop and say "I want to insert something, halp!". What do you expect us to tell you? If you are looking for a tutorial on mysql inserts, there is one here: http://www.tizag.com/mysqlTutorial/mysqlinsert.php But without more information, we really can't help you Quote Link to comment Share on other sites More sharing options...
karker Posted June 2, 2011 Author Share Posted June 2, 2011 for($q=1;$q<=7;$q++) { mysql_query("INSERT INTO cud_uyelik (`nickname`, `sifresi`, `isim`, `cinsiyet`, `sexsual_tercih`, `resim`, `sehir`, `d_tarih`, `meslek`, `medeni_durum`, `sigara`, `alkol`, `mail`, `operator`, `tel`, `vucut_tipi`, `boy`, `kilo`, `fanclup`, `kendi_hakkinda`, `ip`, `tip`, `yetki`, `arkadaslari`, `paket`, `araba`, `begenilme`, `hikayeleri`, `gelir`, `line`, `goz_rengi`, `block_id`, `sms`, `mesaj`, `sms_filitre`, `g_foto`, `onay`, `yorum`, `ilan` ) VALUES ('$nickname', '$sifresi', '$isim', '$cinsiyet', '$sexsual_tercih', '$resim', '$sehir', '$d_tarih', '$mesleki', '$medeni_durum', '$sigara', '$alkol', '$mail', '$operator', '$tel', '$vucud_tipi', '$boy', '$kilo', '$fanclup', '$kendi_hakkinda', '$ip', '$tip', 'b', '$arkadaslari', '$paket', '$arabasi', '$begenilme', '$hikayeleri', '$geliri', '$line', '$goz_rengi', '$block_id', '$sms', '$mesaj', '$sms_filitre', '$g_foto' , 'h' , '$yorum' , '$ilan' );"); // every things are okey but if i use query i am only taking a registing to mysql but i want 6 more registing to mysql with loop in a page loading } Quote Link to comment Share on other sites More sharing options...
teynon Posted June 2, 2011 Share Posted June 2, 2011 karker, Lets try this like the old high school english teachers used to say. Write your question like you are writing an essay for school. Tell us what you want to do. Tell us how you are attempting to do it. Then tell us again what you attempted to do. In the second part, include all of your script information. I will be standing by with the red pen to grade your essay. Tom Quote Link to comment Share on other sites More sharing options...
karker Posted June 2, 2011 Author Share Posted June 2, 2011 tom my English may be less but my query is only 1 record in the loop I have to loop from 1 to 7 indicated that for($q=1;$q<=7;$q++) Why not register 7 with for loop if uoı know the answer this question pls share it is ok ? Quote Link to comment Share on other sites More sharing options...
Maq Posted June 2, 2011 Share Posted June 2, 2011 tom my English may be less but my query is only 1 record in the loop I have to loop from 1 to 7 indicated that for($q=1;$q Why not register 7 with for loop if uoı know the answer this question pls share it is ok ? I really don't understand a word you said. If I had to take a wild guess from the lack of information you provided, you're inserting the SAME values each time, if you have a primary key or index then it won't insert. Put or die(mysql_error()) at the end of your query call. Quote Link to comment Share on other sites More sharing options...
teynon Posted June 2, 2011 Share Posted June 2, 2011 Karker, I give you an F. Explain it in your language and I will translate it for everyone else. Tom. Quote Link to comment Share on other sites More sharing options...
Drummin Posted June 2, 2011 Share Posted June 2, 2011 Sounds like he wants to insert seven copies of the same into his DB. Quote Link to comment Share on other sites More sharing options...
karker Posted June 2, 2011 Author Share Posted June 2, 2011 i am dont give any error i want 7 record to myql in for loop ! it is being only 1 record to mysql what is the wrong word in this sentence Quote Link to comment Share on other sites More sharing options...
karker Posted June 2, 2011 Author Share Posted June 2, 2011 Sounds like he wants to insert seven copies of the same into his DB. thats true Quote Link to comment Share on other sites More sharing options...
Drummin Posted June 2, 2011 Share Posted June 2, 2011 $q=1; while($q<=7) { mysql_query("INSERT INTO cud_uyelik (`nickname`, `sifresi`, `isim`, `cinsiyet`, `sexsual_tercih`, `resim`, `sehir`, `d_tarih`, `meslek`, `medeni_durum`, `sigara`, `alkol`, `mail`, `operator`, `tel`, `vucut_tipi`, `boy`, `kilo`, `fanclup`, `kendi_hakkinda`, `ip`, `tip`, `yetki`, `arkadaslari`, `paket`, `araba`, `begenilme`, `hikayeleri`, `gelir`, `line`, `goz_rengi`, `block_id`, `sms`, `mesaj`, `sms_filitre`, `g_foto`, `onay`, `yorum`, `ilan` ) VALUES ('$nickname', '$sifresi', '$isim', '$cinsiyet', '$sexsual_tercih', '$resim', '$sehir', '$d_tarih', '$mesleki', '$medeni_durum', '$sigara', '$alkol', '$mail', '$operator', '$tel', '$vucud_tipi', '$boy', '$kilo', '$fanclup', '$kendi_hakkinda', '$ip', '$tip', 'b', '$arkadaslari', '$paket', '$arabasi', '$begenilme', '$hikayeleri', '$geliri', '$line', '$goz_rengi', '$block_id', '$sms', '$mesaj', '$sms_filitre', '$g_foto' , 'h' , '$yorum' , '$ilan' );"); $q++ } Quote Link to comment Share on other sites More sharing options...
karker Posted June 2, 2011 Author Share Posted June 2, 2011 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.