Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getclientstock($client) {
- $option=array();
- $option['driver'] = 'mysql'; // Database driver name
- $option['host'] = 'localhost'; // Database host name
- $option['user'] = 'user'; // User for database authentication
- $option['password'] = 'pass'; // Password for database authentication
- $option['database'] = 'database'; // Database name
- $option['prefix'] = ''; // Database prefix (may be empty)
- $db=JDatabaseDriver::getInstance($option);
- $query=$db->getQuery(true);
- $query->select($db->quoteName(array('unit_imei' , 'client')));
- $query->from($db->quoteName('connections'));
- $query->where($db->quoteName('client') . ' = ' . $db->quote($client));
- $db->setQuery($query);
- $result=$db->loadAssocList();
- return $result;
- };
- <?php
- $option=array();
- $option['driver'] = 'mysql'; // Database driver name
- $option['host'] = 'localhost'; // Database host name
- $option['user'] = 'user'; // User for database authentication
- $option['password'] = 'pass'; // Password for database authentication
- $option['database'] = 'database'; // Database name
- $option['prefix'] = ''; // Database prefix (may be empty)
- $db=JDatabaseDriver::getInstance($option);
- function getclientstock($db, $client) {
- $query=$db->getQuery(true);
- $query->select($db->quoteName(array('unit_imei' , 'client')));
- $query->from($db->quoteName('connections'));
- $query->where($db->quoteName('client') . ' = ' . $db->quote($client));
- $db->setQuery($query);
- $result=$db->loadAssocList();
- return $result;
- };
- function setclientstock($db, $client) {
- // code here...
- };
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement