Jump to content

valdes

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by valdes

  1. Ok I been working our on something, again a login page other conditions seem to work except this. It doesn't seem to show errors but when I compile inside wamp, I see this

     

    Unknown column in where clause

     

    Code goes like this

    else if($username!=="admin" && $password!=="admin")
    		{
    			//do a connection to database and check for existing user..
    			$con = mysqli_connect(DBHOST,DBUSER,DBPASS,DB) or die ('Cannot connect');
    			mysqli_select_db($con,DB);
    			$query = "select * from users where username = $username AND password = $password";
    			$result = mysqli_query($con,$query);
    			if($result == false)
    			{
    				die('Error :'.mysqli_error($con));
    			}
    			$rows = mysqli_num_rows($result);
    			
    			if($rows==1)
    			{
    				$_SESSION['login_user'] = $username;
    				header("Location: lecturerarea.php?login=new");
    				mysqli_close($con);
    			}
    		}
    
    Pls what seems to go wrong here?
  2. Ok good morning to you all, I have been working on an online quiz / cbt (computer based testing) program, I have been successfully able to create the admin area where the administrative can upload questions as well as create users who would be writing the exams, but here is my challenge

    I have two challenges, writing a php script to load the questions from the database and then display on a page with the multiple choice answer as radio button

     

    And when the user clicks the answer he / she chooses, it checks for the correct answer from the database and if it's correct, accepts the answer and moves to the next question.

     

    How do I go about this in php,kindly help, I think I am missing something here.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.