CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 2102|Reply: 4

mintak tolong..

[Copy link]
Post time 2-10-2007 12:06 PM | Show all posts |Read mode
askum..
honey nk mtk tolong..
cmne nk copy data dr row yg sblmnye tuk row baru dlm table ..
tuk setiap table dlm database tuh..
gune mysql..
honey wat system gune php..
Reply

Use magic Report


ADVERTISEMENT


Post time 2-10-2007 01:00 PM | Show all posts
maksudnya ni nak copy ke new table ke dalam satu database?
Reply

Use magic Report

Post time 2-10-2007 01:03 PM | Show all posts
selalu aku buat mcm n je...........sapa ada cara lain leh kongsi

$sql1="select data from table";
$result1=mysql_query($sql1);
while($row1=mysql_fetch_assoc($result1)) {
  $sql2="insert into newtable newdata=$row1";
  $result2=mysql_query($sql2);
}
Reply

Use magic Report

Post time 3-10-2007 07:54 PM | Show all posts
kalau dua table tuh identical... kira sama field atau susunan field... boleh pakai gini kot sql statement dia..


INSERT INTO <first_table_name> Values(SELECT * FROM <second_table_name>)


nih sql statement dia je... ikut suka hati nak guna dalam language apa...
Reply

Use magic Report

Post time 4-10-2007 08:50 AM | Show all posts
Biasanya kalau table to table sql state lebih kurang mcm ni
insert into table1 select * from table2

kalau guna variable barulah
insert into table1 values('1', '2')
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

5-1-2025 08:33 AM GMT+8 , Processed in 0.042457 second(s), 18 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list