<?php require_once "./mysql_connect.php"; require_once "./mysql_query.php"; if ($_POST) { conn(); mysql_select_db("nutrition"); $sql = "delete from nutri1 where barcode='" . "{$_POST['barcode']}'" . " and per='" . "{$_POST['per']}" . "'"; // print $sql; $r = mysql_query($sql); if (!$r) { die("" . mysql_error()); } $result = search1(array('barcode'), array("barcode" => "{$_POST['barcode']}"))['barcode']; // print_r($result); if (count($result) == 0) { $sql = "delete from nutri0 where barcode='" . "{$_POST['barcode']}" . "'"; // print $sql; $r = mysql_query($sql); if (!$r) { die("" . mysql_error()); } } print "delete successed"; }
echo $s; $type = array(); $des = array(); $per = array(); $type = array_unique(search0(array("type"), array())["type"]); // print "t:".$tselect."<br>"; // print "d:".$dselect."<br>"; // print "p:".$pselect."<br>"; // print_r($_GET); if ($tselect == "") { $des = array_unique(search0(array("description"), array())["description"]); } else { $des = array_unique(search0(array("description"), array("type" => "{$tselect}"))["description"]); } if ($tselect == "" || $dselect == "") { $per = array_unique(search1(array("per"), array())["per"]); } else { $per = array_unique(search0_1(array("per"), array("type" => "{$tselect}", "description" => "{$dselect}"))["per"]); // print_r($per); if (!$per) { $p = array(); if ($tselect) { $p["type"] = $tselect; } if ($dselect) { $p["description"] = $dselect; } $result = search_print(array("*"), $p); $s .= "<form method='post' id='input' >"; // print_r($result); foreach ($result as $r) {
function vcn_customers_search($_query, $filter = array(), $opt = true, $opt1 = array()) { $sql = 'select vcn_customers.* from vcn_customers where'; $opt1['sql'] = $sql; $opt1['table'] = 'vcn_customers'; //table name return search1($_query, $filter, $opt, $opt1); }