nitiphone2021
-
Posts
85 -
Joined
-
Last visited
Posts posted by nitiphone2021
-
-
Dear friend, I help about this command below
SELECT CASE WHEN `p_age` < 18 THEN 'under 18' WHEN `p_age` BETWEEN 18 and 29 THEN '18-29' WHEN `p_age` BETWEEN 30 and 39 THEN '30-39' WHEN `p_age` BETWEEN 40 and 49 THEN '40-49' WHEN `p_age` BETWEEN 50 and 59 THEN '50-59' WHEN `p_age` BETWEEN 60 and 69 THEN '60-69' WHEN `p_age` BETWEEN 70 and 79 THEN '70-79' WHEN `p_age` > 80 THEN 'Over 80' END as RANGE_AGE, count(`id`) as COUNT FROM `tb_people_quarantine` GROUP BY RANGE_AGE ORDER BY RANGE_AGE";
and the result is below
The result I want it will show 'OVER 80' 0
the same as other range age, if they are no information should show 0
-
19 hours ago, requinix said:
Add the if_gender to the list of SELECTed fields as well as the GROUP BY. Then you'll get one set of results that shows the count per age range and gender.
This one can be work but not include the COMMAND3, it's total gender
-
Dear friends,
I have a problem about my website and my website they have a lot of query information. so it make my website very slow.
I would like to make query command is shorter and faster as these 3 commands.
COMMAND1: show all people
COMMAND2: show only male
COMMAND3: show only female.
Any way I can combine them? Is it faster than old command?
COMMAND 1 SELECT CASE WHEN `if_age` < 18 THEN 'under 18' WHEN `if_age` BETWEEN 18 and 29 THEN '18-29' WHEN `if_age` BETWEEN 30 and 39 THEN '30-39' WHEN `if_age` BETWEEN 40 and 49 THEN '40-49' WHEN `if_age` BETWEEN 50 and 59 THEN '50-59' WHEN `if_age` BETWEEN 60 and 69 THEN '60-69' WHEN `if_age` BETWEEN 70 and 79 THEN '70-79' WHEN `if_age` > 80 THEN 'Over 80' END as RANGE_AGE, count(`people_id`) as COUNT FROM `tb_infected` WHERE tb_infected.qf_id = 1 GROUP BY RANGE_AGE ORDER BY RANGE_AGE COMMAND2 SELECT CASE WHEN `if_age` < 18 THEN 'under 18' WHEN `if_age` BETWEEN 18 and 29 THEN '18-29' WHEN `if_age` BETWEEN 30 and 39 THEN '30-39' WHEN `if_age` BETWEEN 40 and 49 THEN '40-49' WHEN `if_age` BETWEEN 50 and 59 THEN '50-59' WHEN `if_age` BETWEEN 60 and 69 THEN '60-69' WHEN `if_age` BETWEEN 70 and 79 THEN '70-79' WHEN `if_age` > 80 THEN 'Over 80' END as RANGE_AGE, count(`people_id`) as COUNT FROM `tb_infected` WHERE tb_infected.qf_id = 1 and if_gender = 0 GROUP BY RANGE_AGE ORDER BY RANGE_AGE COMMAND3 SELECT CASE WHEN `if_age` < 18 THEN 'under 18' WHEN `if_age` BETWEEN 18 and 29 THEN '18-29' WHEN `if_age` BETWEEN 30 and 39 THEN '30-39' WHEN `if_age` BETWEEN 40 and 49 THEN '40-49' WHEN `if_age` BETWEEN 50 and 59 THEN '50-59' WHEN `if_age` BETWEEN 60 and 69 THEN '60-69'WHEN `if_age` BETWEEN 70 and 79 THEN '70-79' WHEN `if_age` > 80 THEN 'Over 80' END as RANGE_AGE, count(`people_id`) as COUNT FROM `tb_infected` WHERE qf_id = 1 and if_gender = 1 GROUP BY RANGE_AGE ORDER BY RANGE_AGE
-
17 minutes ago, requinix said:
But are you doing that for every place that calls session_start()? It's still better to configure the session cookie in your php.ini, not in code. Never have to think about it if it's configured there.
There's more to a cookie than just its expiration. What are the details of the cookie as seen by your browser? I'm talking like domain, path, and flags.
Can you give me a basic of php.ini. then every page I just add command include('php.ini');?
on my brownser cookie:
NAME = PHPSESSID
content = 097bea5d9dd76cb2276566a737ae73b0
domain = legal-aid.moj.gov.la
path = /
send for = Same-site connections only
Accessible to script = Yes
Created = Friday, January 15, 2021 at 9:51:28 AM
Expires = When the browsing session ends
-
On 1/13/2021 at 2:20 PM, requinix said:
Browse around your site and make sure the browser always says the page is encrypted, or at least it never says it isn't encrypted.
With Chrome, for example, a padlock icon on the left of the address bar means it's HTTPS.I already check all website are HTTPS.
before I start session, I set session_set_cookie_params(0);
what's the next step I need to check?
-
20 minutes ago, requinix said:
Make sure every page on your website is being served over HTTPS. Also check your session cookie settings.
Can you give me more example about served over HTTPS? It's my first time that I create web php on https
-
Hi friends.
I have a problem with https about $_SESSION in php
last time my website is working correctly with http but after change to https I can send value of session to another page
login.php
session_start();
$_SESSION['user_ID'] = 8;
Action.php
session_start();
echo "User ID = " . $_SESSION['user_ID'] ; //// It's not show any thing
Thank you very much for your help
sql query, select age range and show none information
in MySQL Help
Posted
Yes, I tried but seem is not work on my laptop
Result below: