Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3951476
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:44:06+00:00 2026-05-20T01:44:06+00:00

I have this login code, which works last night before I slept. Nobody used

  • 0

I have this login code, which works last night before I slept. Nobody used my computer. But this morning suddenly stopped working. My other codes also not working properly. Well in fact I made sure that they’re all working before I left them.
I reformatted my hard drive. I had a backup of the working project. I can’t really understand why it wouldn’t work. Anyone experienced this before?

<?php 




include('conn.php');








        $uname = mysql_real_escape_string($_POST['yname']);
        $pword = $_POST['pword'];
        $pwordmd5=md5($pword);



        $result = query_database("SELECT * FROM admin_table WHERE   Uneym = '$uname' AND Pwerd = '$pwordmd5'", "onstor", $link);
        $num_rows = mysql_num_rows($result);



        if ($result) {
            if ($num_rows > 0) {
                session_start();
                $_SESSION['loginAdmin'] = "1";



                //added feb 5 2011

                $_SESSION['Uneym'] = $uname;






                query_database("UPDATE admin_table SET Current='1' WHERE   Uneym = '$uname' AND Pwerd = '$pwordmd5'", "onstor", $link);



                    header ("Location: adminpage.php");


            }



            else {
                session_start();
                $_SESSION['loginAdmin'] = "";
                header ("Location: ../login.php");
            }   
        }
        else {
            $errorMessage = "Error logging on, please try again.";
        }











?>

I had this on php error log:

[12-Feb-2011 23:49:14] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: [2002] A connection attempt failed because the connected party did not  (trying to connect via tcp://localhost:3306) in X:\wamp\www\pos\php\conn.php on line 6

[12-Feb-2011 23:49:14] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

 in X:\wamp\www\pos\php\conn.php on line 6

[12-Feb-2011 23:49:14] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in X:\wamp\www\pos\php\conn.php on line 6

    [12-Feb-2011 23:49:35] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: [2002] A connection attempt failed because the connected party did not  (trying to connect via tcp://localhost:3306) in X:\wamp\www\pos\php\conn.php on line 6

    [12-Feb-2011 23:49:35] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

     in X:\wamp\www\pos\php\conn.php on line 6

    [12-Feb-2011 23:49:35] PHP Fatal error:  Maximum execution time of 60 seconds exceeded in X:\wamp\www\pos\php\conn.php on line 6

    [12-Feb-2011 23:50:01] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: [2002] A connection attempt failed because the connected party did not  (trying to connect via tcp://localhost:3306) in X:\wamp\www\pos\php\conn.php on line 6

    [12-Feb-2011 23:50:01] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

     in X:\wamp\www\pos\php\conn.php on line 6

Here’s conn.php which is being pointed out by the error logs:

<?php



function open_connection($host, $user, $password){
    return mysql_connect($host, $user, $password);

}

function close_connection($link){
    return mysql_close($link);

}

function query_database($query, $database, $link){
    mysql_select_db($database, $link);
    return mysql_query($query, $link);
}

function fetcher($result){
    return mysql_fetch_assoc($result);

}

function query_checker($query){
    if(!$query){
    echo "error!".mysql_error();
}
    return mysql_error();

}

$link=open_connection('localhost','root', '1234');
?>

Also haven’t modified conn.php, since its the first script that should be written when you want to connect to the database. And one more thing, before I reformatted, the whole project was one c drive. Now I’m on x drive. I’m not really sure if that’s the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:44:07+00:00Added an answer on May 20, 2026 at 1:44 am

    Your database appears to be down. Try restarting your mysql service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service, which works if I use one login, but throws
I have this horribly stripped delphi code that basically login to server, save cookie
I have the code below which works fine, steps through the rows pinging each
I have a piece of code which works in a way that is unexpected
I have this login form which uses AJAX to query a database for checking
I have a login page using jQuery Mobile which contains the following code: <div
We tried last night to build some code which would create a new public
I'm using the following code, which works, to login a user to an application
i have this code, and need help with the logic end. I would like
I have this code: using DC = MV6DataContext; using MV6; // Business Logic Layer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.