I want to know if is possible to do the following in a simpler way:
$MyConn = new mysqli($host,$User,$Pass);
$TheKey = "...blablabla";
$QueryConvertedKey = "SELECT PASSWORD('".$TheKey."');";//Or SELECT YEAR(CURRENT_DATE);
$RsltCK = $MyConn->query($QueryConvertedKey);
//How to replace the while loop or if?
while ($NewRow = $RsltCK->fetch_row()) { //I think that I don't need to use a while or if for this.
echo "The Converted Key is:".$NewRow[0];
}
I'm sure the response of my query contains exactly one result, so I don't think I need to use a while
loop or if
clause.
Is it possible to do this without while
and if
, in one line of code?