justhrun

pulsa_searchdonk.pehape

Aug 27th, 2014
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['id_prod'])) {
  3.         $ip = 'localhost';
  4.         $username = 'blabla';
  5.         $password = 'blublu';
  6.         $database = 'bleble';
  7.         $mysqlId = mysqli_connect($ip,$username,$password,$database);
  8.  
  9.         $id = $_POST['id_prod'];
  10.         $query = "select id_sub,nama_sub,harga from msubproduk where id_prod='$id' order by id_sub";
  11.         $result = mysqli_query($mysqlId,$query);
  12.         while(list($s_id,$nama,$harga) = mysqli_fetch_row($result)) {
  13.                 $price = number_format($harga,0,',','.');
  14.                 echo "<option value='$s_id'>$nama [ Harga $price ]</option>\n";
  15.         }
  16.         mysqli_free_result($result);
  17.         mysqli_close($mysqlId);
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment