I am trying to print number of rows in Laravel from MySQL but i get this error: htmlspecialchars() expects parameter 1 to be string, object given (View: C:wamp64wwwkontresourcesviewsprofile….
Tag: sql
mysql JSON_EXTRACT in PHP returning “Array” instead of indexed element’s value
Very basic thing I’m probably missing, but I don’t get it. I have a table called mus_translated_languages in my db, in which I have a json datatype column (six records), whose value is always in the …
how to repeat rows only once in many to many relationship
I’m working on many to many relationship on php I have 3 tables , movie table which contains movie name and movie id genre table which contains genre and genre id and movie_genre table which has …
SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘feature_item’ & ”status’ cannot be null
in my form when i checked the checkedbox there is no error .but when i don’t want to check the checkedbox, I am getting the error SQLSTATE[23000]: 1048 Column ‘feature_item’ & ”status’ cannot be null. 1.my products table:- 2.my product.blade.php This is my form 3.my ProductsController This error I get: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘feature_item’ & ‘status’ cannot
NEWID function causing error for prepared statement in MYSQL
I am trying to create a forgot password system, so I am using the NEWID() function to create a random code to be sent to the user’s email. I am using prepared statements to prevent SQL injections, but …
How to create an optimized sql query for multiple dropdown filtering in php?
Am new to php and working on a project. At the beginning there was 2 filters for which I didn’t worry much in writing the sql query with 4 conditions. But now I’ve 8 different dropdowns and I need to …
JS function not found when calling PHP function on server but works on local server
As stated in the title my code works in local but not on server. More precisely, when i call whatever PHP function it doesn’t find my JS function. To sum it up : The goal here is to generate an excel …
How do I substract values from product table and order table?
orders table products table The pictures are order and product table. I am trying to change my stock quantity of products where admin confirm the order of the customer and the product quantity will …
Prevent SQL injection attack in PHP
I would like to prevent SQL attacks on this piece of PHP code (this is just a practice exercise in class). This can easily be exploited by setting @mail equal to something like ‘); DROP TABLE PURCHASE;…
Add Year to NOW()
I am trying to add a year to a date going into a SQL database from PHP. I have tried DATEADD(Year,1,NOW()) And various other forms but can’t seem to get it to add a year onto it in SQL. <?php …