how sum "Total" in php mysql
how to sum Total ?
$data = mysqli_query($conn,"SELECT B.name_store , A.name, A.price,C.qty,(A.price * C.qty) as total, From product A,store B,dtl_transaksi C where C.id_store=B.id_store AND C.id_product=A.id ");
See also questions close to this topic
How do I make a system that uploads files to the webpage and lets other users view them?
My ultimate objective is to make a system, using PHP, that allows the user to upload files to the website, then allows other users to view those files. I know some HTML and PHP. But unfortunately I have know idea how to start. Help would be appreciated. Please don't close this question because it is to wide, I am very curious as to how I could do this. I am asking people here because the online tutorials did not help me.
How Do I run PHP in my website without using localhost
I'm trying to create a login page for my website, but when I try to run PHP, it just downloads the file.
How do I create a form where the PHP actually works without downloading. If someone could also tell me what a web server is, that would be great because I'm VERY new to PHP.
Here's a link for my login website. I'm trying to create a login page for my website, but whenever I try to run it, it just downloads the file and shows me the code. I've tried using form action, I have a .php extension, but nothing works. Well, the PHP works perfectly fine in localhost, but I'm trying to add it to my website. Ok, here's an example, y'all know as famous companies. Facebook, Google, Paypal, they all have a login and sign up places. I'm trying to make one of those, but when I use the PHP without localhost, absolutely nothing happens. I started PHP a few days ago, so I have a small understanding of web servers and how to use them. My main question though is, How do I add PHP to my website. Below is my login site, and if you click on the login.php link, it just downloads.
is it possible to isolate included php file from the main css of the container page?
I am using this to include an
index.phpfile into another one
<?php include 'main/index.php'; ?>
but the css of the main container keeps on messing up the css of the included
index.phpfile. I don't want to remove the main
jsof the container page, is there a way to
isolatethe included page from not being affected by the page css? I have tried using iframe but I lacked the knowledge to make it work
<iframe src="main/index.php" frameborder="0"></iframe>
SQL Join with distinct values from both tables
I have a table of orders placed by customers and a table of phones of different configurations. I want to find a single record from phones matching each order according to their configuration.
For example, if the order asks for a red phone with 256 GB memory, a phone with a similar configuration should be selected, but that phone should not be selected for the next order if it also asks for a red phone with 256 GB memory.
Please help me with a SQl query that builds the above JOIN.
Select current sql_mode into a variable to restore later
I need to get the current sql_mode into a variable so that I can change it for a procedure, then return it to its previous state.
I can do
SHOW VARIABLES LIKE 'sql_mode';to see what they are, but how do I, say:
SET orig_mode = SHOW VARIABLES LIKE 'sql_mode';
so that I can later do:
SET SESSION SQL_MODE = ''; -- do stuff SET SESSION SQL_MODE = orig_mode;
How to correctly separate this query
I'm trying to sort through my table to find the frequent categories in my orders. After conducting this query
SELECT ccd.cart_id, mp.category_name, ccd.quantity FROM customer_orders co JOIN customer_cart_dtls ccd ON co.order_cart = ccd.cart_id JOIN merchant_products mp ON ccd.product_id = mp.product_id
which yields this result
So from that query Cart #2006........63 has 9 items. 1 from eatables, 3 From fruits, 2 From cleaning, and 3 from Snacks. All of them quantity 1 except for the second entry of cleaning which has two. How can I alter my query so that I get 10 items all with quantity 1?
Which would look like this