Jump to content

For and Insert


karker

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

$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++

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.