Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DataRetrieval(TableName, DataSet){
- var conn = mysql.createConnection({
- host: 'localhost',
- user: 'root',
- password: '',
- database: 'fmis'
- });
- conn.connect();
- var query ="SELECT `Customer_Id`, `Customer_Name`, `Customer_Last_Name`, `Customer_Address`, `Customer_Phone`, `Customer_Phone2`, `Customer_Email`, `Customer_Company_Name`, `Customer_Description` FROM `customers` WHERE `Customer_Deleted` = 0";
- conn.query(query,function(err,result)
- {
- if(err)
- {
- console.error(err);
- }else{
- return result;
- }
- });
- }
- router.get('/Customer_api',function(req, res){
- res.send( DataRetrieval);
- });
- $(function (){
- $.get('Customer_api', updateView)
- function updateView(data){
- var output = '';
- $.each(data, function(key, item){
- output += '<tr>';
- output += ' <td>Habib</td>';
- output += ' <td>Niger</td>';
- output += ' <td>Oud-Turnhout</td>';
- output += ' <td class="text-primary">$36,738</td>';
- output += '</tr>';
- });
- $('.Customers_Rows').html(output);
- }
- });
Add Comment
Please, Sign In to add comment