Käynnissä

php mySQL optimise code

Change the following code achieve same result faster :

// eqcodes table contains about 11000 records

// slcodes table contains about 600 records

$sql = "SELECT * FROM slcodes ORDER BY slnumber";

if ($res = mysql_query($sql, $link)){

while($row = mysql_fetch_assoc($res)){

$updateSql = "UPDATE eqcodes SET dvparentdesc = '" .strtoupper(trim($row['sl4desc'])) . "'";

$updateSql .= " WHERE newcode '' AND ";

$updateSql .= "(UCASE(LEFT(newsectorcode,1)) = 'V' OR UCASE(LEFT(newsectorcode,1)) = 'D' OR UCASE(LEFT(newsectorcode,1)) = 'A' OR UCASE(LEFT(newsectorcode,1)) = 'E')";

$updateSql .= " AND UCASE(TRIM(newsectorcode)) = '" . strtoupper(trim($row['sl4code'])) . "'";

if (!mysql_query($updateSql, $link)){

echoline(mysql_error($link));

exit();

} } }

Taidot: MySQL, PHP

Näytä lisää: update code sql, sql select order, update sql code, 600 records, mysql update table, faster php, mysql optimise, bug free code android mysql php, mysql row order, php mysql select table, help write code catalog mysql php, mysql left, sql update code, select code, update order php code, select table php mysql, select mysql php, php select table update, php order records, php change order sql, order records mysql php, mysql php update, mysql change order, mysql row, link result mysql

About the Employer:
( 139 reviews ) Umbogintwini, South Africa

Projektin tunnus: #4238852