AT-2013 Posted March 27, 2013 Share Posted March 27, 2013 (edited) 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 March 27, 2013 by AT-2013 Quote Link to comment https://forums.phpfreaks.com/topic/276230-urgent-help/ Share on other sites More sharing options...
AT-2013 Posted March 27, 2013 Author Share Posted March 27, 2013 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): <?phpclass 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> ques.php completed.php subjects.zip books.zip question5.zip Quote Link to comment https://forums.phpfreaks.com/topic/276230-urgent-help/#findComment-1421461 Share on other sites More sharing options...
trq Posted March 27, 2013 Share Posted March 27, 2013 You forgot to ask a question. You also forgot the fact that no one here cares how urgent your project is. If you want help fast, hire a programmer, otherwise ask your question and wait in line. Quote Link to comment https://forums.phpfreaks.com/topic/276230-urgent-help/#findComment-1421488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.