Skip to content

Tag: php

Laravel Mutator Database Value with Variable variables

I have the following Laravel Eloquent Mutator When calling $object->used_working_time i get the value stored in the database as expected. When using Variable variables $object->{‘used_’.$name} with $name = ‘working_time’ the $db value is null. Is there a way to get the database a…

How to string two variables together in php

I am new to php. And string concatenation is difficult for me. I want to concatenate the following string: But the string I want: Thanks. Answer Try this(Added single quote to the string): Another solution(Wrap the single quotes in double quotes to branch variable): OUTPUT:

Laravel how to properly pass data to href

sorry if the question is kind of newbie. I am new to php and laravel, still trying to learn through tutorial. I am trying to pass the ‘No’ in my database to the url, so that the url when I clicked on Daftar, it will show http://127.0.0.1:8000/search/{No} Webpage designed I did try to put it this w…

Laravel Views – Possible caching issue

I’m trying to test a laravel upgrade on our production server. I created a new vhost and copied the entire directory over of the original laravel app to the new vhost root. So I have app.mydomain.com with the original (laravel 5.8 app) and l6.mydomain.com with the copied version. My issue is that if I m…

Disable some warnings in Eclipse

I just installed Eclipse (Eclipse IDE for PHP Developers) and I’m currently testing it. Seems great on many aspects, BUT… … I get some warnings I’d like to get rid of, because they have no incidence and just tend to “hide” more useful warning hints. Some variables/class ins…

Image Blob not adding to the mySQL Database

So I tried so many times and tried changing things and still not working, It still add and throw null here’s the code of the HTML, PHP and also JS (just incase needed). I already tried to do some of the methods on github and stack overflow and still doesn’t work. I hope someone can help me with th…

avoid same numbers and zero in array

I have a form with that table: jsfiddle In this form i need to enable to edit the number fields. After submit i collect the data and write to mysql. Before mysql insert i want to check that the $number array does not contain the same numbers and zero (like: 0,1,1,101,150). If yes give an error to the user tha…