Hello everyone, please help me to see how to obtain the value of this variable. now there is such a record in the database. The value of the field "ZhiDuan1" is "TianQi ". next record, the value of the field "ZhiDuan1" is "XinQing ". $ rs-& gt; ZhiDuan1; declare a $ TianQi variable on the webpage and assign it to "Sunday", a $ XinQing variable, and assign it to "happy ", now I don't want to use echo $ T directly. Hello everyone. please help me to see how to obtain the value of this variable.
Now there is such a record in the database. The value of the field "ZhiDuan1" is "TianQi ".
Next record, the value of the field "ZhiDuan1" is "XinQing ".
$ Rs-> ZhiDuan1;
Declare a $ TianQi variable on the webpage and assign it to "Sunday ",
A $ XinQing variable with a value of "happy ",
Now I don't want to use it directly
Echo $ TianQi;
The page displays "Sunday ",
I want to display "Sunny Days" through "$ rs-> ZhiDuan1,
In this way, when the next record value of $ rs-> ZhiDuan1 is changed to "XinQing", "Happy" is displayed.
How can I write code?
------ Solution --------------------
Write data to the database before reading it. Is that what it means?
------ Solution --------------------
You can retrieve fields from the database.
Whether through $ rs-> ZhiDuan1 or echo $ var
Not all of them are the same, as long as both variables come from the database
In addition to what you said above, you have to have other conditions for sunny days, such
For the latest weather conditions, you can use the one with the largest id
Or the weather on the third day. the condition is timeFlag = 3.
Otherwise, an array may be retrieved, but the array may be sunny.
------ Solution --------------------
Echo $ {$ rs-> ZhiDuan1 };