Guest User

Untitled

a guest
Dec 13th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <?php
  2.  
  3. $con=mysqli_connect("localhost","dbname","dbuser","dbpass");
  4. // Check connection
  5. if (mysqli_connect_errno())
  6. {
  7. echo "Failed to connect to MySQL: " . mysqli_connect_error(); }
  8.  
  9. $sql="SELECT * FROM users";
  10. $result=mysqli_query($con,$sql);
  11. $rowcount=mysqli_num_rows($result);
  12. echo $rowcount;
  13. if($rowcount<=25)
  14. {
  15. <<show rest of the edit view code eg $viewdefs ['Users']....... etc >>
  16. }else
  17. {
  18. << show a message >>
  19. }
  20. }
  21. mysqli_free_result($result);
  22. mysqli_close($con);
  23. }
  24. ?>
  25.  
  26. <?php
  27.  
  28. $con=mysqli_connect("localhost","dbname","dbuser","dbpass");
  29. // Check connection
  30. if (mysqli_connect_errno()) {
  31. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  32. } else {
  33. $sql="SELECT * FROM users";
  34. $result=mysqli_query($con,$sql);
  35. $rowcount=mysqli_num_rows($result);
  36. echo $rowcount;
  37. if($rowcount<=25) {
  38. <<show rest of the edit view code eg $viewdefs ['Users']....... etc >>
  39. } else {
  40. << show a message >>
  41. }
  42. }
  43. mysqli_free_result($result);
  44. mysqli_close($con);
  45. }
  46. ?>
Add Comment
Please, Sign In to add comment