I want ask how it’s possible when an user Type=Chef logs into the website, in the Dashboard it only shows the user from his company Foreign key (fk_FirmaID). I don’t how process it to only show a specific company. Here is my code that I have for the moment. When an user is logging in I’m saving his user details
Tag: mysql
insert data in a single row of a database, php and mysql
I need to insert some data in a single row of the database, the way I am doing it creates 2 rows and I only want this data to be entered in a single row. I can’t find a way to insert the data without creating 2 rows, My question is how can I insert this data into a single
MySQL – Join part of query to a new query?
I’ve got the following code which queries a table. Then it uses the result to make another query. That result is then used to make a third query. But how do I grab the userid field from the 2nd query in order to grab a name from a users table and join that to the result of the 3rd query?
I am trying to run a query in php its working in phpMyAdmin but not in script [closed]
Iam trying to fetch related articles for a blog based project Query : $query = mysqli_query($con, “SELECT * FROM posts WHERE cat_id like ‘%$cat_arr[i]%’ AND NOT post_id = ‘$postid'”); …
DataTables can’t read more than one Data
I would like to ask why is the DataTable can’t read more than 1 data in my Database? I would appreciate any help since I’m relatively new with the Data Table, thank you. As you can see it’s only showing 1 to 1 of 1 entries. But as seen in the table I have 5 retrieved data. and when I
How to instantly suspend user and not after user log out
I have one script that works via mysql and php. Now I have a problem, namely if the user does not pay the monthly subscription, it is necessary after 10 days from the day of the invoice creation to suspend the user’s account but the problem is: the user account is suspended only after the user is log out of
I have tried to run an existing laravel project. But during composer update I got this error:
Problem 1 Problem 2 Problem 3 Answer The error messages are quite clear. The packages you want to install require PHP 7, but you have PHP 8 installed. Your options are: Downgrade your PHP version Upgrade the package versions you depend on, if there are newer PHP 8 compatible versions
Delete big chunk of data with where clause gives time-out
I’m trying to delete over 2 millions records with this statement And I get 504 error time-out, when I try the same statement with select instead of delete it works, there is an index on event_tstamp column. Any idea what could be the problem? Answer delete is a much more expensive operation than select. The deletes have to be logged,
Calculate difference between two avg based on same value from different columns
I have a table with football odds that looks like below: fixture_id H_odds D_odds A_odds ev_tstamp updated 120000 1.40 1.50 1.60 132000 12 120000 1.20 1.20 1.20 132000 11 120000 1.20 1.20 1.20 132000 10 120000 1.10 1.20 1.20 132000 9 180000 1.20 1.30 1.60 132000 12 180000 1.10 1.20 1.20 132000 11 180000 1.50 1.80 1.50 132000 10 I
Insert a php string as multiple rows on MySQL table
I have a table with more than 750 rows of data that I paste on a textarea and get as a single string variable, then I pass the data as just one string thru an ajax and I want to insert it on my database in just one INSER INTO line Is there a way to make this work, I