Getting 500 internal server error

### Website URL

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

I have been getting this error message for last one week. earlier i thought it was a temporary server error, but seems that is not the case.

Kindly guide.

1 Like

I am getting similar error while opening few other pages in the site.

Please resolve on priority.


Working

1 Like

on clicking submit it shows 500 server error

Can you try this?

2 Likes

is it related to issue i am facing ?

any solution ??

Yes it is.

2 Likes

where should i test it. In the file which is not loading or create a new file and test it.

i have created a link to a new php page with above code, and it does open. how does it solve my issue with other pages

Can create test.php file for it.
Also this:

It does not, it was to make sure whether it is server fault or the code itself crashing due to being uncompatible with PHP8.2

3 Likes

above image is mentioning MariaDB, whereas i had started with MySQL back then. All the above code was working from last 2 years. no changes in the code

The error literally indicates that some of the variable that you are trying to use are undefined.

MariaDB is based on MySQL.

3 Likes

I took a little look at your code. The problem appears to be that the code grabs some attributes from the activeDrTbl and activeSrNo session keys, but these session attributes are missing. That’s what the two warnings are about.

These session variables are then used to construct the database query. But since the values are missing, an empty value is used in the query, which results in an invalid SQL statement. This results in the query failing and the page crashing.

I don’t know where or how those keys are supposed to be set, but they aren’t, so please make sure that these values are set properly.

And maybe validate that these properties are set correctly before putting them in the query. You’re only doing a SELECT query here, but writing something to the database like this can cause quite nasty corruption to the data in your database.

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.