How do I update every single row in a specific table with PHP?

view full story

http://serverfault.com – I want to edit/change the value of a specific column value with PHP. For example, let's say that I have thousands of records and I want to change every record's column value to 1. How would I do this in PHP? <?php $id='rank'; $username="root"; $password=""; $database="python_crawler"; $host="localhost"; mysql_connect($host,$username,$password); $query=" SELECT * FROM url WHERE id='$id'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $first=mysql_result($result,$i,'1'); ++$i; } ?> (HowTos)