How does PHP read data when the database is a string? This post is finally edited by c520zf1986 at 2014-04-0110:44:39. Example 1: The content of a field in MYSQL database is in the format of, and 7, how can I read and store updates in PHP? If I want to read the fourth digit, that is, 46, in PHP format, how can a beginner ask how PHP reads a string when the database is a string?
This post was last edited by c520zf1986 at 10:44:39, January 1 ,.
Example 1: The content of a field row in MYSQL database is:, 7
In this format, how can I read and store updates using PHP?
If I want to read the fourth digit, that is, 46, in PHP format, how can I write it? If I want to read the first and last numbers, how can I write the format? What if I need to add another number after the last number?
Example 2: The content of another field is a: 20, B: 55, I: 75.
How can I read and update such a format?
------ Solution --------------------
Select SUBSTRING_INDEX ('1, ', 4),', ',-1) as fourthFourth
46
Use php to read and split it into arrays
It seems that you have saved space and wasted time and brain cells.