Hello,

I am loking for a concept to geting started is there a way of creating a notification like on user end any one updates his post update or upload an image then on admin panel it notifies the admin like on menu bar it shows 1 and when the admin click on it it becomes 0 i know it is a tricky part i will get started but i want to get a guidline from experts here. I was thinking to create a count query and put a table of pending or something so when ever a user uploads an image and it will be approved by the admin
so how about this

$count = mysqli_query($connection, "SELECT * FROM table_name WHERE status='pending'" AND WHERE userid='1');

$result = mysqli_num_rows($count);

echo $result;

How is this approch is it user friendly??

It would be great if you first explained what you are trying to do and then describe of how you are thinking to do it. As I understood you want admin to be notified when a user upload an image , is that so ?

Yes you are correct

This is the correct way so the admin would be able to know when the user have uploaded a photo or a file let supose so the notification should be sent to admin

@jkon

I have tried to create an admin panel where admin can upload files for users to work on and on user panel side user will be seeing a notification message like new file uploaded so then user can go to the files page and can download the file from theer and then work on it et.

When done user have the ability to upload that file and mark status as completed when status is marked as completed a notification will be sent to the admin panel showing that the file has been completed nad uploaded so from there tha admin can get his file back make sense ?

Hello UK-1991,
There many ways you can implement such functionalities here is just one of them. First lets talk a bit what means “upload an Image” and how we can create an abstraction layer to that. There are two main different approaches to that (in my point of view) one is to insert that image blob into the db and the second a mixed at least one repository db table with id and file info (extension , sizes or / and widths heights for images , original names , reference id , md5 of the blob or what ever) , a repository folder where you save the image (e.g. by its main repository table id) and PHP tier where you just serve the image making what ever authentications you need. I am strongly pro the second choice.

If you create that abstraction layer then added one , two or as many tables needed giving authorities and status to a specific image linking it with a user id is the easy part.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.