Skip to content

Tag: php

pdo connect convert to MSsql and fetch data

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…

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…

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.

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