skip to Main Content

Mysql – Why doesn't my PHP function get called on button click?

Here is my PHP block. The get functions all work fine. <?php function getTitle() { $connection = new PDO('mysql:host=x.x.x.x;dbname=x;charset=utf8', 'x', 'xxxx'); $query = $connection->query("SELECT `value` FROM `services` WHERE `type` = 'title';"); $data = $query->fetchAll(PDO::FETCH_COLUMN); echo '<textarea id="services-title" name="services-title" rows="1">' .…

VIEW QUESTION

Mysql – Error AttributeError: 'Connection' object has no attribute 'fetchall'

I have the following SQL database details: import sqlalchemy as sch from config import Config db_uri = os.environ["SQLALCHEMY_DATABASE_URI"] + os.environ["DB_NAME"] in the env file I have these SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://*****:*****@instance-amazonaws.com:3306/' DB_NAME = 'DB_NAME' Now db_engine = extrac_db.create_engine(Config.db_uri) db_connection = db_engine.connect()…

VIEW QUESTION
Back To Top
Search