Convert a steamid to HEX

Hi,

I would like to know how I could automatically convert the steamid when connecting with steam on my website to HEX. This is so that my site is looking for information in the server database.

I am currently using this function to connect to my site.

I succeed. Now the hardest part is making sure to make a mysql query with this code.

<?php
require 'steamauth/steamauth.php';
    include ('steamauth/userInfo.php');

echo base_convert ($steamprofile['steamid'], 10, 16);

?>

The query I should use

$sql = "SELECT job FROM users WHERE steamid='".$steamprofile['steamid']."'";

Help me someone :rofl: :sweat_smile:

<?php

require_once "include/config.php";
    include ('steamauth/userInfo.php');


$hexsteam = base_convert ($steamprofile['steamid'], 10, 16);
$sql = "SELECT name FROM users WHERE identifier='steam:".$hexsteam."'";
$result = $link->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo "" . $row["name"]. "";
    }
} else {
    echo "0 results";
}
?>
1 Like

What’s inside the include/config.php file?

Hey I have got an question.
So I´m abel to convert an SteamID64 to an hexID.
Is ist possible to convert an hexID to an SteamID64 ?