Skip to content

Tag: php

Change Faker Locale in Laravel 5.2

Is there a way to specify the Faker locale in the database/factories/ModelFactory.php file ? Here is my non functioning attempt at doing so >,< Thanks for reading! Answer Faker locale can be configured in the config/app.php configuration file. Just add the key faker_locale. e.g.: ‘faker_locale&#82…

filesize(): stat failed for specific path – php

i am coding a simple doc managing script and need to get the file size and file type /file or folder/ in a table. somehow it doesn’t work into the mention directory. please help if possible: it does actually has 2 errors – one the file size doesn’t work for the location, if i change it to pa…

What is the proper way to declare variables in php?

I was using variables in my php file without declaring them. It was working perfect in old version of localhost (i.e vertrigoServ 2.22). But when I moved to latest version of localhost (i.e xampp 3.2.1), I encountered variables declaration warnings and errors something like this: Notice: Undefined variable: a…

MySQLi Select to PHP variable

I wrote a PHP script with a database connection, which appears to work properly. The problem I’m having is in using a SELECT statement to fetch values from my database and assign those values to PHP variables. This is my table: If I copy the SQL into PHPMyAdmin, I get the right result, so I trust the qu…

Inserting date in PHP prepared statements

I am trying to insert current date (in d-m-Y) in a prepared statement into mysql table. I can’t get the code right. I am calling current date in php by and then including in a prepared statement like this In the table, the date does not get inserted. It remains 0000-00-00. How can I rectify this? Answer…