thinkphp modifying field content issues

Source: Internet
Author: User
$Data = M ($action); Instantiate the data model
$this->data = $Data->field (' Id,datupian,touxiang,content,nike,time ')->select ();

Returns a two-dimensional array
For example, get datupian field content is www.baidu.com/22.jpg is the network image address I want to file_get_content this field content to re-overwrite the original field content how to get


Reply to discussion (solution)

Directly with update, usage

$m =m (' Tbale ');  Table name $data[' id ']=98;   The first value must be the updated condition, that is, the table's primary key, that is, the condition to be updated $data[' type ']= ' the value to update ';  After the first condition, the value of the sub-segment to be modified is then $data[' type2 ']= ' 2 to update the value '; $data [' Type3 ']= ' 3 value to be updated '; $m->save ($data);  Finally,   you can update it with the Save method. After the update, a value is returned, which you can print out to determine.

Directly with update, usage

$m =m (' Tbale ');  Table name $data[' id ']=98;   The first value must be the updated condition, that is, the table's primary key, that is, the condition to be updated $data[' type ']= ' the value to update ';  After the first condition, the value of the sub-segment to be modified is then $data[' type2 ']= ' 2 to update the value '; $data [' Type3 ']= ' 3 value to be updated '; $m->save ($data);  Finally,   you can update it with the Save method. After the update, a value is returned, which you can print out to determine.

I don't have to keep it in the database.!!!!!!!!! I just tried to change the array values directly.

What do you mean???

  • 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.