I wanted to implement a notification system for our school, it’s a php/mysql webapp that is not opened for public, so it doesn’t receive much traffic. “daily 500-1000 visitor”. 1. My initial approach …
Laravel Image Quality
Every time I upload a new image to my server, this image is resized. The main issue I’m having is that the image is losing a lot of quality. This is the current code: $name1 = str_random(10); …
Eloquent chunk() missing half the results
I have a problem with Laravel’s ORM Eloquent chunk() method. It misses some results. Here is a test query : $destinataires = Destinataire::where(‘statut’, ‘where(‘tokenized_at’, ‘&…
PHPMailer – OpenSSL Error
Based on the example that PHPMailer provides i have the script below, date_default_timezone_set(‘Etc/UTC’); require ‘./PHPMailerAutoload.php’; $mail = new PHPMailer; $mail->isSMTP(); $mail->…
Expected response code 220 but got code “”, with message “” in Laravel
I am using Laravel Mail function to send email. The following is my app/config/mail.php file settings. Controller Mail Method When I run the code it gives me following error message: Swift_TransportException Expected response code 220 but got code “”, with message “” I have created a S…
Cut an arabic string
I have a string in the arabic language like: Now I need to cut this string and output it like: I tried this function: The problem is that sometimes it displays a symbol like this at the end of the string: Why does this happen? Answer The symbol displayed after the cut is the result of substr() cutting in the
DataTables warning: Non-table node initialisation (TBODY). PHP
I’m trying to use DataTables second time in other PHP Page but I’m stock in this error, DataTables warning: Non-table node initialisation (TBODY). What did i do wrong? i tried this code with my first PHP Page and its working fine. Here is my Code for Table And I’m using this for JQUERY Answe…
Fetching all parents in simple way with PostgreSQL
I have a table with a hierarchical structure: I want to list all parents of the plan name Paints, so I can build a breadcrumb to navigate back. Using id = 6 I like to get: I’m using postgresql with PHP, and thinking of efficient way to fetch all the parents as simple as possible. Answer Use recursive wi…
Search tags in mysql table with PHP
I have a table with some submissions, this table has a tags field, and I need to search in it. The data is saved in JSON format in the table, like this: [“basic”,”example”,”html”,”chart”] I’m trying …
Reformatting a datetime field into a more readable format
I am pulling a datetime field out of a database with PHP in the form of this: 2015-09-22T13:00:00 When I populate my html with this value it returns this (note: without the ‘T’): 2015-09-22 13:00:00 No biggie. What I’d like for the output format to look like is this: September 22nd, 2015 …