Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. $query = tep_db_query("SELECT countries_name, countries_id FROM " . TABLE_COUNTRIES);
  2.  
  3. $countries = array();
  4.  
  5. while($row = tep_db_fetch_array($query))
  6. {
  7. $countries[$row['countries_id']] = $row['countries_name'];
  8. }
  9.  
  10. $country = NULL;
  11.  
  12. foreach($countries as $id => $name)
  13. {
  14.  
  15. if($countryname == $name)
  16. {
  17. $country = $id;
  18. // A die happens here. So it breaks.
  19. break;
  20. }
  21. }
  22.  
  23. die($country); // This dies but nothing gets printed when it should print an ID.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement