PHP application cannot load products from MySQL

Website URL

https://laanadiduradedios.infinityfreeapp.com

Error Message

The website displays: {“error”:“No se pudieron cargar los datos de la repostería.”}. The homepage cannot load products. The database exists and contains the required tables and products. I updated the hosting account password and the DB_PASSWORD setting, but the issue continues. Could you help me check the PHP/MySQL server error?

Other Information

The database exists and contains the required tables and products. I updated the hosting account password and the DB_PASSWORD setting, but the error continues. Please help me identify the PHP/MySQL server error. I have not included any passwords or private keys.

I cannot edit my original post, so I am adding the detailed error here: SQLSTATE[HY000] [2002] Connection refused. My database host is sql208.infinityfree.com; the database name and username match the account, and I updated the hosting password in DB_PASSWORD. Could a human confirm the correct MySQL host/port and check whether the database server is accepting connections for my account? I will not share any passwords.

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

That message, No se pudieron cargar los datos de la repostería, looks like it comes from your own PHP code rather than from InfinityFree or MySQL. It’s probably a catch block that hides the real error. So the first thing to find is the actual exception text.

Could you temporarily change that catch block to also output the exception’s message ($e->getMessage() for PDO, or mysqli_connect_error() for mysqli), then post what it says? Please leave the password out. That text will tell us whether the problem is the connection, the login, or the query.

While you’re in the code, check these three values against what your account has:

  • The host should be sql208.
  • The database name should be exactly if0_43408642_la_anadidura_dios.
  • The username should be your hosting account username. The hosting account password is the one to use for the database, and you’ve already updated that.

If any of those differ, even by one character, that would explain a failure.