Hello everyone, please help me to see how to obtain the value of this variable.

Source: Internet
Author: User
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 };

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.