Category : mysql

SELECT category_id,product_size,category_name,SUM(product_quantity) AS total_quantity FROM tbl_categories_quantity (table-1) INNER JOIN tbl_categories USING (category_id) GROUP BY category_id,product_size The Above Code is working in a single table, and I want to Add the below code (2nd table) that does not work SELECT category_id,product_size, SUM(product_sell) AS total_sell FROM tbl_product_sell (table-2) GROUP BY category_id,product_size THANKS Advance Sourc..

Read more

I just can’t make a request that will count only unique records. There is a table: bbs with columns: to_id – to whom from_id – from whom SELECT COUNT(DISTINCT *) AS `count` FROM `bbs` WHERE `to_id`=? OR `from_id`=? You need, for example, this data: from_id to_id 1 2 2 1 1 3 1 4 That ..

Read more

I want to copy the newest timestamp with data type "DATETIME" of my data to the another table each time newest data inserted Source Table (table1) : id task_id … inq_dt status 1 11111 … 2021-09-25 08:33:04 ok 2 11111 … 2021-09-25 08:35:14 ok 3 22222 … 2021-09-25 08:36:54 ok 4 11111 … 2021-09-25 08:38:34 ..

Read more

i have a problem i have a panel that coded with php and i want to change it to nodejs as backend but i face the problem the password coded with php in this code : function cryptPassword($password, $salt="fivestar", $rounds=20000) { if ($salt == "") { $salt = substr(bin2hex(openssl_random_pseudo_bytes(16)),0,16); } $hash = crypt($password, sprintf(‘$6$rounds=%d$%s$’, $rounds, ..

Read more

When you tick the optional checkbox to subscribe to my newsletter on my html form and when you submit the form, my Mysql Database entry "newsletter_subscribe_yes" column shows NULL entry. Why ? Particular Form Input <label for="newsletter_subcribe_yes">Newsletter Subcribe:Yes</label> <input type="checkbox" name="newsletter_subcribe_yes" id="newsletter_subcribe_yes" value="Newsletter Subcribe:Yes"> <br> Full Form Submission Script <?php ini_set(‘display_errors’,’1′); ini_set(‘display_startup_errors’,’1′); error_reporting(E_ALL); ?> <form ..

Read more

I have 40 columns rows that i want to fill in "No Data" automatically. This my code: if (isset($people)) { $sql = "SELECT * FROM people WHERE Name = ‘$people’ LIMIT 0,1"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo " <table> <tr><th>Name</th><td>". $row["Name"]."</td></tr> <tr><th>Full Name</th><td>". $row["FullName"]."</td></tr> <tr><th>Address</th><td>". $row["Address"]."</td></tr> <tr><th>BirthDate</th><td>". $row["BirthDate"]."</td></tr> <tr><th>Spouses</th><td>". $row["Spouses"]."</td></tr> etc.. ..

Read more