Hello everyone, Cannot redeclare createQuery() how to fix the Cannot redeclare createQuery() error, as I understand it is impossible to write two functions, most likely this is a gross error, help solve this problem ..
function createQuery($id, $a, $b){ $query = "INSERT INTO opisanie (x,text,text_opis) VALUES "; $limit = count($a); for($i=0; $i<$limit; $i++){ $query .= "('{$id}','{$a[$i]}', '{$b[$i]}')".($i!=$limit-1?',':''); } $res = mysql_query($query); } $aText = $_POST['form_text_o']; $aOpis = $_POST['form_text_opis']; $query = createQuery($id, $aText, $aOpis); function createQuery( $e, $s, $c, $d, $id){ $queryz = "INSERT INTO menu_zav (name,sostav,gramm,cena,x_zav) VALUES "; $limita = count($e); for($is=0; $is<$limita; $is++){ $queryz .= "('{$e[$is]}','{$s[$is]}','{$c[$is]}','{$d[$is]}','{$id}')".($is!=$limita-1?',':''); } $resa = mysql_query($queryz); } $eName = $_POST['form_name_menu']; $eOpisa = $_POST['form_opis_menu']; $eGr = $_POST['form_gr_menu']; $eCena = $_POST['form_cena_menu']; $queryz = createQuery($eName, $eOpisa, $eGr, $eCena, $id);