Results 1 to 2 of 2

Thread: Login Faild

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Question Login Faild

    PHP Code:
    <?php

    include_once "inc/mscon.php";
    mysql_select_db("zfyl"$ddcon);
    $result mysql_query("SELECT nik,pas FROM 'zfyl' WHERE nik = '".$_POST["nik"]."'"$ddcon);
    if (!
    $result) {
    echo 
    'Could not run query: ' mysql_error();
    exit;
    }
    $row mysql_fetch_row($result);

    $nikr $row[0];
    $pasr $row[1];

    if(
    $_POST["pas"] == $pasr){
    echo 
    "Your Pass:".$pasr;
    echo 
    "Your Nick:".$nikr;

    }

    ?>
    echo "Your Pass:".$pasr;
    echo "Your Nick:".$nikr;

    }

    ?>
    my problem in this script becouse it is dont work and write next

    not selected databasae


    for helping in undestand here the register form too

    PHP Code:
    <?php
    include_once "inc/mscon.php";

    $na=$_POST["nik"];
    $p98=$_POST["pas"];



    //Create table
    mysql_select_db("d2zfyl"$ddcon);


    mysql_query("INSERT INTO zfyl
    (nik, pas)
    VALUES ("
    .$na.", ".$p98.")",$ddcon);


    mysql_close($ddcon);
    echo 
    "You succefully created the account. Your NICK NAME: ".$na." PASSWORD: ".$p98."";

    ?>

  2. #2
    Join Date
    Mar 2007
    Location
    Werrington, England
    Posts
    1,315
    What is the actual error that you are getting. You should check you are actually connecting to your database. You can then check your queries by doing this.

    PHP Code:
    mysql_query('..') or die(mysql_error()); 
    That will flag up errors with specific queries.

Similar Threads

  1. Login
    By Verean in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 31 Oct 2010, 12:44 PM
  2. Please Help With Login Details
    By silentarts in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 20 Mar 2008, 11:36 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •