|
|
Surely this should be in the SQL forum?
In MySQL you can extract a random row using
SELECT fieldlist FROM table ORDER BY RAND() LIMIT 1
In SQL Server you would use:
SELECT TOP 1 fieldlist FROM table ORDER BY NEWID()
|
|
|
|
|
Oh Sorry Will ask in the SQL forum then.
Before I used the code I use now I used ORDER BY RAND() but it spend even more time. The code I am using now was supposed to be and is faster then the one I used before.
On before hand
Thank you for your help
|
|
|
|
|
HI,
i'm creating a multichoice quiz in javascript conditions are
1. it is multichoice
2. answer to be stored in database sql
3. there is a timer.
how to start??
|
|
|
|
|
With a book on programmng?
Don't post homework questons, nobody should answer them, else you learn nothing.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: Don't post homework questons, nobody should answer them, else you learn nothing.
I agree, but usually some cluck ends up answering for them. Robs the OP of any kind of learning.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Was the cluck comment directed at me?
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
No. I did see your reply after I posted, and the answer you gave him was appropriate. Maybe what I meant by cluck, are the folks who throw the code how to do the task at hand. Those are the ones that rob the poster of any kind of learning. Not the ones who give some insight on what to do
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Yeah, I know what you mean. They can get someone from Rentacoder to do that for them if they want full source code..
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Okay:
- Read up on HTML forms and radio buttons - these are good for multiple choice questions.
- You'd need to use some sort of server side collaboration here, such as with PHP/ASP/ASP.NET so you may need to look into this in some detail if you're not already familiar with server-side languages.
- Read up on JavaScript timing functions for this one - Google's always good for that sort of thing.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Thnks for the reply,
Well to say that i had done very much things in it.
All wat u said - i did...
Now some technical problem...
Since i'm going to store the ansers in database, so if user press F5 key he again get the quiz from start.. How to stop user from doing that...?
thanks in advance
|
|
|
|
|
sachees123 wrote: Since i'm going to store the ansers in database, so if user press F5 key he again get the quiz from start.. How to stop user from doing that...?
As far as I know you can't.
So you must register the user somehow, either by logged in session or have some ID as the first question which is then checked against the database before continuing.
Checking the IP-address is not a good solution as there might be several users behind the same NAT-gateway
|
|
|
|
|
As Jörgen said, you could use sessions which would do nicely, although it means extra server-side code and processing. You could also use JavaScript cookies, but of course the user can turn these off/delete them which also isn't completely failsafe. If it is really that important, I'd go with the sessions suggestion.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Hi All,
I'm trying to show a PDF document in my webpage hosted in plumtree portal.
The code is executing perfectly but the page is not showing as a PDF rather its showing it as the encoded pdf source.
Following is what is shwon in the webpage "%PDF-1.4 %âãÏÓ 4 0 obj ....."
The code im using is as follows:
MemoryStream ms = new MemoryStream();
//...
ms object will be populated with the pdf data created dynamically.
.....//
Response.ContentType = "application/pdf"; //when i try "text/html" im getting the encoded pdf file in the page like %pdf- ....
Response.Buffer = true;
Response.Clear();
Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);
Response.OutputStream.Flush();
Response.End();
Im using vs2003 C#
Please help me in this issue. This is an urgent requirement.
|
|
|
|
|
It's always urgent.
Your chance of getting an answer is increasing if you don't use the word "urgent".
Howabout:
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = True
Response.ContentType = "application/pdf"
Response.HeaderEncoding = System.Text.Encoding.Default
Response.BinaryWrite(MemoryStream.ToArray)
Response.End()
MemoryStream.Dispose()
|
|
|
|
|
Hi all...
i'm developing a website which is having all html pages..
when i navigate from one page to another url address of the site should not change...what should i do...?
i'm using anchor tag and hyperlink for navigation.
can you please give me idea on this...
Thank You...
siri
|
|
|
|
|
Why don't you want the URL to change? This is a fundamental feature of web sites.
|
|
|
|
|
for my current requirement i should not change the url...
any ideas please...
siri
|
|
|
|
|
I would seriously consider changing that requirement - hiding the URL will do nothing other than annoy people using your site and prevent them from bookmarking anything other than the front page. From a personal point of view if I came across a site that tried to do such a thing I'd just not use it.
As someone else has mentioned you can 'fake' it by using frames. Alternatively you could use Flash or some other similar technology. Both would make poor websites with zero advantage.
|
|
|
|
|
Its a while since I used them, but I think this can be done with frames (NOT iFrames).
Bob
Ashfield Consultants Ltd
|
|
|
|
|
A "dirty" but working solution is to save all html documents with the aspx suffix and exchange all links with linkbuttons having server.transfer(url) in the codebehind
|
|
|
|
|
i mentioned that i' m using html pages not aspx pages.
siri
|
|
|
|
|
Hi,
I am connecting via a web service. The response object returns XML data in a string value. How do I get the element values of this string?
Ideally I would like to load it into a dataset but it is not a physical file that I can just read from.
Thanks
Brendan
|
|
|
|
|
Hi use this
string message = "<?xml version='1.0' encoding='utf-8'?><Test><Parent><Child1>100354050</Child1><Child2>Jaffer</Child2></Parent></Test>";
DataSet ds = new DataSet();
StringReader sr = new System.IO.StringReader(message);
ds.ReadXml(sr);
|
|
|
|
|
Hi everyone, I just built a website by using VB2005 and ASP.NET. I published it and tested the publish version by using VB as back suppourt. The web running well. But when I set to the local server. Login successful, but the button Add / Edit user are always failed, and I changed one user's password, the message shown to it's successful. But when Login again, I still need to use the old password. It seems like the whole database not updated by itself. But once I using VB to view in browser, it can works well. Does anybody can help me to solve this problems??
Thanks a lot
|
|
|
|