Long long day help me mysql error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Long long day help me mysql error

    ITS BEEN A LONG LONG DAY BASICALLY COS MY COLLEGE IS QUEER TEACHING DECIDING TO LEAVE AT THE BEGINGING OV THE YEAR OR TEACHERS WHO DECIDE TO COME IN ONCE OR TWICE A WEEK. WEV HAD TO TEACH OURSELVES FROM THE INTERNET THIS DOESNT INCLUDE WEB SCRIPTING, ITS NETWORKING,COMPUTER TROUBLE SHOOTING, COMPUTER ARCHIETECTURE LEARNING Intel 4004 . THE FIRST EVER PROCCESSOR. AND NW THEY DECIDE THEY WANT TO MARK THE WORK THAT SHOULD HAVE BEEN MARKED 7 FUKIN MONTHS AGO. AND TOLD US THAT MAJORITY OF ITS FUKIN WHAT THEY DIDNT WANT US TO RESEARCH AND RIGHT ON.... WHICH HAS MADE US ALL DOO THAT INSTEAD OF RECENT WORK. AND IV JUST REALISED THAT I HAVE SOMETHING OF PHP IN 2MORA. SO I RUSSLED SOMETHING UP QUICKLY AND FOR THE SAKE OF GOD I CANT HALF FIGURE OUT WERE AM GOING WRONG TOO MUCH BRAIN OVERLOAD. I WILL MOST LIKELY FIGURE IT OUT AFTER AN EARLY NYT BUT I WANT TO GET IT SORTED NW SO THATS ONE LESS PIECE OF **** OUT HTE WAY..


    WELL HERE IT IS.. SIMPLE BUT SO FUKIN FUSTRATING.

    PHP Code:
    <?php
    include('db_connect.inc');


    $username $_GET["username"]; // Global Variables
    $password$_GET["password"]; //Global Variables

    $count_users=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username=".$username.""));
    $check_pass=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username=".$username." AND password=".$password.""));

    if(
    $count_users[0]=0){
    echo 
    '<p align="center"><b> Username '.$username.' Does Not Exist</b><br/>';
    echo 
    '<a href="./index.php"><b>Return To Login</b></a></p>';
    exit();
    }else if(
    $check_pass[0]=0){
    echo 
    '<p align="center"><b>The Password Entered Is Incorrect Password</b></br>';
    echo 
    '<a href="./index.php"><b>Return To Login</b></a></p>';
    exit();
    }else{
    echo 
    '<p align="center"><b>Welcome Back '.$username.' You Have Successfully logged In</p>';  //Authentication Has Been Accepted
    exit();
    }
    Want something coded email me at sales@webnwaphost.com for a prices.





    #2
    what is the problem dude?
    i am not sure but ur problem is selecting datas from

    $count_users=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username=".$username.""));
    $check_pass=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username=".$username." AND password=".$password.""));



    please try


    $count_users=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username='".$username."'"));
    $check_pass=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username='".$username."' AND password='".$password."'"));



    or try this dude



    PHP Code:
    <?php
    include('db_connect.inc');


    $username $_GET["username"]; // Global Variables
    $password$_GET["password"]; //Global Variables

    $count_users=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username='".$username."'"));
    $check_pass=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username='".$username."' AND password='".$password."'"));

    if(
    $count_users[0]==0){
    echo 
    '<p align="center"><b> Username '.$username.' Does Not Exist</b><br/>';
    echo 
    '<a href="./index.php"><b>Return To Login</b></a></p>';
    exit();
    }else if(
    $check_pass[0]==0){
    echo 
    '<p align="center"><b>The Password Entered Is Incorrect Password</b></br>';
    echo 
    '<a href="./index.php"><b>Return To Login</b></a></p>';
    exit();
    }else{
    echo 
    '<p align="center"><b>Welcome Back '.$username.' You Have Successfully logged In</p>';  //Authentication Has Been Accepted
    exit();
    }
    Last edited by wapmetal; 23.06.10, 14:36.
    com site: http://vampist.net
    download site: http://wapdloads.net
    fb: http://www.facebook.com/pmplx

    Comment


      #3
      whats d demo i wana c d error mayb u missn sumtin

      Comment


        #4
        use this
        PHP Code:
        <?php
        include('db_connect.inc');


        $username $_GET["username"]; // Global Variables
        $password$_GET["password"]; //Global Variables

        $count_users=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username=".$username.""));
        $check_pass=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM members WHERE username=".$username." AND password=".$password.""));

        if(
        $count_users[0]==0){
        echo 
        '<p align="center"><b> Username '.$username.' Does Not Exist</b><br/>';
        echo 
        '<a href="./index.php"><b>Return To Login</b></a></p>';
        exit();
        }else if(
        $check_pass[0]==0){
        echo 
        '<p align="center"><b>The Password Entered Is Incorrect Password</b></br>';
        echo 
        '<a href="./index.php"><b>Return To Login</b></a></p>';
        exit();
        }else{
        echo 
        '<p align="center"><b>Welcome Back '.$username.' You Have Successfully logged In</p>';  //Authentication Has Been Accepted
        exit();
        }
        Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

        Comment


          #5
          error myt be in ur if statements tho using = instead of ==

          Comment


            #6
            i did use the == first but that didnt work either.

            the error is Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/webnwap/public_html/college/login2.php on line 7

            Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/webnwap/public_html/college/login2.php on line 8
            Username crazybrumi Does Not Exist
            Return To Login



            i might just code it slighly different
            Want something coded email me at sales@webnwaphost.com for a prices.




            Comment


              #7
              right i changed the sql slighly and with inserting mysql_error() it nw says No database selected
              Want something coded email me at sales@webnwaphost.com for a prices.




              Comment

              Working...
              X