Advertisement
demlasjr

php -calc 2

May 13th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?
  2. // The DB connections data
  3. $hostname = 'localhost';
  4. $dbusername = 'xxxxxx';
  5. $dbpass = 'xxxxxxx';
  6. $dbname = 'xxxxxxx';
  7.  
  8. ?>
  9.  
  10. <? $weightid=$_REQUEST['cantidad'];
  11. $link = mysql_connect($hostname, $dbusername, $dbpass); //changet the configuration in required
  12. if (!$link) {
  13.     die('Could not connect: ' . mysql_error());
  14. }
  15. mysql_select_db($dbname, $link);
  16. $query="SELECT title, price FROM shop_shipping where weightfrom=$weightid";
  17. $result=mysql_query($query);
  18.  
  19. ?>
  20. <select name="provincia">
  21. <option>Selecciona provincia</option>
  22. <? while($row=mysql_fetch_array($result)) { ?>
  23. <option value=<?=$row['price']?>><?=$row['title']?></option>
  24. <? } ?>
  25. </select>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement