I have been using the mysql api in PHP, and am now converting to mysqli for the increased security. The example syntax I have seen uses printf, and I would like to know if this is necessary. At the moment I use echo, like so:
echo "<h1>".$row['ARTICLE_NAME']."</h1>
<div id='leftlayer' class='leftlayer'>
<p><strong>Username: </strong>".$row['USERNAME']."
<p><strong>Article Number: </strong>".$row['ARTICLE_NO']."
<p><strong>Subtitle: </strong>".$row['SUBTITLE']."
<p><strong>Auction Start: </strong>".$row['ACCESSSTARTS']."
</div>";
Since with mysqli you must bind variables to the result, I have done this like so:
$getRecords->bind_result($ARTICLE_NO, $ARTICLE_NAME, $SUBTITLE$, $CURRENT_BID, $START_PRICE, $BID_COUNT, $QUANT_TOTAL, $QUANT_SOLD, $ACCESSSTARTS, $ACCESSENDS, $ACCESSORIGIN_END, $USERNAME, $BEST_BIDDER_ID, $FINISHED$, $WATCH$$, $BUYITNOW_PRICE, $PIC_URL, $PRIVATE_AUCTION, $AUCTION_TYPE, $ACCESSINSERT_DATE, $ACCESSUPDATE_DATE, $CAT_DESC$, $CAT_PATH, $ARTICLE_DESC, $COUNTRYCODE, $LOCATION$, $CONDITIONS, $REVISED$, $PAYPAL_ACCEPT, $PRE_TERMINATED, $SHIPPING_TO, $FEE_INSERTION, $FEE_FINAL$, $FEE_LISTING, $PIC_XXL$, $PIC_DIASHOW, $PIC_COUNT, $ITEM_SITE_ID);
and would like to know if I could simply replace my reference to $row with the bound variable, for example:
<p><strong>Username: </strong>".$USERNAME."
Are there any security problems with this approach, or is it fine