experchange > python

^Bart (01-20-20, 09:37 PM)
I found this article:



I used PDO on PHP 7.3 with last MariaDB engine but I'd like to start to
use Python for a local warehouse software, I found the above guide but I
need to understand what I should replace from that guide to link the
script to my MariaDB DB!

I know I need to use this:

#!/usr/bin/python
import MySQLdb

# Open database connection
db = MySQLdb.connect("localhost","root","MyPWD","MyDB")

But after the above code how could I check the login to my user's table?

Regards.
^Bart
DL Neil (01-20-20, 10:06 PM)
On 21/01/20 8:37 AM, ^Bart wrote:
[..]
> # Open database connection
> db = MySQLdb.connect("localhost","root","MyPWD","MyDB")
> But after the above code how could I check the login to my user's table?


Please refer previous response, re 'tutorials' - if the above
credentials fail, then an exception will be raised.
If MariaDB do not provide suitable documentation, then use MySQL's
(Maria was forked from MySQL).
Are you asking for code, or techniques?
^Bart (01-20-20, 10:56 PM)
> Are you asking for code, or techniques?

Thanks for your reply! :)

I followed the code from the web article but I need to read an example
of a login form connected to a MariaDB db!

In the web article it's used a file to check data but I need to check
data to a table in MariaDB or better how and where should I replace code
from the web article!

^Bart
Similar Threads