Sponsored Content
The Lounge What is on Your Mind? Forum Trivial Pursuit - New Computer Science and Mathematics Trivia for UNIX.com Post 303040421 by Neo on Tuesday 29th of October 2019 02:22:01 AM
Old 10-29-2019
Update:

I have the first draft of basic code to track user answers to trivia questions done (both registered and unregistered users) as follows:

Code:
mysql> describe neo_trivia_scoreboard;
+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| id        | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| uid       | int(10) unsigned | NO   |     | 0       |                |
| trivia_id | int(10) unsigned | NO   |     | 0       |                |
| results   | varchar(16)      | NO   |     | none    |                |
| dateline  | int(10)          | NO   |     | 0       |                |
| site      | varchar(8)       | NO   |     | tbd     |                |
| category  | smallint(3)      | NO   |     | 18      |                |
+-----------+------------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

also:

Code:
mysql> select count(*) from neo_open_trivia;
+----------+
| count(*) |
+----------+
|      168 |
+----------+
1 row in set (0.00 sec)

I will test this for a while and then build a first draft scoreboard.

But so far, so good.

Code:
mysql> select count(*) from neo_trivia_scoreboard;
+----------+
| count(*) |
+----------+
|       40 |
+----------+
1 row in set (0.00 sec)

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mathematics operations in unix

Hello guys! Can say me anybody about operatios with unix, I don't to make operations, only inside in a variable, like this #y=4 #x=2 #let z=$y-$x #echo $z # 2 but I can't to make mathematical operations with decimal like this #y=3.2 #x=1.5 #let z=$y-$x #echo $z # 3 this... (2 Replies)
Discussion started by: cesar720213
2 Replies

2. Shell Programming and Scripting

Which is the best way/command to do mathematics in UNIX scripting?

Hello all! I used to use expr for doing simple mathematics, but has a main advantage and a main disadvantage: The advantage is that it can take variables for numbers (e.g.{1}: echo "Give me first" read lol echo "Give other" read lil sum=`expr $lol + $lil` echo "The sum of $lol and $lil =... (5 Replies)
Discussion started by: hakermania
5 Replies

3. What is on Your Mind?

Computer Science and Information Technology

Hi, I haven't posted on the forums for a while now, I tried to find the most appropriate section for this post, but if this is in the wrong section please forgive me. First, let me say I'm a sophomore in HS. I know that job wise I definitely want to do something in computers. A while ago I was... (5 Replies)
Discussion started by: hpicracing
5 Replies

4. Programming

Is Web Development is a part of computer science ?

I am now a student in university in 2nd year. I am studying computer science. But I am not sure what type of jobs computer science provide. I know some of them are software programming or network management. Recently, I hear some about Web Development. I wonder if it is a part of computer science.... (1 Reply)
Discussion started by: Anna Hussie
1 Replies

5. Web Development

Is Web Development is a part of computer science ?

I am now a student in university in 2nd year. I am studying computer science. But I am not sure what type of jobs computer science provide. I know some of them are software programming or network management. Recently, I hear some about Web Development. I wonder if it is a part of computer... (3 Replies)
Discussion started by: Anna Hussie
3 Replies

6. What is on Your Mind?

1000+ Computer Science Trivia Questions at UNIX.COM

The UNIX and Linux Forums now has over 1000 TRUE / FALSE computer science and computer related trivia question in our database. These questions are of relatively high quality (compared to similar sites on the web) and are fun (according to feedback by users). In the first week during the... (1 Reply)
Discussion started by: Neo
1 Replies

7. What is on Your Mind?

New Member and Country Computer Trivia Leaderboards

Thanks to Akshay, who helped me write the core MySQL queries, we now have two new draft leaderboards, by (1) member and by (2) country: https://www.unix.com/trivia_stats.php Currently milhan leads the members with a high score of 90%: ... (3 Replies)
Discussion started by: Neo
3 Replies

8. What is on Your Mind?

Debugging Our Computer Science Trivia Feature

Only a few days after I coded this new feature from scratch, we are seeing over 3000 entries in the database from members (mostly guests) playing CS trivia. I have spend a lot of time coding this (from scratch) and testing the API. From the logs, it seems to have an API bug which appears... (31 Replies)
Discussion started by: Neo
31 Replies

9. What is on Your Mind?

Computer Trivia Feature Tops 50,000 Questions Answered

Just noticed that our successful computer trivia feature (stats here) has surpassed over 50,000 questions answered by users: https://www.unix.com/trivia_stats.php This was a coding effort worth while and I'm pleased to see so many people enjoying it in such a short time since it was released... (3 Replies)
Discussion started by: Neo
3 Replies
MYSQL_LIST_FIELDS(3)							 1						      MYSQL_LIST_FIELDS(3)

mysql_list_fields - List MySQL table fields

SYNOPSIS
Warning This function was deprecated in PHP 5.4.0, and will be removed in the future, along with the entirety of the original MySQL exten- sion. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include: oSQL Query: SHOW COLUMNS FROM sometable resource mysql_list_fields (string $database_name, string $table_name, [resource $link_identifier = NULL]) DESCRIPTION
Retrieves information about the given table name. This function is deprecated. It is preferable to use mysql_query(3) to issue an SQL SHOW COLUMNS FROM table [LIKE 'name'] statement instead. o $database_name - The name of the database that's being queried. o $table_name - The name of the table that's being queried. o $ link_identifier -The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect(3) is assumed. If no such link is found, it will try to create one as if mysql_connect(3) was called with no arguments. If no connection is found or established, an E_WARNING level error is generated. A result pointer resource on success, or FALSE on failure. The returned result can be used with mysql_field_flags(3), mysql_field_len(3), mysql_field_name(3) and mysql_field_type(3). Example #1 Alternate to deprecated mysql_list_fields(3) <?php $result = mysql_query("SHOW COLUMNS FROM sometable"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { print_r($row); } } ?> The above example will output something similar to: Array ( [Field] => id [Type] => int(7) [Null] => [Key] => PRI [Default] => [Extra] => auto_increment ) Array ( [Field] => email [Type] => varchar(100) [Null] => [Key] => [Default] => [Extra] => ) Note For backward compatibility, the following deprecated alias may be used: mysql_listfields(3) mysql_field_flags(3), mysql_info(3). PHP Documentation Group MYSQL_LIST_FIELDS(3)
All times are GMT -4. The time now is 03:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy