Olive Branch MS Chamber of Commerce (circa Oct 1999)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

38 lines
683 B

  1. <?php // define our generic db calls for use with mysql
  2. function connect($host, $dbname) {
  3. global $user, $passwd;
  4. $link = mysql_connect($host,$user,$passwd);
  5. if(mysql_select_db($dbname,$link)) {
  6. return($link);
  7. }
  8. }
  9. function query($link, $query) {
  10. $result = mysql_query($query, $link);
  11. return($result);
  12. }
  13. function numrows($result) {
  14. $count = mysql_num_rows($result);
  15. return($count);
  16. }
  17. function fetch_object($result, $row) {
  18. $data = mysql_fetch_object($result);
  19. return($data);
  20. }
  21. function free_result($result) {
  22. mysql_free_result($result);
  23. }
  24. function close($link) {
  25. mysql_close($link);
  26. }
  27. function errormessage($link) {
  28. return(mysql_error());
  29. }
  30. ?>