Guest User

Untitled

a guest
Sep 14th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2. function dbQuery($cmdsql){
  3. $dbserver = "localhost";
  4. $dbuser = "root";
  5. $dbpass = "1234"; /* ใส่รหัสผ่านของฐานข้อมูลด้วย */
  6. $dbname = "edoc";
  7. $dbconn = mysql_connect($dbserver,$dbuser,$dbpass) or exit("SERVER Unavailable");
  8. mysql_select_db($dbname,$dbconn);
  9.  
  10. mysql_query("SET NAMES UTF8");
  11.  
  12. $result = mysql_query($cmdsql,$dbconn) or exit(mysql_error());
  13. return $result;
  14. mysql_close($dbconn);
  15. }
  16. ?>
Add Comment
Please, Sign In to add comment