ProgrammingError | Python 3.8.10: /usr/bin/python3 Thu Apr 25 15:34:56 2024 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home/cryan/secure_html/daily/blogpost.py in <module> |
103 |
104 myConnection = mysql.connector.connect( host=hostname, user=username, passwd=password, db=database ) |
=> 105 content,promo,maincategory,headerimage,mytitle,weburl,blogcat,blogid = doQuery( myConnection ) |
106 myConnection.close() |
107 |
content undefined, promo undefined, maincategory undefined, headerimage undefined, mytitle undefined, weburl undefined, blogcat undefined, blogid = '', doQuery = <function doQuery>, myConnection = <mysql.connector.connection_cext.CMySQLConnection object> |
/home/cryan/secure_html/daily/blogpost.py in doQuery(conn=<mysql.connector.connection_cext.CMySQLConnection object>) |
72 |
73 |
=> 74 cur.execute( query ) |
75 records = cur.fetchall() |
76 if not records: |
cur = <mysql.connector.cursor_cext.CMySQLCursor object>, cur.execute = <bound method CMySQLCursor.execute of <mysql.connector.cursor_cext.CMySQLCursor object>>, query = 'select blogcategory.date, blogcategory.title, co...gory where weburl = RANDOM order by postdate DESC' |
/home/cryan/.local/lib/python3.8/site-packages/mysql/connector/cursor_cext.py in execute(self=<mysql.connector.cursor_cext.CMySQLCursor object>, operation='select blogcategory.date, blogcategory.title, co...gory where weburl = RANDOM order by postdate DESC', params=(), multi=False) |
328 |
329 try: |
=> 330 result = self._cnx.cmd_query( |
=> 331 stmt, |
=> 332 raw=self._raw, |
result undefined, self = <mysql.connector.cursor_cext.CMySQLCursor object>, self._cnx = <weakproxy at 0x7efcdac97590 to CMySQLConnection>, self._cnx.cmd_query = <bound method CMySQLConnection.cmd_query of <mys...nnector.connection_cext.CMySQLConnection object>>, stmt = b'select blogcategory.date, blogcategory.title, ...ory where weburl = RANDOM order by postdate DESC', raw undefined, self._raw = False, buffered undefined, self._buffered = False, raw_as_string undefined, self._raw_as_string = False |
/home/cryan/.local/lib/python3.8/site-packages/mysql/connector/connection_cext.py in cmd_query(self=<mysql.connector.connection_cext.CMySQLConnection object>, query=b'select blogcategory.date, blogcategory.title, ...ory where weburl = RANDOM order by postdate DESC', raw=False, buffered=False, raw_as_string=False) |
617 ) |
618 except MySQLInterfaceError as err: |
=> 619 raise get_mysql_exception( |
=> 620 err.errno, msg=err.msg, sqlstate=err.sqlstate |
=> 621 ) from err |
global get_mysql_exception = <function get_mysql_exception>, err undefined, msg undefined, sqlstate undefined |
ProgrammingError: 1054 (42S22): Unknown column 'RANDOM' in 'where clause'
args =
(1054, "1054 (42S22): Unknown column 'RANDOM' in 'where clause'", '42S22')
errno =
1054
msg =
"Unknown column 'RANDOM' in 'where clause'"
sqlstate =
'42S22'
with_traceback =
<built-in method with_traceback of ProgrammingError object>