Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,199,242 members, 7,970,867 topics. Date: Wednesday, 09 October 2024 at 04:55 PM |
Nairaland Forum / Science/Technology / Programming / Creating A Scratch Card Verification System (1508 Views)
Drupal Based Nigerian Bank Account Verification System. / Scratch Card System In Laravel / Automated School Result Computation Portal & Scratch Card (2) (3) (4)
Creating A Scratch Card Verification System by clevadani: 9:08am On Aug 21, 2017 |
Hi guys, I am currently working on a school management system using nodeJS and would like to implement a scratch card verification system on the platform, just like it is on jamb's website. Any idea how to go about this? |
Re: Creating A Scratch Card Verification System by Nobody: 12:03pm On Aug 21, 2017 |
look at this sample var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "username", password: "password", database: "verify" }); } con.connect(function(err) { if (err) throw err; con.query("SELECT * FROM pin WHERE id = 'id'"function (err, result, fields) { if (err) throw err; console.log(pin); }); }); } con.connect(function(err) { var pin = Math.floor(1000 + Math.random() * 9000); if (err) throw err; console.log("Connected!" ) ; var sql = "INSERT * FROM pin WHERE id = 'id'"; con.query(sql, function(err, result) { if (err) throw err; console.log(pin); }); }); } } |
Re: Creating A Scratch Card Verification System by Nobody: 12:45pm On Aug 21, 2017 |
create an html layout and give the input an id as Id and label as Enter pin in the home.html . feel free to debug the code. |
Re: Creating A Scratch Card Verification System by rayyspark(m): 2:03pm On Aug 21, 2017 |
You can also add a column to the table to track used cards |
Re: Creating A Scratch Card Verification System by Nobody: 2:10pm On Aug 21, 2017 |
rayyspark: it means that a query will delete or move the used cards and display them on an HTML table. That is the logic |
Re: Creating A Scratch Card Verification System by rayyspark(m): 7:06pm On Aug 21, 2017 |
proxy20: yes, it can be done that way. It can also be updated as used card. |
Re: Creating A Scratch Card Verification System by Nobody: 7:43pm On Aug 21, 2017 |
proxy20: It's weird to see people still posting code on NairaLand these days Captain. How are you doing? |
Re: Creating A Scratch Card Verification System by Nobody: 7:46pm On Aug 21, 2017 |
DanielTheGeek: I am fine bro. 1 Like |
(1) (Reply)
How Did U Make Your First Money From Programming / Help! Which of The IT Course Can I Do? / Hoiw Can I Mod Java Application
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14 |