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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.