Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,800 members, 7,810,080 topics. Date: Friday, 26 April 2024 at 08:16 PM

Creating A Scratch Card Verification System - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Creating A Scratch Card Verification System (1385 Views)

Drupal Based Nigerian Bank Account Verification System. / Scratch Card System In Laravel / Automated School Result Computation Portal & Scratch Card (2) (3) (4)

(1) (Reply) (Go Down)

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:
You can also add a column to the table to track used cards

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:


it means that a query will delete or move the used cards and display them on an HTML table. That is the logic


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:
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);
  });
});


}
}


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:


It's weird to see people still posting code on NairaLand these days Captain. How are you doing?

I am fine bro.

1 Like

(1) (Reply)

20k For Grabs / Learn Web Design/programming, Graphic Design & Digital Marketing (lagos) / Learn Python Programming (promo Price)

(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. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.