import sqlite3
import os

if not os.path.exists('users.db'):
	con = sqlite3.connect('users.db')	
	cur = con.cursor()
	cur.execute("create table users (sender, reciever, data, message)")
else:
	con = sqlite3.connect('users.db')	
	cur = con.cursor()

def add_in_table(send, recv, data, message):
	cur.execute("insert into users values (?, ?, ?, ?)", (send, recv, data, message))
	cur.execute("select * from users where sender=:sender and reciever=:reciever", {"sender":send, "reciever":recv, "data":data, "message":message} )
	return cur
	

send = "Yeltsin"
recv = "Gorbachev"
data = "5-12-2015"
mes = "hi"

cur = add_in_table(send, recv, data, mes)
con.commit()

print (cur.fetchone())
con.close()

cdeb5f0e5155fcb1ecc04835850ac1c547c92bc6
<mask token>


def add_in_table(send, recv, data, message):
    cur.execute('insert into users values (?, ?, ?, ?)', (send, recv, data,
        message))
    cur.execute(
        'select * from users where sender=:sender and reciever=:reciever',
        {'sender': send, 'reciever': recv, 'data': data, 'message': message})
    return cur


<mask token>

<mask token>
if not os.path.exists('users.db'):
    con = sqlite3.connect('users.db')
    cur = con.cursor()
    cur.execute('create table users (sender, reciever, data, message)')
else:
    con = sqlite3.connect('users.db')
    cur = con.cursor()


def add_in_table(send, recv, data, message):
    cur.execute('insert into users values (?, ?, ?, ?)', (send, recv, data,
        message))
    cur.execute(
        'select * from users where sender=:sender and reciever=:reciever',
        {'sender': send, 'reciever': recv, 'data': data, 'message': message})
    return cur


<mask token>
con.commit()
print(cur.fetchone())
con.close()

<mask token>
if not os.path.exists('users.db'):
    con = sqlite3.connect('users.db')
    cur = con.cursor()
    cur.execute('create table users (sender, reciever, data, message)')
else:
    con = sqlite3.connect('users.db')
    cur = con.cursor()


def add_in_table(send, recv, data, message):
    cur.execute('insert into users values (?, ?, ?, ?)', (send, recv, data,
        message))
    cur.execute(
        'select * from users where sender=:sender and reciever=:reciever',
        {'sender': send, 'reciever': recv, 'data': data, 'message': message})
    return cur


send = 'Yeltsin'
recv = 'Gorbachev'
data = '5-12-2015'
mes = 'hi'
cur = add_in_table(send, recv, data, mes)
con.commit()
print(cur.fetchone())
con.close()

import sqlite3
import os
if not os.path.exists('users.db'):
    con = sqlite3.connect('users.db')
    cur = con.cursor()
    cur.execute('create table users (sender, reciever, data, message)')
else:
    con = sqlite3.connect('users.db')
    cur = con.cursor()


def add_in_table(send, recv, data, message):
    cur.execute('insert into users values (?, ?, ?, ?)', (send, recv, data,
        message))
    cur.execute(
        'select * from users where sender=:sender and reciever=:reciever',
        {'sender': send, 'reciever': recv, 'data': data, 'message': message})
    return cur


send = 'Yeltsin'
recv = 'Gorbachev'
data = '5-12-2015'
mes = 'hi'
cur = add_in_table(send, recv, data, mes)
con.commit()
print(cur.fetchone())
con.close()

import sqlite3
import os

if not os.path.exists('users.db'):
	con = sqlite3.connect('users.db')	
	cur = con.cursor()
	cur.execute("create table users (sender, reciever, data, message)")
else:
	con = sqlite3.connect('users.db')	
	cur = con.cursor()

def add_in_table(send, recv, data, message):
	cur.execute("insert into users values (?, ?, ?, ?)", (send, recv, data, message))
	cur.execute("select * from users where sender=:sender and reciever=:reciever", {"sender":send, "reciever":recv, "data":data, "message":message} )
	return cur
	

send = "Yeltsin"
recv = "Gorbachev"
data = "5-12-2015"
mes = "hi"

cur = add_in_table(send, recv, data, mes)
con.commit()

print (cur.fetchone())
con.close()
