Creating tables...
query("DROP TABLE IF EXISTS customers"); $create_result = $MYSQLCONN->query(" CREATE TABLE customers ( customer_id MEDIUMINT NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY(customer_id) ) ENGINE=InnoDB "); if (!$create_result) { printf("Failed to create tables: %s\n", $MYSQLCONN->error); } else { printf("%d Row inserted.\n", $MYSQLCONN->affected_rows); print_r($MYSQLCONN->query("DESCRIBE customers")); print_r($MYSQLCONN->query("SELECT * FROM customers")); } ?>prepare( "INSERT INTO customers (customer_id, name, email) VALUES (NULL, ?, ?)" ); $add_customer->bind_param('ss', $_POST["name"], $_POST["email"]); $result = $add_customer->execute(); if (!$result) { ?>
Failed to create customer!: error ?>
affected_rows; ?> Row inserted.
query("SELECT * FROM customers"); while ($row = $results->fetch_array(MYSQLI_ASSOC)) { print_r($row); } ?>