:sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad:
SethR
0
Light Poster
Recommended Answers
Jump to PostPHP problems, Seth?
Jump to PostWell I've got a beer in front of me, all I need it a sad story so I can start crying into it:D
As my old grandmother used to say - "a problem shared is a problem halved" - so come on, let's have it!
Jump to PostYou've got the logic path mixed up, so you will always get a 0 score. Change:
$score = 0; $total = mysql_num_rows($result); $finalScore = $score * 10; // this line needs to moved while ($row = mysql_fetch_array($result)) { $question = $result["question"]; $answer = $row["answer"]; $ans1 = $result["ans1"]; …
Jump to PostAfter a closer look, you don't seem to be collecting the posted values from the form page, and so are not comparing them to your database values at any point.
Try this:
<?php $link = mysql_connect("localhost", "web26", "web9660!", "sere1") or die("Error ".mysql_errno().": ".mysql_error()."<br>\nThe SQL sent was: …
Jump to PostOK, so put a bit of debug echo into the while loop to see what values are being passed through the form, what the database is sayinh the answer is, and whether they should in fact match up.
while ($row = mysql_fetch_array($result)) { $answer = $row["answer"]; $id …
All 21 Replies
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
commented:
goes out of his way to help
+1
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
SethR
0
Light Poster
Lafinboy
4
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.