So not an external image?
Just use the imagefilledellipse method. The method is almost identical to the rectangle, but you provide w/h instead of end x/y. You can use some pi with the existing points to calculate the width (and height would be the same if you want a circle instead of an ellipse).
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php