Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. //Edit these details to your mysql database. /phpmyadmin. be sure to have external connection allowed, if not, use 127.0.0.1 (local host) on both.
  2. forward ConnectMySQL();
  3. public ConnectMySQL()
  4. {
  5. GTADM=mysql_connect("185.25.150.156","virt554_samp", "virt554_samp", "gowno123");
  6. //example GTADM=mysql_connect("127.0.0.1","gtaserver4279", "gtaserver4279", "maybefuckoff");
  7. printf("%d",mysql_errno(GTADM));
  8. if(mysql_errno() != 0)
  9. {
  10. mysql_close(GTADM);
  11. printf("[MYSQL]: [ERROR]:first Connection to `DATABASE` failed!");
  12. GTADM=mysql_connect("185.25.150.156","virt554_samp", "virt554_samp", "gowno123");
  13. //example GTADM=mysql_connect("127.0.0.1","gtaserver4279", "gtaserver4279", "maybefuckoff");
  14. printf("%d",mysql_errno(GTADM));
  15. if(mysql_errno() != 0)
  16. {
  17. mysql_close(GTADM);
  18. printf("[MYSQL]: [ERROR]:Second Connection to `DATABASE` failed!");
  19. }
  20. else
  21. {
  22. //mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
  23. printf("[MYSQL]:second Connection to `DATABASE` successful! || %d",GTADM);
  24. con=2;
  25. }
  26. }
  27. else
  28. {
  29. //mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
  30. printf("[MYSQL]:first Connection to `DATABASE` successful! || %d",GTADM);
  31. con=1;
  32. }
  33. return 1;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement