37.gif

Search (advanced search)
Use this Search form before posting, asking or make a new thread.
Tips: Use Quotation mark to search words (eg. "How To Make Money Online")

01-26-2019, 01:17 PM (This post was last modified: 01-27-2019 11:03 AM by anonymous1981.)
Post: #1
little infor please php msq need a little help first question
think the code below is correct
my final output is i want to echo $luckycashvalue into a lable
i just include echo $luckycashvalue anywhere i want to display the value
can i just add

$luckycashvalue = "SELECT cash FROM users WHERE userId=$username";
echo $luckycashvalue
will i have to open and close a connection with each command thanks


can i predefine $luckycashvalue to <[{cash}]>
<[{cash}]>=echo $luckycashvalue
so where ever i put <[{cash}]> it will echo $luckycashvalue anywhere in the script or


<?php
$shostname = "localhost"; //svet ip machine
$masterlogin = "masterlogin"; //master sql username
$masterpassword = "master password"; //master
$databasegames = "games"; //gameslobbydatabase
?>
<?php
$luckycon = @mysqli_connect('$shostname', '$masterlogin', '', '$databasegames');
if (!$luckycon) {
echo "Error: "crypto . mysqli_connect_error();
exit();
}
$luckycashvalue = "SELECT cash FROM users WHERE userId=$username";

echo $luckycashvalue
>


any help would be awesome




21.gif