I use Laravel Framework 8.54.0 and livewire. I want to call data for my dropdown form. But I get sqlstate error. Could anyone help me find a way to solve this issue? Model: Livewire Controller: View: Answer it says you have more than 2100 records so the query should contain all of them in where query!! Well i…
page is available using any credentials on php authentication
popup dialog is there but entering any credentials – the page is available what is the problem ? if(!isset($_SERVER[‘PHP_AUTH_USER’]) || !isset($_SERVER[‘PHP_AUTH_PW’]) || !$_SERVER[‘PHP_AUTH_USER’] ==…
Can’t call JavaScript function from PHP using a string as a parameter
I am using a PHP script to get data from a MySQL server. Once I get that data, I’m looping through it (still in PHP) and using it to output a series of datasets each with their own button (The “title” of the row is a string that may or may not have spaces and such, like “Hello%20World&…
Dompdf does not render pdf in mobile chrome
Am using Codeigniter 4 and trying to convert a dynamic HTML (invoice) to pdf so it can be download when a user click on a button. It was working perfectly on my local machine chrome and edge browser, …
Modifying URLs on a WP webpage depending on the incoming request URL parameters
I have a specific task where I have to alter the URLs contained within a WP webpage, based on the parameter of the incoming URL request. Let’s say I have a webpage https://example.com/prefix, on that page, there are several links that point to another page, say https://example2.com/prefix So whenever so…
Why am I getting “forbidden” message on accessing /books path and 404 on accessing any book on BookStack
I have setup bookstack on Xampp + Windows 10. I am accessing it directly with apache server. When I try to acces “/books” url it show a blanck white page with “forbidden” written on it. I can create shelfs and books but when I try to open any created book it show a 404 Apache page like…
Unix epoch time converts to human readable incorrectly with PHP
1630440104 is the Unix epoch time code example. This PHP code outputs it as 2021.08.31 at 23:08:44 which is incorrect. Because the correct output should be 2021.08.31 at 23:01:44. Whatever time code I insert into the above PHP code it returns 08 minutes instead of the actual value. Where have I made a mistake…
is there any way to validate if two compound index fields already exist in a many-to-many table?
For example here I am inserting the fields question_id, query_id, sub_test_id, test_id, score and answer. the question_id and query_id fields are unique index, how can I validate if when inserting these two fields they already exist in the table? Answer If I understand your question correctly, you are having …
WordPress how to get the post thumbnail inside a figure tag
I am running a query loop and want that ‘if’ the post has a featured image, it needs to be inside a <figure> tag. But the featured image’s <img> tag is appearing before the <figure> tag. What could be the reason? The problem can be better understood with this image: Answer …
Get latest file in dir including subdirectory php
i found out that i can use to get the latest file in the given directory (‘myfolder’). is there an easy way to get the latest file including subdirectorys? like: myfolder> dir1 > file_older1.txt myfolder> dir2 > dir3 > newest_file_in_maindir.txt myfolder> dir4 > file_older2.tx…