I'm trying to write a a text file using sql query but it shows an error saying:
Object of class stdClass could not be converted to string
Here is my code:
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
$ss=DB::select("SELECT commercial_library FROM tbl_schedule");
$stringData = implode(', ',$ss);
fwrite($myfile, $stringData);
fclose($myfile);