I have a tree like and I want the output for requeted ID for example Admin my table structure is I have a method that returns Child count level wise but I also want to return the child list level-wise with child count level-wise like 2nd image output required. } Answer It sounds like you just want a way of
Tag: php
PHP mail encoding issue
i found an issue with php mail sending. I need to encode the mail in UTF-8. The subject works fine, but the message is corrupted. This is my code And this is how the mail looks like Subject Nábor – Kolombooo From tvkolombooo@gmail.com Message T2Rwb3bEm8SPIG5hIG7DoWJvcjpLb2xvbWJvb28uCgoKRGlzY29yZDpLb2xvb…
How to show only those sellers who have created at-least one product
I have one sellers table where sellerid column is sno and I have products table where sellerid is sellerid , I want to get those sellers who are not blocked (there is column named flag in sellers table) and have created at least one product so I write this(or maybe copy this) Now I do my logic through: It is
laravel 8 migration error: Unknown column ‘batch’ in ‘order clause’ (SQL: select `migration` from `migrations` order by `batch` asc, `migration` asc)
[SOLVED] i new to Laravel and PHP. i tried to migrate my own migrations but i can’t. this my laravel and php information: my php info PHP 8.0.3 (cli) (built: Mar 4 2021 05:33:14) ( NTS ) Composer version 2.0.11 2021-02-24 Laravel 8.x mysql Server version: 10.5.9-MariaDB Arch Linux my OS info uname: Linu…
sql update multiple column in a foreach loop using prepared statement
Im studying this PHP script on how to prepare for multiple execution of a UPDATE statement. The script below shows update for 1 column using prepared statement. Example from PHP manual https://www.php.net/manual/en/function.sqlsrv-prepare.php What if I have multiple column to update, how do I create an array …
Problems when using join and pagination together in Laravel
I have some tables in my database and I’m trying to transact between them. My aim is to show the project name and the employees in that project in the form of cards on my projects page as in the image below. (Other than the method I mentioned, if there are better ways to do this, I ask you to
PHP recursive function to convert multidimensional array to xml
I need to convert an array of indefinite depth to an xml string. I thought a recursive function would be better to this since the depth of the array is not unknown and is mostly of 3 levels. Here is the recursive function that I have come up so far This is the inital call but it returns only the
Display the Color in a box for input RGB values in html/php
The code given below will give the Hex value after submission , but i also require a square box and a corresponding color filled in the box. want to get the red, green and blue value and want to display the color of that RGB value in a square box . The objective is to get something like this, we
How to get dynamic value from html tag with foreach and save it to jquery variable for momentObj
Honestly i am not sure how to make a suitable title for this but basically i was trying to extract element from span tag with id=duration which comes dynamically from database with foreach, and use it …
PHP – Show Array as HTML Table
I have this code which pulls an array of IP and MAC addresses from my server. <?php $arpa = shell_exec('arp -a'); $arpa = stristr($arpa, 'Type'); $arpa = preg_replace("/s+/", " &…