Jump to content

kunalphpdev

New Members
  • Posts

    5
  • Joined

  • Last visited

kunalphpdev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. here are some screenshot of 'clients' and 'orders' table I wanna store the points at dpoints column previously i tried this code but the dpoints columns isn't updating $stmt = $conn->prepare('SELECT client_id FROM orders'); $stmt->execute(); $users_with_orders = $stmt->fetchAll(PDO::FETCH_COLUMN); // Add one point to the rewards points for each user who has placed an order foreach ($users_with_orders as $client_id) { $stmt = $conn->prepare('UPDATE clientss SET dpoints = dpoints + 1 WHERE id = :client_id'); $stmt->bindParam(':client_id', $client_id); $stmt->execute(); }
  2. I didn't understand the query, can you please explain the code little bit. note : i have to show the points on the user dashboard
  3. hello folks, I want to add(modify) a code to my already created php in way that whenever there's a new order by any user, every users who has already placed an order in my site gets 1 point. I'm attaching the file below as well as the basic information about the database. there's a table where all orders are stored named 'oders' where we have 'client_id' and 'order id' and for storing the users we have a table named 'clients' thank you in advance newodr.txt
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.