Reverted back from mysqli to mysql fuctions