Jump to content

Convert mysql column to string?


n3mesis125

Recommended Posts

Hey,

 

Just need some help with getting my column data to show as a string.

 

I inserted a bunch of data using phpmyadmin LOAD INFILE, however one of the columns of data I inserted wasn't wrapped with "" to show it was a string. So at this point I'm not even sure what mysql is making this column appear to be. Is there some quick way of fixing a column so that it reads as a string.

 

Right now when I bring the data into an array in php, I am using an if statement like if($a['name'] == "BREAK") however, this isn't working because the word BREAK that is stored in the 'reason' column isn't looking like text, I've tried putting (string) in front of the data i bring into the array but that isn't working. However, if I edit the row in phpmyadmin and then just hit go, it fixes the data, however, I have over 100,000 records and do not want to have to edit each row in phpmyadmin.

 

Thanks,

n3m.

Link to comment
https://forums.phpfreaks.com/topic/134072-convert-mysql-column-to-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.