Click here to Skip to main content
15,847,963 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Problem with Statistics Pin
Sascha Lefèvre27-Apr-15 16:06
professionalSascha Lefèvre27-Apr-15 16:06 
GeneralRe: Problem with Statistics Pin
Member 836750227-Apr-15 19:00
Member 836750227-Apr-15 19:00 
GeneralRe: Problem with Statistics Pin
Sascha Lefèvre27-Apr-15 19:26
professionalSascha Lefèvre27-Apr-15 19:26 
GeneralRe: Problem with Statistics Pin
Member 836750230-Apr-15 13:13
Member 836750230-Apr-15 13:13 
QuestionEcrypt PHP Application Pin
Jassim Rahma14-Apr-15 22:52
Jassim Rahma14-Apr-15 22:52 
AnswerRe: Ecrypt PHP Application Pin
Graham Breach15-Apr-15 8:54
Graham Breach15-Apr-15 8:54 
QuestionRESOURCE Role Pin
Member 1072866713-Apr-15 16:38
Member 1072866713-Apr-15 16:38 
Questionwhy the sign-in is slow?! Pin
Jassim Rahma23-Mar-15 10:58
Jassim Rahma23-Mar-15 10:58 
Hi,

I have this page:

http://www.mybluefile.com/[^]

it's too slow when I sign in.. there is no problem with the line because I am able to ping with good latency as you can see in this ping result:

http://www.jassimrahma.com/temp/ping_result.png[^]

below is my stored procedure for the sign in and I have indexes applied.

where is the problem and how can investigate such case?

SQL
CREATE DEFINER=`root`@`%` PROCEDURE `sp_web_login_employee`(IN param_login_name varchar(255), IN param_login_password_salt varchar(255), IN param_login_password_hash varchar(255), IN param_ip_address varchar(255))
BEGIN
	DECLARE param_employee_id INT;
	DECLARE email_address VARCHAR(255);

	-- IF EXISTS (SELECT user_id FROM users WHERE login_name = param_login_name AND login_password_hash = param_login_password_hash AND is_blocked = FALSE) THEN
	IF EXISTS (SELECT employee_guid FROM employees WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE) THEN
	BEGIN
		DECLARE param_employee_guid VARCHAR(255);

		SET param_employee_id = (SELECT employee_id FROM employees WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE);
		SET param_employee_guid = (SELECT employee_guid FROM employees WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE);

		UPDATE employees SET last_login_date = UTC_TIMESTAMP(), last_login_ip = param_ip_address WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE AND current_employee = TRUE;
		-- CALL sp_add_event_log("USER", param_user_id, param_user_id, "User logged on successfully.");

		-- UPDATE employees SET last_login = NOW(), allow_delete = FALSE WHERE login_name = param_login_name AND login_password_salt = param_login_password_salt AND login_password_hash = param_login_password_hash AND is_active = TRUE;

		SET email_address = (SELECT contact_details FROM employee_contacts INNER JOIN contact_category ON contact_category.contact_category_id = employee_contacts.contact_category WHERE contact_category.contact_category_type = "EMAIL" AND employee_contacts.employee_id = param_employee_id AND employee_contacts.use_for_communication = TRUE);

		SELECT email_address, employees_table.employee_id, employees_table.employee_number, employees_table.employee_guid, employees_table.first_name, employees_table.second_name,
		employees_table.third_name, employees_table.fourth_name, employees_table.last_name, employees_table.official_name, employees_table.photo,
		managers_table.employee_id AS manager_id, managers_table.official_name AS manager_name, employee_job.contract_id, employee_contracts.contract_start,
		employee_contracts.contract_expiry, job_titles.job_title_name, departments.department_name, companies.company_name, locations.location_name, country.country_name
		FROM employees employees_table
		JOIN employee_contracts ON employees_table.employee_id = employee_contracts.employee_id
		JOIN employee_job ON employees_table.employee_id = employee_job.employee_id
		JOIN job_titles ON employee_job.job_title = job_titles.job_title_id
		JOIN companies ON employee_job.company_id = companies.company_id
		JOIN departments ON employee_job.department = departments.department_id
		JOIN locations ON employee_job.company_location = locations.location_id
		JOIN country ON locations.country_code = country.country_code_alpha2
		LEFT JOIN employees managers_table ON employee_job.reporting_to = managers_table.employee_id
		WHERE employees_table.login_name = param_login_name AND employees_table.login_password_salt = param_login_password_salt AND employees_table.login_password_hash = param_login_password_hash AND employees_table.is_active = TRUE AND employees_table.current_employee = TRUE AND employee_job.is_current = TRUE;
	END;
	END IF;

END



Technology News @ www.JassimRahma.com

QuestionSQL Pin
Member 1072866722-Mar-15 21:30
Member 1072866722-Mar-15 21:30 
QuestionRe: SQL Pin
Richard MacCutchan22-Mar-15 23:01
mveRichard MacCutchan22-Mar-15 23:01 
AnswerRe: SQL Pin
syed shanu22-Mar-15 23:28
mvasyed shanu22-Mar-15 23:28 
QuestionHow to expire a session? Pin
Jassim Rahma20-Mar-15 9:14
Jassim Rahma20-Mar-15 9:14 
AnswerRe: How to expire a session? Pin
speda127-Sep-15 14:15
speda127-Sep-15 14:15 
QuestionHow to Delete file when Selected from Dropdown List Pin
Member 1150850510-Mar-15 21:09
Member 1150850510-Mar-15 21:09 
QuestionRe: How to Delete file when Selected from Dropdown List Pin
Richard MacCutchan10-Mar-15 23:08
mveRichard MacCutchan10-Mar-15 23:08 
AnswerRe: How to Delete file when Selected from Dropdown List Pin
Member 1150850510-Mar-15 23:11
Member 1150850510-Mar-15 23:11 
GeneralRe: How to Delete file when Selected from Dropdown List Pin
Richard MacCutchan11-Mar-15 0:10
mveRichard MacCutchan11-Mar-15 0:10 
QuestionDisplay results based on dropdown selected dropdown value Pin
samflex10-Mar-15 8:47
samflex10-Mar-15 8:47 
AnswerRe: Display results based on dropdown selected dropdown value Pin
tobisoft28-Apr-15 14:34
tobisoft28-Apr-15 14:34 
GeneralRe: Display results based on dropdown selected dropdown value Pin
nilprajapati8-Dec-15 23:13
nilprajapati8-Dec-15 23:13 
QuestionCan't get ubuntu boot to recognize USB drive! Pin
swampwiz22-Feb-15 8:46
swampwiz22-Feb-15 8:46 
QuestionHow Can I Detect Whether My Total Price Is Greater Than The Price I Inputted On Textbox Pin
Patrick sarmiento12-Feb-15 21:49
Patrick sarmiento12-Feb-15 21:49 
SuggestionRe: How Can I Detect Whether My Total Price Is Greater Than The Price I Inputted On Textbox Pin
Richard MacCutchan12-Feb-15 23:50
mveRichard MacCutchan12-Feb-15 23:50 
QuestionPass datepicker value to PHP & MySQL Pin
Jassim Rahma8-Feb-15 0:28
Jassim Rahma8-Feb-15 0:28 
AnswerRe: Pass datepicker value to PHP & MySQL Pin
Thomas Daniels8-Feb-15 3:59
mentorThomas Daniels8-Feb-15 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.