I have table like id u_id date time x —|—–|————|——–|—– 1 | 1 | 20200806 | 0900 | 60 2 | 2 | 20200806 | 0905 | 60 3 | 3 | 20200806 | 0910 | …
Tag: sql
How to fix my CRUD not working in Update PHP MSQL
I tried to implement CRUD in m website but I am able to make Create, Read and Delete. However, something went wrong during developing the Update function. Can anyone help me? I will provide the code below. The code is used to update the users information if the logged in person is an Admin. Thank you. Answer I updated the
upload image by refreshing page of web site
i write php code that upload image from client to host and site and my problem is if i refresh the page ,the last file going to upload again and its going dupplicate and if refresh again this problem …
Remove Duplicates in an array in php
My array: I want to be able to echo out the [month] and not have it duplicated, but still associate the other values to the correct month. To get to this point I have done an array_merge to put them together like you see them. Separately they look like this: #1 #2 I have tried array_unique and that does not
Adjusting values in MySQL based on current value
My database is for keeping track of user’s balances, and there are certain actions that will add or remove balance from the users. Currently I am doing this to get the balance and update it $conn->…
Insert repeatedly from foreach loop
I have a problem I’m trying to insert data into a table except that I need to retrieve the id before $get_ = $db->prepare(“SELECT * FROM table WHERE id = :id”); …
Trying to get property ‘name’ of non-object (View: (…) resources/views/products/index.blade.php)
In table in view with data from products table I am traying to show names from user table but getting this error. I made Laravel relations in models and foreign keys. And added directory in product controller for user model. Error: Trying to get property ‘name’ of non-object (View: /home/laravel/web/laravel.swt101.eu/public_html/abonamenty/resources/views/products/index.blade.php) This is part of my controller for showing product data:
How can I select data from this week using a Unix timestamp in SQL?
I have two columns in my database named dtp_s and dtp_e. Both of these columns hold strtotime() formatted ints which I then use in my PHP application to calculate hours/minutes between time intervals. I want to display the 5 most recent records in date order, which works fine when I use this: However, I now want to convert the dtp_s
Yii2, get an average value from timestamps
I have a basic table with orders, which have a field thats called created_at which is in timestamp format and I want to get the avarage on how many orders have been created per day. Found a other similar qestion about something like mine question whichI have posted below in the hope that everybody understand what im trying to do.
sql error while trying to store the image to database(UPDATED)
UPDATED: As suggested in comment section I have updated my code and using PDO now. I still have the same error. I am trying to store multiple images to the database (phpmyadmin). When I try to upload it gives an error Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘file.png’ in ‘field list’ My database: I have an database named