I’ve a small twig custom filter in my project created following https://symfony.com/doc/current/templating/twig_extension.html . As long as it sits in src/Twig, it works as expected. Now I’m trying to move it to a custom bundle (vendor/turbolabit/tli-base-bundle/src/Twig/) to make it reusable. I m…
Tag: php
PHP Multiple variables in hyperlink
I want to add “max=<?php echo $row_select[‘max_price’] in hyperlink below, so that when the link’s clicked, I can get both min and max price. Please advise how should the code be. Thank you. Code in page 1 In page 2, my code to get min_price is as follows. It works. But I need to br…
Edit user in DB change password only if password is changed. What I am missing here?
I am using PHP 8.x and an admin control panel, what I want to achieve is if I want to edit user1 and “Password” and “Confirm Password” fields are empty “password” row in DB should not be changed. Bellow is the current PHP code that I am using but if “Password” a…
How can i create dynamic menu with sub-menu with php & mysql?
I’m trying to create an dynamic menu from mysql table with php but i don’t know how to create the non category menu, here is what i have so far and is working only the categories with submenus but the non categories ones they are not shown on echo. MySQL category menu Table: MySQL sub menus Table:…
unable to display session variables in a non-auth application
I’m trying to store and retrieve form data in laravel session. My app is non-auth, meaning users are not required to register, hence no authentication. After attempting to store form data in session, when I try to output it says: “Trying to get property ‘name’ of non-object” Why …
One big update query, or several single update queries, to update a value in MySQL multi-tenant database
I’m working in a ‘point of sale’ application (PHP + MySQL), with products, sales, product quantity that have to be updated (+ or -) depending on the operation (sale/buy), etc. On every sale/buy, I save the operation data (date, customer, totals…) in an ‘invoices’ table, and…
Easy Admin 3 Sort by date returns: create_date has no field or association named create_date
I’m trying to sort a field either by asc or desc date. When i add the date field to my backend like so It works and it shows, but when i try to sort it i get the following error Does anyone know why or how this happens ? Thank you EDIT: here is the field in MyEntity Answer You
Getting specific column in Laravel relation returning empty array
I want to get specific column from Model relation in Laravel, but the relation model returning empty array. Eloquent Query Medicine Modal Answer You always need to also select the primary and foreign keys of the table to make the relation work:
MongoDB PHP Error: Warning: Undefined property: MongoDBDriverManager
I’m trying to use MongoDB on my local machine using the advice in this stack overflow. I’m using XAMPP on Windows 10, php version 8.01, and MongoDB extension 1.9.0. It’s a very basic script that connects to MongoDB and tries to use one of the databases. But I am still getting this warning: T…
default values in input form Modal
I just created a datatable collecting the values from a wordpress database.- These values must be loaded in a contact form within a modal. I am calling the modal from a button in the last column of each row of the datatable. I must predetermine the values of the form fields with the information correspo…