Jump to content

Nigel12

New Members
  • Posts

    8
  • Joined

  • Last visited

Nigel12's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Barand, No I had not stored the users response I simply had the question marked ie label with the word Correct & label with Incorrect as soon as the user selected either A, B, C the question was instanly scored. I then uploaded there score to the database If correctResult.Text = "Answer1" Then AnswerCorrect.Text = CStr(CDbl(AnswerCorrect.Text) + 1) Anyway Im now looking at what you have given me regarding the left join. I have not done something like this before so I will come back after I have played. spk soon
  2. Hi, I have created a quiz and the questions get read from a MySql database table. I am now wanting to stop it repeating questions, when I first started this I thougt it would be easy just create a column called Duplicate and everytime a question got pulled I would mark it in the databse. So it would only read questions that had a "0" in the DuplicateCol and after reading the question it would put a "1" in place of the "0" That would work, the problem being multiple people are using it so if a 1 is there they wont all get asked the question. Anyway that idea is a fail now, which is a shame because everything else worked. Im hoping someone can show me another way on stopping duplicates. when I created the quiz I created a registration, and login page which have there own table I then created another table for the questions with multiple columns ie " id, Question, Answer1, Answer2, Answer3, CorrectAnswer, DuplicateCol " I had a number on my form which is a random number that lets say is "6" will then pull the question from column id 6 Query = "select Question,Answer1,Answer2,Answer3,CorrectAnswer,DuplicateCol from Questions where DuplicateCol= '0' AND id='" + RandomN.Text + "'" Anyway im for the time being lost until someone can give me ideas please, The registration, login table looks like this id, Serial, Email, UserName, Location, UserScore, Activated, I was thinking of adding q1, q2, q3, q4, q5, etc etc and then somehow if a question got pulled in my questions table with id "6" then put a "1" in the column but I think it might be to hard to try and cross reference 2 tables. Any Ideas ?
  3. Hi Phycho, So I can now confirm that it did work, and this would be a great opportunity for you to jump in and give a detailed explanation. I look forward to reading it, I have been following tutorials on w3schools which is good. But I enjoy putting them in to practice which quite often throws errors back. Thats when Forums like this become there weight in gold. in in the meantime im already working on my next thread 😉
  4. Hi, so I have just tried this Query = "select Question from Questions where DuplicateCol= 'False' AND id='" + RandomN.Text + "'" it appears to work I will put it in to my main work and see what happens. But none the less Barand, Thankyou
  5. Hi Barand, thanks for the answer, but it throws problems back at me. So I created a new form and reduced the query so I could concentrate on getting it right. On my form I have a button 1 x TextBox and 1 x Label The label will hold a random number between 1 and 45 (currentlty holding the number 6) I have called the label 'RandomN' The TextBox is simply called 'TextBox2' My original query was Query = "select Question,Answer1,Answer2,Answer3,CorrectAnswer,id,Duplicate from Questions where id='" + RandomN.Text + "'" I looked at what your answer said and came up with this one below. Query = "select Question from Questions where id= 'RandomN.Text' AND DuplicateCol= '" + False + "'" The error I get is Conversion form string 'select Question form Questions w' to type 'Double is not valid Now if I am simply selecting from one column its easy right. lol Query = "select Question from Questions where DuplicateCol= 'False'" Anyway my next attempt was Query = "select Question from Questions where DuplicateCol= 'False' AND id'" + RandomN.Text() + "'" But this one just throws me an error telling me I have an error with my Sql syntax near 6 at line 1 As for the VB.NET dig I dont need your sympathy I am getting round to learning other things. Im just to busy, in fact im the busiest person I know. Im fairly confident most would fall apart at my work load .)
  6. Hi, I have a MySql query which currently looks like this Query = "select Question,Answer1,Answer2,Answer3,CorrectAnswer,id,Duplicate from Questions where id='" + RandomN.Text + "'" As you can see I have a table called 'Questions' which has several columns, Im using VB.NET I also have a textBox on a windows form called 'RandomN' What this does is it takes whatever number is in my textBox called RandomN.Text and looks for that number in the id column and returns all data on that row. What I am trying to acheive now is this, I have a column called Duplicate it will either contain the word 'True' or 'False' I would like it to only return data from the given number in the textBox if the Duplicate column in that row contains the word 'False' If someone can shed some light I would be greatful. Thanks
  7. For some reason it only posed half of what I wrote Crystal balls are just a myth, a fantasy let's not get to carried away. But if you have a php script that can make one let me have a copy it might let me know what to buy the wife for Christmas I will update my post later when I have access to it. I am not at home right now.
  8. Hi, I have been trying to display images from a directory on to a webpage. The code I am using is here and it is in 2 parts, I have a directory called "upload" which is where my images are. I have created a php file and called it getimages.php I put the php file in my directory called "upload" where my images are the code in it is <p>
×
×
  • 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.