Frederikoo

Results

Dec 3rd, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4. <?php
  5.  
  6.  $item = $_POST['name'];
  7.  
  8.  // Connect to DB
  9.  mysql_connect("hostname", "username", "password") or die(mysql_error());
  10.  mysql_select_db("dump") or die(mysql_error());
  11.  //select Data
  12.  
  13.  // Get a specific result from the "typeName" column:
  14. $result = mysql_query("SELECT `typeID` FROM `invTypes` WHERE `typeName` = '$item'") or die(mysql_error());
  15.  
  16. // Get the result:
  17. $row = mysql_fetch_array( $result );
  18. // Print out the typeID
  19. echo $row['typeID']."  ".$row[''];
  20. ?>
  21.  </body>
  22.  </html>
  23.  
Advertisement
Add Comment
Please, Sign In to add comment