Jump to content

gaya

Members
  • Posts

    101
  • Joined

  • Last visited

Everything posted by gaya

  1. Now i've to do another thing. i.e.) I've a submit button and review button. By clicking submit button the answer get saved and the not answered image will change to answered image. But by clicking the review button the written answers should get save in a txt file and then the not answered image is get updated to review _answer image. How shall i do this. Any ideas please tell me.
  2. Thanks Don. By using the code i get the result. $numRows = mysql_num_rows($res);if($numRows == 0) // for not answered image{ echo "<a href='a.php?no=$no∂=$part&qpid=$qpid&board=$board&subject=$subject&StudentId=$StudentId&totalrows=$totalRows1'><img src='img/not_answered.png'></a>";} Thanks again.
  3. No no not like that. my concept writing exams in online & if a student had already attended the question he should not able to write again. So i'd set some images,as not_answered,review_answer,answered. By checking the flag values the images will get changed.the following is my code. In that i've to set the not_answered image as default. But i cann't. Please tell me wat i did wrong in that. $query2="select flag from tablename where id ='$Id' && no ='$no'"; $res=mysql_query($query2); if(!$res) { echo "<a href='a.php?no=$no∂=$part&qpid=$qpid&board=$board&subject=$subject&StudentId=$StudentId&totalrows=$totalRows1'><img src='img/not_answered.png'></a>"; } else { while($rw = mysql_fetch_array($res)) { $flag1=$rw['flag']; if($flag1==1) { echo "<a href='a.php?no=$no∂=$part&qpid=$qpid&board=$board&subject=$subject&StudentId=$StudentId&totalrows=$totalRows1'><img src='img/review_answer.png'></a>"; } else if($flag1==2) { echo "<a href='a.php?no=$no∂=$part&qpid=$qpid&board=$board&subject=$subject&StudentId=$StudentId&totalrows=$totalRows1'><img src='img/answered.png'></a>"; } else { echo "<a href='aphp?no=$no∂=$part&qpid=$qpid&board=$board&subject=$subject&StudentId=$StudentId&totalrows=$totalRows1'><img src='img/not_answered.png'></a>"; } }}
  4. Hi, Pease anyone tell me, how to check whether the query is executing or not?
  5. gaya

    if...else

    Thanks birbal. i did it by using insert and update.
  6. gaya

    if...else

    Please tell me a thing. My tables questionpaper,ShortQues and paper_valuation_inter. I'd merged some values from questionpaper and ShortQues then inserted into paper_valuation_inter. The following is my code $query2="SELECT B.Subject, A.subject, A.orderno, A.qpid, A.qno, A.tablename, A.part,A.flag,A.maxmark,A.flagFROM questionpaper AS A, ShortQues AS BWHERE A.subject = '$Subject' && B.Subject = '$Subject' && A.orderno =$orderno && A.qpid = '$qpid' && A.qno ='$quesnum' && A.tablename = 'ShortQues' && A.part = '$part' && A.qno=B.QNo "; //gayu $result2=mysql_query($query2); //echo "$query2"; //gayuwhile($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)){//echo "<script>alert('$result2')</script>";//$StudentId=$row2['StudentId'];$orderno=$row2['orderno'];$quesnum = $row2['qno'];$Subject=$row2['subject'];$qpid=$row2['qpid'];$part=$row2['part'];$maxmark=$row2['maxmark'];$flag=$row2['flag'];$tablename=$row2['tablename'];if($orderno=="null") //here i dnt knw wat to use to check the condition{$query3="insert into paper_valuation_inter values(null,'$StudentId','$orderno','$quesnum','$Subject','$qpid','$tablename','$part','$maxmark','$flag')";$result3=mysql_query($query3);//echo "$query3";echo "<script>alert('Question inserted into the table')</script>";}else{$query3="update paper_valuation_inter set flag=1 where orderno='$orderno' && userid='$StudentId' && qno='$quesnum' && subject='$Subject' && qpid='$qpid' && tablename='$tablename' && part='$part' && maxmark='$maxmark' && flag='$flag'";$result3=mysql_query($query3);echo "$query3";echo "<script>alert('update table')</script>";} In that i dnt knw how to use if condition. Is there the possibility of doing this with "REPLACE" or shall i do with this code itself. please tell me. If means please tell me wat i did wrong in this code.
  7. gaya

    if...else

    yes, I'd set the primary key for id.Please tell me y to use "REPLACE" and y not "insert and update" query
  8. gaya

    if...else

    Hi, I need to know some logic please any1 help me. Now i'd merged some values from 2 different tables and inserted the merged values in 3rd table with some values.for eg if i've given some values like,id=1,name=tweety,subject=sst,maxmark=5 & flag=0The above values i've already inserted in the 3rd table.The second time when inserting into the table with same values i got them insertd again in 3rd table.Now i want, not the same values to insert into the table again and again. I want to update them.I dont knw how to implement them using if condition.Please any1 tell me the logic.
  9. gaya

    Next and Previous button

    Thank you Mudsaf and birbal.
  10. Hi, Please any1 tell how to set the previous button. For eg if i'm writing an exam in online and i'm viewing the questions one by one. If i viewed the first question i'll press the next button to view the 2nd question.Bt if i again want to view the 1st question means i've to click the previous button. I dnt knw how to set the previous button. Please any one tell me how to do this.
  11. Thanks to all. But it will be a big process in changing the code. So i've got an idea of doing this with includind some images by checking the condition for flag values. Now for that i was supposed to write the query for joining 2tables with some values and then insert into another table with same values. $query2="SELECT A.Subject='$Subject' && B.orderno='$orderno' && B.qpid='$qpid' && B.tablename='ShortQues' && A.Qno=B.qno && B.part='$part' FROM ShortQues A, questionpaper B WHERE A.Subject = 'Social_Tamil' && B.subject='Social_Tamil'"; $result2=mysql_query($query2); echo "$query2";$query3="insert into Paper_valuation_inter values(null,$StudentId,$orderno,$qno,'$Subject','$qpid','$tablename','$part',maxmark,0)";$result3=mysql_query($query3); The above is my query and i dont knw whether it do wat i need. my table fields are Id,StudentId,orderno,qno,'Subject','qpid','tablename','part',maxmark,flag. ShortQues , questionpaper,Paper_valuation_inter are my 3tables.
  12. Hi, Please any1 tell me, how to skip from one question to another. For example if i'm writing the exam in online, and if i've attended the question already and that question is evaluated, the attended question should not be viewed again.I dont know how to do this in if condition. please any1 tell me how to do this.
  13. Thanks Thescientist. I had Viewed the page u've suggested and did my code. Thanks
  14. I solve the Wrong permissions on configuration file, should not be world writable! pbm.please tell me, how to insert the values in database through texbox. While clicking submit the thing what i have entered is to be seen into my database.How shall i do this.please tell me
  15. Thanks Birbal and Thescientist for sharing me the useful and helpful replies. :)Another thing is when connecting to localhost"http://localhost/phpmyadmin/" it is showing lik tisWrong permissions on configuration file, should not be world writable!Why it is showing lik tis. please tell me. whether anything i've entered might b wrong.
  16. Thanks Birbal.Also please tell me,Might b my question is silly, but i dnt knw, tats y i'm asking.please tell me ,the following is the sample code welcome.html <html><body><form action="welcome.php" method="post">Name: <input type="text" name="fname">Age: <input type="text" name="age"><input type="submit"></form></body></html> welcome.php <html><body>Welcome <?php echo $_POST["fname"]; ?>!<br>You are <?php echo $_POST["age"]; ?> years old.</body></html> whether both should get saved in htdocs folder only or else the .php alone should be saved in htdocs folder.Also please tell me how to execute this. please.
  17. Hi, I am learning php newly. I see some examples containing .html file for getting input and .php file for getting output. I cant understand this. please any1 explain this how to do this, and y we r doing like this.please
  18. gaya

    linking webpage

    Thanks for the reply. I did it nw and its working fine.
  19. gaya

    linking webpage

    please tell me, how to align the submit and reset button in the middle
  20. gaya

    linking webpage

    Thanks for the reply
  21. gaya

    Html link

    ok, and sorry for asking in both.
  22. gaya

    linking webpage

    thanksfor ur replies.the link is useful and i did it.please tell me wat the focus will do.And how to set the focus.
  23. gaya

    Html link

    ya i mean that only. And nw i did it by seeing this link http://www.w3schools.../html_links.asp.Now when clicking login without entering the username and password please tell me how to set focus.
  24. hai,I'm learning the html newly.Just i did my first html code for login page with radio buttons.Now i want to link a web page in that code itself. how shall i do it using tables.please any1 give me an example for linking the webpage.I just created a login page for student and teacher. If student is selected i've to link it with a webpage like www.google.co.in. how can i do this using html table and java script. please any1 help me.
  25. gaya

    Html link

    hai, I'm learning the html newly.Just i did my first html code for login page with radio buttons.Now i want to link a web page in that code itself. how shall i do it using tables.please any1 give me an example for linking the webpage.I just created a login page for student and teacher. If student is selected i've to link it with a webpage like www.google.co.in. how can i do this using html table and java script. please any1 help me.
×
×
  • Create New...