ChatGPT Personalized Content

Uploaded on July 2, 2023

I use ChatGPT every time I code. As I ask it more questions about issues I’m running into, I realize it knows my codebase.

All my queries that I submit are through my Open AI account, and it’s clear that ChatGPT is responding to me specifically. I recently asked it this question:

write a python script to go through a mysql table on a remote host and get all the rows in table tags. for each row, write the row to a local table `tags_test'. tags_test has all of `tags` columns, and one more - `image_id`. `tags` has a column `hash` - for each row, try to find a row in the table `images` whose value in column `image_hash` is the same as `tags`.`hash`. If it exists, set the value of `image_id` to the found row in `images` value for `id`. If it doesn't exist, don't write the row to `tags_test`.

The response was:

Certainly! Here's a Python script that connects to a remote MySQL database, retrieves all rows from the "tags" table, and inserts the matching rows into the "tags_test" table in a local database:

import mysql.connector

# Connect to the remote MySQL database
remote_host = 'REMOTE_HOST'
remote_user = 'REMOTE_USER'
remote_password = 'REMOTE_PASSWORD'
remote_database = 'REMOTE_DATABASE'

remote_connection = mysql.connector.connect(

# Connect to the local MySQL database
local_host = 'LOCAL_HOST'
local_user = 'LOCAL_USER'
local_password = 'LOCAL_PASSWORD'
local_database = 'LOCAL_DATABASE'

local_connection = mysql.connector.connect(

# Create a cursor for the remote database
remote_cursor = remote_connection.cursor(dictionary=True)

# Retrieve all rows from the remote "tags" table
remote_cursor.execute("SELECT * FROM tags")

# Iterate over the rows
for remote_row in remote_cursor:
    # Check if the corresponding image exists in the local "images" table
    local_cursor = local_connection.cursor(dictionary=True)
    local_cursor.execute("SELECT id FROM images WHERE image_hash = %s", (remote_row['hash'],))
    image_row = local_cursor.fetchone()

    # If a matching image is found, insert the row into the local "tags_test" table
    if image_row is not None:
        local_cursor = local_connection.cursor()
        query = """
            INSERT INTO tags_test (tag_name, tag_type, hash_name, upload_datetime, image_id)
            VALUES (%s, %s, %s, %s, %s)
        local_cursor.execute(query, (

# Close the connections

If you look at the INSERT INTO tags_test line, it accurately knew the schema for my tags_test table. I probably gave it some sort of input that either allowed it to infer this or I maybe pasted a CREATE statement that needed modification, but I don’t remember when I would have done that. It remembered it, long term. That means that if programmers are using this to help with generate code, Open AI is going to be able to map out code bases of competitors/random projects. I wonder if this will ever become an issue for companies.