user->get('id'); $query = "CREATE TEMPORARY TABLE `plant_temp` SELECT id, modx_user_id, plant_type, plant_stage, n_min, n_max, P_min, P_max, K_min, K_max, S_min, S_max, Ca_min, Ca_max, Mg_min, Mg_max, Na_min, Na_max, Cu_min, Cu_max, Zn_min, Zn_max, Mn_min, Mn_max, B_min, B_max, Fe_min, Fe_max, M_min, M_max, Co_min, Co_max, se_min, se_max, cl_min, cl_max, c_min, c_max FROM `plant_specifications` WHERE `modx_user_id` = '" . $user_id . "' AND `plant_type` = '" . $empid . "'; "; $query .= "ALTER TABLE `plant_temp` DROP `id`, DROP `modx_user_id`, DROP `plant_type` ; "; $query .= "SELECT * FROM `plant_temp`; "; $result = mysqli_multi_query($con, $query); if ($result) { do { // grab the result of the next query if (($result = mysqli_store_result($con)) === false && mysqli_error($con) != '') { echo "Query failed: " . mysqli_error($con); } } while (mysqli_more_results($con) && mysqli_next_result($con)); // while there are more results } else { echo "First query failed..." . mysqli_error($con); } //get results from database $all_property = array(); //declare an array for saving property //showing property echo '
| ' . $header . ' | '; //get field name for header array_push($all_property, $property->name); //save those to array } echo '
|---|
| id] . '","' . $row['id'] . '")" onClick="showEdit(this);" >' . $this_value . ' | '; //get items using property value } echo '