doumao1519 2016-01-13 19:51
浏览 18

协助未定义的stdclass错误

I bought a script and developer is not responding after I paid(1 hour they said of work to tell me below) them to modify code. I wanted to duplicate a field in the existing code by copy and past but of course this did not work. The code I want to duplicate is:

<td class="dt2 dt0"><?php echo $this->lang->line('Description');?>:</td>
<td class="dt2" colspan="3"><?php echo wordwrap($job->description,100,"<br>",true); ?></td>                                   
</tr>

The code they gave me to add is:

<tr class="">
    <td class="dt2 dt0"><?php echo $this->lang->line('description2');?>:</td>
    <td class="dt2" colspan="3"><?php echo wordwrap($job->description2,100,"<br>",true); ?></td>                                      
</tr> 

Then the told me to goto phpmyadmin and query database with:

ALTER TABLE 'jobs' ADD 'description2' text COLLATE 'utf8_general_ci' NOT NULL AFTER 'description',COMMENT=";

When I do this code the output value is same for duplicate as the original. If I change the duplicated $job->description2 like they said I get error on page:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: stdClass::$description2

Filename: job/view_job.php

Line Number: 427

So I figured since I bought the code from them on their website that they would have been helpful, but obviously its not their code and keep asking me for ftp to my server to fix it so I am leary.

I searched on here about std error and seen examples or adding a new stdclass:

$jobs=new stdClass();
$jobs->name='discription';
$jobs->status=1;)

but it did not do anything for error. Any help would be appreciated.

  • 写回答

1条回答 默认 最新

  • duanruanxian5028 2016-01-13 20:06
    关注

    It seems like the property "description2" just does not exist in the $job object. I think your developer must also provide you with a new Job Class. Do you have any cache in your project that you could refresh?

    Also you could use var_dump($job) too see what properties this object actually have. Of course you can simply add a new StdClass $job and add a property "description2" but i am sure this would not be the intended use.

    评论

报告相同问题?