Web Hosting Talk







View Full Version : mysql and colums


davidb
06-27-2003, 11:46 AM
I recently upgraded to a new version of the quiz program I use. After hours of screwing around, for the most part I think I got it working again(the problem was the mysql database format changed a bit, and there were no type of upgrade instructions so I had to wing the whole thing). Of course there was one new field entered in the mysql database that is text. Right now that field is blank for all of the users. Since its text, I just cant add in a default value. So anyone know of a way to put a word into every colum of a table? Doing it by hand is out of the question because I have to do it about 1000 times.

genlee
06-27-2003, 12:12 PM
UPDATE table SET col=<some text>;

davidb
06-27-2003, 12:16 PM
thanks, but a couple of questions:
where do I specify the colum that it is going in?

Tom|420
06-27-2003, 03:23 PM
UPDATE <table> SET <col>=<text>

if your table is named 'quiz' and your column is 'name' and the text is 'your text' then

UPDATE quiz SET name="your text"

will fill in the column 'name' with 'your text' on all rows

davidb
06-27-2003, 04:39 PM
that command kicks ass, thanks both of you