using .join I collect a string from the database
example:
st.write(f"{' '.join(str(conn.query(f'SELECT department_name from view_personals WHERE id = {df_search.iloc[people].index[0]+1};')).split()[2:])} n")
I get the following output:
some example text to de...
But in database:
some example text to demonstrate the error
how to fix?(get full output)
user25885787 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Fetch the department name from the database
result = conn.query(f’SELECT department_name FROM view_personals WHERE id = {df_search.iloc[people].index[0]+1};’)
Extract the department name from the result
department_name = result[0][‘department_name’]
Write the full department name to the output
st.write(department_name)
shreya patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.