Jump to content


Photo

Problem with code in php! It works on another server!

Code php mysql

  • Please log in to reply
5 replies to this topic

#1 ryugold

ryugold

    Newbie

  • Members
  • 2 posts

Posted 17 September 2019 - 06:18 PM

Always I try to access my login.php shows the message: 

 

the path is: http://rpgmakergold2...mples/login.php

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@rpgmakergold2003.heliohost.org to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

 

 

 

please help me with this!


Edited by ryugold, 17 September 2019 - 06:22 PM.


#2 flazepe

flazepe

    Rank X Member

  • Moderators
  • 1,056 posts
  • Gender:Male

Posted 17 September 2019 - 06:34 PM

http://rpgmakergold2003.heliohost.org/ - This needs to be fixed first.

Here's the code for classe-db.php:

<?php
	if(!class_exists('DB')){
		class DB {
			public function __construct(){
				$mysqli = new mysqli('localhost', 'ryugold', '[redacted]', 'ryugold_cms');
				
				if($mysqli->connect_errno){
					printf("Conex√£o falhou %s\n", $mysqli->connect_error);
					exit();
				}
				
				$this->connection = $mysqli;
			}
			
			public function insert($query){
							
				$result = $this->connection->query($query);
				
				return $result;
			}
			
			public function select($query){
				$result = $this->connection->query($query);
				
				while($obj = $result->fetch_object()){ // This is what initially caused the error
					$results[] = $obj;
				}
				
				return $results;
			}
		}
	}
	   
	$db = new DB;

?>
I tried to help this person through Discord but it turned out that I was too rarted and here we are.

#3 ryugold

ryugold

    Newbie

  • Members
  • 2 posts

Posted 17 September 2019 - 06:55 PM

the login system use another database and don't use this file(classe-db) to connect to database!

it was fixed! this error appears because there's no news posted in database! it seaches for the news, if it does not find, return this error!


Edited by ryugold, 17 September 2019 - 06:59 PM.


#4 Luigi123

Luigi123

    Rank X Member

  • Moderators
  • 1,890 posts
  • Gender:Male
  • Location:Winnipeg, Manitoba, Canada

Posted 17 September 2019 - 11:48 PM

Moved to Customer Service.
Posted ImagePosted ImagePosted Image
Posted ImagePosted ImagePosted Image

#5 flazepe

flazepe

    Rank X Member

  • Moderators
  • 1,056 posts
  • Gender:Male

Posted 18 September 2019 - 05:18 AM

No. This belongs to Website Management and Coding.

#6 flazepe

flazepe

    Rank X Member

  • Moderators
  • 1,056 posts
  • Gender:Male

Posted 19 September 2019 - 05:47 AM

At this point, you won't be getting much response. I would recommend using newer software as I think that your software is outdated.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users