Jump to content

Urgent help!


AT-2013

Recommended Posts

Hi!! I am new to PHP & i need to submit a project on online admission system where question sets are displayed randomly each time without repeat each time from 4 tables (subject table Physics, Maths, Computer, General knowledge) when a user logged in. This process should be automated like question sets will be in database. From each table questions should be randomly presented. I need it badly & need to submit on 6th april. So any code/script or demonstration will be appreciated. I have prepared a script only with one table. But need to work it according to the requirement. I am posting it here with table. Thnx. (SELECT * FROM table order by rand() limit 1") doesn't work. Any alternative??

 

 

 

 

ques.php

completed.php

subjects.zip

books.zip

question5.zip

Edited by AT-2013
Link to comment
Share on other sites

T

 

Hi!! I am new to PHP & i need to submit a project on online admission system where question sets are displayed randomly each time without repeat each time from 4 tables (subject table Physics, Maths, Computer, General knowledge) when a user logged in. This process should be automated like question sets will be in database. From each table questions should be randomly presented. I need it badly & need to submit on 6th april. So any code/script or demonstration will be appreciated. I have prepared a script only with one table. But need to work it according to the requirement. I am posting it here with table. Thnx. (SELECT * FROM table order by rand() limit 1") doesn't work. Any alternative?? The name of the database is "online" for the following scripts. If possible any modification to the following: The database connection for it is:

(ms.php):

<?php
class dbconn{
    var $dblink;

    function dbconn($dbname, $dbhost="localhost", $dbuser="root"){
        $this->dblink = mysql_connect($dbhost,$dbuser);
        mysql_select_db($dbname);
    }
    function stresc($str){
        return mysql_real_escape_string($str);
    }

    function close(){
        mysql_close($this->dblink);
    }
}
class dbrs{
    var $rs;
    var $row;
    var $num;
    var $rows=array();

    function dbrs($sql,$ret){
    $ret=($ret==1)?"exeret":"exenr";
    $this->$ret($sql);
    }
    function exenr($sqlquery){
        mysql_query($sqlquery);
    }
    function exeret($sqlquery){
        $this->rs = mysql_query($sqlquery) or die(mysql_error());
        $this->num = mysql_num_rows($this->rs);
        while($row=mysql_fetch_array($this->rs)){
            $this->rows[] = $row;
        }

    }
}
?>

 

(fail.php):

<center><h1>You are failed</h1>
<h2>You may try again later</h2>
<table border = "1">
<tr>
<td>Your grades are less than 50%</td>
</tr>
</table>
<a href = "index.html">Logout</a>
</center>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.