Forum Moderators: open

Message Too Old, No Replies

Changing data in a column for every user

         

Seamless

10:01 pm on Jan 10, 2006 (gmt 0)

10+ Year Member



A while ago i built a database and filled it with data, being slightly foolish i entered 'Yes' and 'No' into a few different fields.

I have now realised i want '1' instead of 'Yes' and '0' instead of 'No'

There are over 200 entries all with their own 'id' could anyone give me an example of how i can change this using PHP rather than manually going through each eantry on Myphpadmin.

I hope someone can help :D

Thanks in advance Seamless...

Seamless

11:17 pm on Jan 10, 2006 (gmt 0)

10+ Year Member



<?php
$query1 = mysql_query("UPDATE table SET field = '1' WHERE field = 'yes'")or die(mysql_error());
?>

Don't worry i worked it out :D

Also i have just noticed i have entered dates in the wrong format (DD-MM-YYY instead of YYYY-MM-DD) is there a way to change this also?