Skip to content

php array unique and pushing data

i got data return from mongodb and as i searched i saw that i cannot user cursor twice so i put all data in arrays and now i need to split the data to unique name, the data i got : what i need to accomplish is to get unique names and push Data return for each name like that:

Fetch specific rows from MySQL with datatables

I’m trying to fetch specific rows in a MySQL table with specific “basket_id”s and display them in the jQuery DataTables plugin. In the PHP server-side script for the DataTables AJAX request, I specify the $user->basketId() in a WHERE clause for MySQL.. Let me walk you through it.. User si…

Nested comment system runs too many queries ( laravel & livewire )

I’ve built a nested comment system and it works fine, but I have a problem. when I want to show the comments, it runs too many queries. for example if I have 10 comments and two replies each, laravel debugger shows 40+ queries, and I want to reduce them, here is my code : Query Relationship in Post.php …

How do you style input that PHP posted with a CSS selector?

I want to create a webpage that posts onto itself text inserted into an input field, using CSS to stylize said text once it becomes part of the page. However, I don’t know how to refer to it with a CSS selector. I’ve done what every HTML-newb tries when encountering a problem and wrapped both the …