create account

PHP Command That Converts a PGN File into a MySQL Script by programarivm

View this thread on: hive.blogpeakd.comecency.com
· @programarivm · (edited)
$48.56
PHP Command That Converts a PGN File into a MySQL Script
#### Repository

https://github.com/programarivm/pgn-chess

![black-chess-pieces.jpg](https://cdn.steemitimages.com/DQmSw8n37fh2Y7wMLnVuXwpoocrH5rEWA4tRhtbceZ4Zwbx/black-chess-pieces.jpg)

PGN Chess for PHP is a simple, friendly, and powerful PGN (Portable Game Notation) library for running chess games from within PHP applications. It is a chess board representation that can be used in chess engines, chess applications and chess algorithms.

### New Features

A command line interface (CLI) is created with the aim to convert PGN files into MySQL scripts. More specifically, [Feature/pgntosql](https://github.com/programarivm/pgn-chess/pull/2) implements the following two commands.

Creates a MySQL PGN Chess database:

    php cli/createdb.php
    This will remove the current PGN Chess database and the data will be lost.
    Do you want to proceed? (Y/N): y

Converts a PGN file into a MySQL INSERT statement:

    php cli/pgntomysql.php example.pgn > example.sql

> **Note**: `pgntomysql.php` works okay with a syntactically valid PGN file as a precondition.

#### Roadmap

A command that checks the syntax of PGN files has to be created in another PR.

- `pgnsyntax.php`

For further information visit section [4. Command Line Interface (CLI)](https://github.com/programarivm/pgn-chess#4-command-line-interface-cli)

#### Would you help make this library better? 

Contributions are welcome.

- Feel free to send a pull request
- Drop an email at info@programarivm.com with the subject "PGN Chess Contributions"
- Leave me a comment on [Twitter](https://twitter.com/programarivm)
- Say hello on [Google+](https://plus.google.com/+Programarivm)

Many thanks.

#### GitHub Account

https://github.com/programarivm/pgn-chess
πŸ‘  , , , , , , , , , , , , , , , , , ,
properties (23)
authorprogramarivm
permlinkphp-command-that-converts-a-pgn-file-into-a-mysql-script
categoryutopian-io
json_metadata{"tags":["utopian-io","development","pgn","chess","php"],"image":["https://cdn.steemitimages.com/DQmSw8n37fh2Y7wMLnVuXwpoocrH5rEWA4tRhtbceZ4Zwbx/black-chess-pieces.jpg"],"links":["https://github.com/programarivm/pgn-chess","https://github.com/programarivm/pgn-chess/pull/2","https://github.com/programarivm/pgn-chess#4-command-line-interface-cli","https://twitter.com/programarivm","https://plus.google.com/+Programarivm"],"app":"steemit/0.1","format":"markdown"}
created2018-08-18 11:31:15
last_update2018-08-19 21:43:06
depth0
children8
last_payout2018-08-25 11:31:15
cashout_time1969-12-31 23:59:59
total_payout_value36.450 HBD
curator_payout_value12.108 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,731
author_reputation2,631,258,794,707
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,592,498
net_rshares36,428,144,424,224
author_curate_reward""
vote details (19)
@emrebeyler ·
$10.12
Hi there,

Welcome to STEEM blockchain.

A couple for feedbacks for your future contributions:

It would be better starting the post with a little explanation about the project, before going deep on the new features/changes.

Also, regarding the *"How did I implement it?"* instead of sharing the code/PR directly, you may add a couple of sentences to enrich the content that what was the challenge, how did you solve them, what can be done in the feature, etc.

***
Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/3322221).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , , , ,
properties (23)
authoremrebeyler
permlinkre-programarivm-php-command-that-converts-a-pgn-file-into-a-mysql-script-20180818t130745769z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/3322221","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-08-18 13:07:45
last_update2018-08-18 13:07:45
depth1
children2
last_payout2018-08-25 13:07:45
cashout_time1969-12-31 23:59:59
total_payout_value7.612 HBD
curator_payout_value2.507 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length956
author_reputation448,535,049,068,622
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,599,545
net_rshares7,627,661,981,512
author_curate_reward""
vote details (5)
@programarivm ·
Thank you for the feedback.
properties (22)
authorprogramarivm
permlinkre-emrebeyler-re-programarivm-php-command-that-converts-a-pgn-file-into-a-mysql-script-20180818t151915857z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-08-18 15:19:15
last_update2018-08-18 15:19:15
depth2
children0
last_payout2018-08-25 15:19:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length27
author_reputation2,631,258,794,707
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,610,658
net_rshares0
@utopian-io ·
Thank you for your review, @emrebeyler!

So far this week you've reviewed 4 contributions. Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-programarivm-php-command-that-converts-a-pgn-file-into-a-mysql-script-20180818t130745769z-20180820t171007z
categoryutopian-io
json_metadata"{"app": "beem/0.19.42"}"
created2018-08-20 17:10:09
last_update2018-08-20 17:10:09
depth2
children0
last_payout2018-08-27 17:10:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length113
author_reputation152,955,367,999,756
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,825,728
net_rshares0
@steem-ua ·
$0.09
Hi @programarivm! We are @steem-ua, a new Steem dApp, computing UserAuthority for all accounts on Steem. We are currently in test modus upvoting quality Utopian-io contributions! Nice work!
πŸ‘  
properties (23)
authorsteem-ua
permlinkre-php-command-that-converts-a-pgn-file-into-a-mysql-script-20180818t152106z
categoryutopian-io
json_metadata"{"app": "beem/0.19.54"}"
created2018-08-18 15:21:06
last_update2018-08-18 15:21:06
depth1
children1
last_payout2018-08-25 15:21:06
cashout_time1969-12-31 23:59:59
total_payout_value0.069 HBD
curator_payout_value0.022 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length189
author_reputation23,214,230,978,060
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,610,837
net_rshares69,980,144,467
author_curate_reward""
vote details (1)
@programarivm ·
$0.08
Hi @steem-ua. Thank you, that sounds encouraging! Now I am writing the PGN syntax checker.
πŸ‘  
properties (23)
authorprogramarivm
permlinkre-steem-ua-re-php-command-that-converts-a-pgn-file-into-a-mysql-script-20180818t152106z-20180818t153133871z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["steem-ua"],"app":"steemit/0.1"}
created2018-08-18 15:31:33
last_update2018-08-18 15:31:33
depth2
children0
last_payout2018-08-25 15:31:33
cashout_time1969-12-31 23:59:59
total_payout_value0.063 HBD
curator_payout_value0.020 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
author_reputation2,631,258,794,707
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,611,823
net_rshares63,275,459,967
author_curate_reward""
vote details (1)
@steemitboard ·
Congratulations @programarivm! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/voted.png)](http://steemitboard.com/@programarivm) Award for the number of upvotes received

<sub>_Click on the badge to view your Board of Honor._</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


> Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-programarivm-20180818t210914000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-08-18 21:09:12
last_update2018-08-18 21:09:12
depth1
children0
last_payout2018-08-25 21:09:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length736
author_reputation38,975,615,169,260
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,637,069
net_rshares0
@steemitboard ·
@programarivm, thank you for supporting @steemitboard as a witness.

[![](https://steemitimages.com/70x70/http://steemitboard.com/notifications/supportboard.png)](http://steemitboard.com/@programarivm) Here is a small present to show our gratitude
<sub>_Click on the badge to view your Board of Honor._</sub>

Once again, thanks for your support!

**Do not miss the last post from @steemitboard:**
[SteemitBoard and the Veterans on Steemit - The First Community Badge.](https://steemit.com/veterans/@steemitboard/steemitboard-and-the-veterans-on-steemit-the-first-community-badge)
properties (22)
authorsteemitboard
permlinksteemitboard-notify-programarivm-20180819t000129000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-08-19 00:01:27
last_update2018-08-19 00:01:27
depth1
children0
last_payout2018-08-26 00:01:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length580
author_reputation38,975,615,169,260
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,647,326
net_rshares0
@utopian-io ·
$0.02
Hey @programarivm
 **Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
πŸ‘  ,
properties (23)
authorutopian-io
permlinkre-php-command-that-converts-a-pgn-file-into-a-mysql-script-20180820t084532z
categoryutopian-io
json_metadata"{"app": "beem/0.19.42"}"
created2018-08-20 08:45:33
last_update2018-08-20 08:45:33
depth1
children0
last_payout2018-08-27 08:45:33
cashout_time1969-12-31 23:59:59
total_payout_value0.017 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length305
author_reputation152,955,367,999,756
root_title"PHP Command That Converts a PGN File into a MySQL Script"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id68,782,198
net_rshares16,389,741,722
author_curate_reward""
vote details (2)