Skip to content

PHP PDO to create an object of a class with fetchObject

I am trying to create a “User” object inside my class “User” based on the properties I have stored inside my database, which I use PDO to connect to. I’ve search some pages on Google and found that most people use the fetchObject method for that. Right now, I am trying to use thi…

Two models for one Controller in Laravel (methods Edit & Update)

Would you please let me know if this controller SerieController is correct? As I don’t think so. There are two models in fact. One Model is Serie and the other is Mark. When, I click on the drop down list, I don’t see my items… My edit.blade.php Concerning the model Model Serie Model Mark Th…

PHP Any better way to write this if + ternary function?

Basically it just switches between the two values. If I input X I get 6, if I input 6 I get X. If I input anything else the value comes through unchanged. This is a simplified version of the function I’m actually using so no need to ask why I need it. I tried it as and array but it

Why doesn’t PHP 7.2 fopen(/tmp, a) write to the file?

I have an old “PHPDBG” function that lets me “printf” to a text file. I’ve had PHPDBG.inc “since forever” (at least since PHP 4.x days), but it doesn’t seem to be working in my current configuration (ubuntu18, Apache 2.4.29 and PHP 7.2). Specifically: I can&#821…

Laravel download pdf returning random characters

Im trying to download my earlier saved pdf. Ive created this function. And it returns this: Var dumping my $filepath is resulting in this : C:laragonwwwYTBNstorage/pdf/billing/invoice/YTBN_Armando_3_2019-0305.pdf” Which is correct. Answer try to used like that or u can used directly in laravel 5.5 file …