Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. function getclientstock($client) {
  2.  
  3.  
  4. $option=array();
  5. $option['driver'] = 'mysql'; // Database driver name
  6. $option['host'] = 'localhost'; // Database host name
  7. $option['user'] = 'user'; // User for database authentication
  8. $option['password'] = 'pass'; // Password for database authentication
  9. $option['database'] = 'database'; // Database name
  10. $option['prefix'] = ''; // Database prefix (may be empty)
  11. $db=JDatabaseDriver::getInstance($option);
  12.  
  13. $query=$db->getQuery(true);
  14. $query->select($db->quoteName(array('unit_imei' , 'client')));
  15. $query->from($db->quoteName('connections'));
  16. $query->where($db->quoteName('client') . ' = ' . $db->quote($client));
  17. $db->setQuery($query);
  18. $result=$db->loadAssocList();
  19. return $result;
  20. };
  21.  
  22. <?php
  23. $option=array();
  24. $option['driver'] = 'mysql'; // Database driver name
  25. $option['host'] = 'localhost'; // Database host name
  26. $option['user'] = 'user'; // User for database authentication
  27. $option['password'] = 'pass'; // Password for database authentication
  28. $option['database'] = 'database'; // Database name
  29. $option['prefix'] = ''; // Database prefix (may be empty)
  30. $db=JDatabaseDriver::getInstance($option);
  31.  
  32. function getclientstock($db, $client) {
  33.  
  34. $query=$db->getQuery(true);
  35. $query->select($db->quoteName(array('unit_imei' , 'client')));
  36. $query->from($db->quoteName('connections'));
  37. $query->where($db->quoteName('client') . ' = ' . $db->quote($client));
  38. $db->setQuery($query);
  39. $result=$db->loadAssocList();
  40. return $result;
  41. };
  42.  
  43. function setclientstock($db, $client) {
  44. // code here...
  45.  
  46. };
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement