My plugin is not displaying the dollar sign $
-
Since our local pub closed due to Covid-19 we have been running the pub quiz online. The the questions and answers are uploaded to a database. I wrote a plugin to read these from the database and display them (see link below). This has been working for over a year. Except…
Where the question includes a dollar sign the $ is not appearing nor are the figures following it. Question 6 is
Francoise Bettencourt-Meyers with a fortune of $83bn is thought to be the richest woman in the world. She is the heiress to which fortune?
but it just says …a fortune of bn is thought to be…The code snippet is
/* Display the questions, with a space for the answers */ $sql = "SELECT <code>Number</code>, <code>Question</code> FROM <code>$tableName</code> WHERE <code>Date</code> = $quiz AND <code>Type</code> LIKE 'Q' AND <code>Round</code> = $round ORDER BY <code>Number</code>"; $result = $wpdb->get_results($sql, ARRAY_A); if ($result === false) { die ("<p>Reading the questions of round $round fails, MySQL error message: " . $wpdb->print_error() . "</p>\n"); } else { echo '<form action="/take-the-quiz/answers/?quiz=' . "$quiz&round=$round&rt=$runningTotal\" method=\"POST\">\n"; foreach ($result as $row) { extract($row); echo "<p>$Number. <label for=\"Q$Number\">" . esc_html($Question) . "</label></p>\n"; echo "<p>Your answer: <input type=\"text\" name=\"answer[$Number]\" id=\"Q$Number\" /></p>\n"; } echo '<input type="submit" value="Check your answers">' . "\n"; echo "</form>\n"; }
I think the problem must be with how WordPress handles the echo statement. I’ve searched for answers without success. Any advice please?
PS The answer to the quiz question is L’Oreal
- This topic was modified 3 years, 4 months ago by .
- This topic was modified 3 years, 4 months ago by . Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
The page I need help with: [log in to see the link]
- The topic ‘My plugin is not displaying the dollar sign $’ is closed to new replies.