0

i want to check if item named 'BUC test' is already in the database or not, but suddenly my $stmt->execute(); is not working

$cek_name=mysql_num_rows(mysql_query("SELECT name FROM equipment WHERE id='$_GET[bie]' and name='BUC test'"));
    if ($cek_name > 0)
    {
      $duplicate = "Equipment Name is already in use.";
    }
    else
    {
      echo 'this will execute';
      $stmt1->bind_param('ssssss',$id,$type, $name, $qty, $usd, $idr);
      $stmt1->execute();
    }
$type = 'BUC';
  $name = 'BUC test';
  $qty = '1';
  $usd = '0';
  $idr = '0';
  $id= $_GET['bie'];

if i put the $stmt->execute(); outside if else its work, does anyone have a clue? fyi : echo 'this will execute'; is displayed.

please help! thanks!

Dileep Kumar
  • 1,077
  • 9
  • 14

0 Answers0