Get ready for BLACK FRIDAY shopping starting in

Forums

PHP

This topic is locked

Plz Help for Making Online Questionnaire

Posted 18 Nov 2008 11:38:59
1
has voted
18 Nov 2008 11:38:59 Prerna Tamang posted:
Hello,

I am working on an online questionnaire which was initially done using ASP. Please help me convert this asp code to php as I am very new to PHP.

The Questionnarie works as follows:

1. It takes questions randomly from the database.
2. On correct submission, it shows question2.
3.The questions will be displayed as long as the highest question number is reached or the user stops the questions himself.

<%

//Random count
double k=(float)Math.random()*100;//get the random number
double tempdouble=Math.round(k);//current random record
long tempLong = (int)tempdouble;// conversion of double to long
Long curRecord=new Long(tempLong);//conversion long value to Long object..next record
int curRecordN = curRecord.intValue();

//Random count is adjusted with maximum record
if (curRecordN > 85){
//rs.close();
//out.println("When Records are more than 85";
curRecordN=84;
curRecord =new Long(curRecordN);
}

//JDBC Connection
Connection conn=null;

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver";
conn=DriverManager.getConnection("jdbc<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>dbc<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>nline";
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select * "+"from core_java";
%&gt;

I would be very grateful if anyone can provide help related to it. Please help me out.

Thanks,

Prerna


Prerna

Replies

Replied 10 Dec 2008 19:40:34
10 Dec 2008 19:40:34 Roddy Dairion replied:
Sorry dude but i don't think anybody will write the query for you. We can help you out if you've started it and its not working but writing the whole thing for you is not something you will likely to get here.

Reply to this topic