Hi all,
I have given my code here and it's updating the database slowly.
Can you give me some other logic.
comparing talble has 3million rows. i shoud update 1million rows.
it's taking 4 seconds to load one row..it's very slow.
please help me
[PHP]<?php
mysql_connect(" localhost", "root", "sudr");
mysql_select_db ("adsd");
$query_1 = "select ID from al_ao";
$result_1 = mysql_query($qu ery_1);
while($row = mysql_fetch_arr ay($result_1)) {
$zinc_id = $row['ZincID'];
$query_2 = "select Mwt, Xlogp, apol, pol, donors, acceptor, psa, netcharge, rb, smiles from tproperty where zincId = '$zinc_id'";
$result_2 = mysql_query($qu ery_2);
while($row1 = mysql_fetch_arr ay($result_2)) {
$query_3 = "update al_ao set Mwt='$row1[Mwt]', Xlogp='$row1[Xlogp]', Apol='$row1[apol]', Pol='$row1[pol]', Donor='$row1[donors]', Acceptor='$row1[acceptor]', Psa='$row1[psa]', Netcharge='$row 1[netcharge]', Rb='$row1[rb]', Smiles='$row1[smiles]' where ZincID = '$zinc_id'";
mysql_query($qu ery_3) or die("couldn't insert values");
}
}
?>[/PHP]
					I have given my code here and it's updating the database slowly.
Can you give me some other logic.
comparing talble has 3million rows. i shoud update 1million rows.
it's taking 4 seconds to load one row..it's very slow.
please help me
[PHP]<?php
mysql_connect(" localhost", "root", "sudr");
mysql_select_db ("adsd");
$query_1 = "select ID from al_ao";
$result_1 = mysql_query($qu ery_1);
while($row = mysql_fetch_arr ay($result_1)) {
$zinc_id = $row['ZincID'];
$query_2 = "select Mwt, Xlogp, apol, pol, donors, acceptor, psa, netcharge, rb, smiles from tproperty where zincId = '$zinc_id'";
$result_2 = mysql_query($qu ery_2);
while($row1 = mysql_fetch_arr ay($result_2)) {
$query_3 = "update al_ao set Mwt='$row1[Mwt]', Xlogp='$row1[Xlogp]', Apol='$row1[apol]', Pol='$row1[pol]', Donor='$row1[donors]', Acceptor='$row1[acceptor]', Psa='$row1[psa]', Netcharge='$row 1[netcharge]', Rb='$row1[rb]', Smiles='$row1[smiles]' where ZincID = '$zinc_id'";
mysql_query($qu ery_3) or die("couldn't insert values");
}
}
?>[/PHP]
Comment