I am new to phpMySQL and php. and I am trying to get a value from database and put it in a textbox. Currently, I only have 1 value in my table to test the code:
This is my code:
<?php
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "dbtest";
$tbl_name="tbltest";
$con = mysql_connect("$mysql_hostname","$mysql_user","$mysql_password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$mysql_database", $con);
$all = mysql_query("SELECT Balance FROM tbltest");
?>
And then in my HTML side, I have this:
<input type="text" name="Balance" value="<?php echo $all; ?>" />
But when I tried to run the code the value that appears in the textbox is:
Resource Id #4
What did I miss? Thank you for the help