First problem I see is here:
CREATE TABLE pharm_cart_order.cart_inventory.'$time'
That's not valid syntax for a table name. The dot syntax is "db_name.table_name", yet you have three groups in there? What are you trying to use for the table name? If you want "table_name.time_value" as the actual name of the table, then you'll have to surround that name with backticks, since the "." has special meaning for SQL identifiers (e.g. it separates two of them).
Also:
jrough wrote:I have max_execution time set to:
ini_set("max_execution",120000);
What you have there is a call to set the directive "max_execuction" to a given value. Note, however, that there is no such PHP directive as "max_execution", thus that line is superfluous. Perhaps you instead meant to set the directive called "max_execution_time" ? 😉 For that matter, note that you can use the function [man]set_time_limit/man instead.