How does PHP store and query string data in MYSQL? I have such data. Monday morning: Chinese afternoon: Math Tuesday morning: English Afternoon: Physics Thursday morning: sports afternoon: music Thursday morning: Chemistry afternoon: Art Friday morning: history afternoon: how politics stores data in a field of a table in string mode. How to write the syntax? How can I query data after storage? How do I update the values in the morning and afternoon? I remember reading this article before, similar to [{Monday: Chinese, Mathematics}. {beginner asked PHP how to store and query string data in MYSQL?
I have such data.
Monday
Morning: Chinese
Afternoon: Mathematics
Tuesday
Morning: English
Afternoon: Physical
Wednesday
Morning: Sports
Afternoon: Music
Thursday
Morning: Chemistry
Afternoon: Art
Friday
Morning: history
Afternoon: politics
How to store a table field in string mode. How to write the syntax? How can I query data after storage? How do I update the values in the morning and afternoon?
I remember reading this article before,
Similar
[{Monday: Chinese, Mathematics}, {Tuesday: English, physics},]
But I don't know how to write or use the syntax.
Requirement: query and update.
Please give me some advice. Or give me a related article.
------ Solution --------------------
$ Arr = array (
'Monday' => 'Chinese, mat ',
'Tuesday' => 'English, physical ',
'Wedned' => 'sports, music ',
'Thurs' => 'chemistry, artbe ',
'Friday' => 'historical, political'
);
$ Result = json_encode ($ arr );
Echo $ result; // save as a database
// Retrieve from database
$ Arr = json_decode ($ result, true );
Print_r ($ arr );