Database not working here?


Hi @PachiMc!

hi idk whyy my db is not working, i am using localhost where al worked, then i recreated the db and changed the db.php but is not working,

Please copy/paste the error you are receiving when attempting to connect to database.

EDIT: I have just checked your code and it connects to the database successfully.

Note to use $link variable in order to connect to DB inside your main scripts. Use global keyword to access it inside functions.

Also, next time you want to debug PHP errors, please add php_value display_errors 1 in .htaccess file. If you don’t have such file created yet in your website root, please create one.


yea but i dont want to debug,still without working, i use requiere db.php and then $link do yyou think that i should use $_globals[link] ? because on localhost worked without it btw i am not using functions


Now it wasn’t working because you had created anther database… I have updated the info in db.php.

Please try running your code again. If it still doesn’t work, please point us the scripts and the lines where it fails.


still without inserting nothing ;(


What is the script which inserts info into database?


you can see send.php there is a lot of inserts and updates


I have performed a test which inserted data into database successfully. It has to be a syntax error somewhere.

@Supun @ckhawand , can you check out the send.php at in /public_html?


Will do check, but where is the form that sends those info?


is in index, with a jquery button called “contact” method get


I can’t see it :confused:

<form method="GET" action="send.php" id="form1">
<i id="closeb" class="fas fa-times"></i>

  <label class="formtext" for="steamid">Tu SteamID</label>
<input class="inputform" name="steamidname" readonly id="steamid" type="number" value="<?php echo($steamprofile['steamid']) ?>">
  <label class="formtext" for="mens">Mensaje</label>
<textarea required rows="3" cols="50" name="mens" class="inputform" placeholder="Cuentanos..." id="mens"></textarea>
<input  id="submitform" type="submit">



that is the html code !


I meant, I see error messages on the index :slight_smile:


what you mean where is the error ?


first will have error because you are not logged in so the db cant create your id after your sign in if your db work (thats dont) should create all without errors


I’d check later :slight_smile:


so ?.. -.- i cant upgrade on my code if the sql dont work ;(


Actually it is for sure an error in your SQL syntax :slight_smile:
I’d recommend checking the experts at


well, if is a sql syntax error the code shouldnt work on localhost, or console of phpmyadmin,

here is an example
id64 is get from $steamau = require('userInfo.php');

$id64 = $steamprofile['steamid'];
$create = "INSERT INTO inventario (user) VALUES ('$id64')";

		 mysqli_query($link, $create);

from the session

$steamprofile['steamid'] = $_SESSION['steam_steamid'];

from the openid

$_SESSION['steam_steamid'] = $content['response']['players'][0]['steamid'];

there isnt error ;(


Can you downgrade your PHP version?
And check if you have a tmp in the same directory as public_html