CopyPastor

Detecting plagiarism made easy.

Score: 0.8131391504231621; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2020-02-10
by jual ahmed

Original Post

Original - Posted on 2017-02-25
by DvdEnde



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Best way is NOT to use Integer as a fieldname. It is bad praxis. But if you need, you should access the database with raw method:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
public function show() { $tests = DB::table('test') ->select("22 as twentytwo") ->get(); foreach($tests as $test){ Log::info($test->twentytwo); } }
<!-- end snippet -->
insert and update like this

<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
$obj=new Modelname(); $myfield = 22; $obj->$myfield="anything";
<!-- end snippet -->

Best way is NOT to use Integer as a fieldname. It is bad praxis. But if you need, you should access the database with raw method:
public function show() { $tests = DB::table('test') ->select("22 as twentytwo") ->get(); foreach($tests as $test){ Log::info($test->twentytwo); } }


        
Present in both answers; Present only in the new answer; Present only in the old answer;