There is some data is stored in my sql table. I want to fetch the data in the form of string.
$sql= "SELECT hash FROM signupinfo WHERE fname = 'nikhil';";
$hashfix = mysqli_query($connection,$sql);
echo $hashfix;
but the error coming
var_dump($hashfix). If you want to read your array all Data fetched from a db come in the form of array
Its not a good idea to echo array...by that I mean you can't. What you can do in to make a string is. $a=implode(',',$hashfix)
There are 2 ways to print values you want
If its a single key array.
echo $hashfix[0]->ColumnName
Or run a foreach
You could do something like this...
$sql= "SELECT `hash` FROM `signupinfo` WHERE `fname` = 'nikhil';";
$hashfix = mysqli_query( $connection, $sql );
if( $hashfix ){
while( $rs=$connection->fetch_object( $hashfix ) ){
echo $rs->hash;
}
}