I’m trying to get a blob field returned to php as a varchar.
The field is a blob named “ssn”.
If I do:
select cast(ssn as char) from staff
I get a bunch of entries (with what appears to be garbage that messes with my javascript).
I don’t even know the column name to reference them.
If I try to grab it in PHP using thusly:
mysql_result( $result, $index, "ssn" )
I get:
… ssn not found in MySQL result …
Any suggestions?
How do I avoid getting garbage back? Is it just that my client’s ssn’s are scrambled so I can’t see them? Are there similar types I should consider casting to? And how do I reference it in my mysql_result() call?
You can give columns aliases like this:
Then you can use
ssn_cto refer to the column.