php - How to insert all values frow row into mysql database using insert record? -
hello have problem php last value in rows inserted in mysql database:last value inserted rows
mysql database show last value inserted insert record
i want 3 of data inserted not last values... how do that?
here insert record behavior code:
if ((isset($_post["mm_insert"])) && ($_post["mm_insert"] == "form1")) { $insertsql = sprintf("insert ordering (productcode, name, paymentmethod, quantity, totalprice) values (%s, %s, %s, %s, %s)", getsqlvaluestring($_post['productcode'], "int"), getsqlvaluestring($_post['name'], "text"), getsqlvaluestring($_post['paymentmethod'], "text"), getsqlvaluestring($_post['quantity'], "int"), getsqlvaluestring($_post['totalprice'], "double")); mysql_select_db($database_perfume_connection, $perfume_connection); $result1 = mysql_query($insertsql, $perfume_connection) or die(mysql_error()); $insertgoto = "member_perfume_homepage.php"; if (isset($_server['query_string'])) { $insertgoto .= (strpos($insertgoto, '?')) ? "&" : "?"; $insertgoto .= $_server['query_string']; } header(sprintf("location: %s", $insertgoto)); }
please show html page sending post data. think should have make array of $_post variables can records @ php side , can insert 3 records in table.
try this
please check below link can find solution inserting multiple rows php & mysql
Comments
Post a Comment