I had such code, which works fine and I need to get same result then I convert my database connection And now I converting this code to: How to get THE SAME RESULT AS IN MY FIRST CODE WITH PDO Connection ? At first PDO example I get echo $json such data structure: Answer Working example: Notes: Example is tes…
Tag: php
Get the user email in Woocommerce “New account” email notification template
In Woocommerce I am trying to customize the “New account” email notification template changing the texts. Currently the default template shows the username but intead I want it to show the user email….
Stripe, users can not download their invoice
I am working with Stripe Payment Gateway and everything is working so far, except the option, that my users can download their invoice on my website. It is possible to download an invoice inside the stripe dashboard but that is not what I need. After my users made a payment, they should be able to download th…
Encrypt / Decrypt personal data Codeigniter
I started updating my application to be compliant with GDPR. This application is using latest version of Codeigniter (I updated now as well). I’m trying to encrypt user’s email address using ‘Encryption’ library. I set my encryption key and I used $this->encryption->encrypt() to …
Laravel unique validation on multiple columns
I have 2 columns in table servers. I have columns ip and hostname. I have validation: This working only for column ip. But how to do that it would work and for column hostname? I want validate data.ip with columns ip and hostname. Because can be duplicates in columns ip and hostname, when user write ip. Answe…
How to set the username and password for the admin using database table?
I have created a website with login form for the administrator. I have the admin table in my database. I added the values in the table but when I try to login, the password is not being accepted. My table is as below How can I set username and password for admins using database table? Answer You should create…
Save all record records using request->all in Laravel
Laravel provides a great help for developers to save all input fields of a form which is one record with one line of code. like if I want to save a form which has multiple input fields and one record to database like: then I can save it with below code and it works great: Now I have a question.
Laravel Multiple Sortby Not Working Properly
i have some issues with laravel sortBy ( laravel 5.4 ) .. based on what i read on many websites, it says that for doing multiple sortBy laravel was by using reverse order.. so i try to do that.. but still not working properly.. So here it is.. I have this collection of object… My Goal is to have this
imagecreatefromjpeg exhausted memory limit, but it’s wrong
I set the memory_limit in my PHP config files to 100MB. I have an image uploading script, that is working OK for some small images, but I tried to upload a relatively large image (13MB), and got the following error: which points to this line: $image = imagecreatefromjpeg($file[‘tmp_name’]); What i…
Round up cart total Woocommerce
I need to round up prices on my Woocommerce cart. It rounds up to 1. For example: If the total price of the cart is $40.85, I need the cart to show $41.00. I tried with this command but the price discount this 0.15 and I do not know how to do it. I found this in other sites but