I’m trying to store and get current date & time from Database. I’m trying this $current_time = Carbon::now(); ‘order_date_and_time’ => $current_time, ‘delevery_date_and_time’ => …
Tag: mysql
Preg_replace content with mysql query
I’m creating a replacement function. I have data in a db with a field ‘content’ that returns the content for a page. In that content I have a url tag like <a href=”[2]”>title</a>. The number between the [brackets] is the page_id of my pages table. I have a function ca…
Debian – Apache MySQL PDO issue but all logs are empty
I’m trying to get a project set up and working but I have some issues with my PDO connection. No big deal, however, it doesn’t matter what logs I’m trying to find – they are all empty. within the php file itself, I have ini_set(‘error_log’, ‘/tmp/php_error.php’)…
Docker – Nginx, PHP, MySQL – Laravel artisan migrate connection refused
I have Laravel running in Docker with 3 containers – Nginx, MySQL 8 And PHP 8. I have the following docker-compose.yaml This command: Launches 3 containers: I want to run php artisan migrate, so I try it like so: This gives me the following error: My mysql.env file is like so: AND .env: I’ve tried…
preg_replace vs ereg_replace vs str_replace On This Particular Case
Using PHP, I want to generate custom MySQL dump file (due to cannot use exec and a few other reasons). So I found these 2 similar solutions: https://www.kvcodes.com/2017/10/php-create-mysql-backup …
Combining multiple queries into an output
With a feedback survey they can select bad, neutral or good. I want to compile the bad and good into a table. I am trying to create a tally “table” output from an ajax request to replace a …
PHP inserting value only once
I am trying to add categories in a database. Things is the script is reading the categories from a product list, therefore there are duplicate values as it’d be like reading PRODUCT NAME – DETAIL 1 – DETAIL 2 – CATEGORY Rinse and repeat. I have my code down and the insert works but it …
Check the documentation for the version of MariaDB you are using for the correct syntax around ‘DESC LIMIT 1) LIMIT 0, 50’ on line 1
Why is this request incorrect? MySQL answer: Documentation 1064 – You have an error in your request. Check the documentation for the version of MariaDB you are using for the correct syntax around ‘DESC LIMIT 1) LIMIT 0, 50’ on line 1 Answer For sorting in descending order you need to use: OR…
Can laravel make password encryption like mysql password() function?
how do I make password encryption on Laravel PHP to look like Mysql password() encryption? is there a way to do that? so I can create user to MySql using query on Laravel eloquent, and logged in to MySql using the user I create with Laravel? Answer No you can’t. because we can’t get MySQL user tab…
How to upload picture when register in laravel?
I’m trying to upload an image in laravel default user registration. I’m using laravel ui package. Here is create method in RegisterController I’m getting this error Undefined variable: image” Answer In the User model: