php - how can i get mysql record like a data? -
hi question weird i'll explane in here.
i want record cv examples , user informations. have 2 table that;
cv *id *format users *id *name *age
in format cell include html tags , $name , $age tags that;
<p> name <b>$name</b> , im <b>$age</b> years old. <p>
my codes that;
$sqlcv = mysql_fetch_array(mysql_query("select * cv id='2'")); $text = $sqlcv['format']; $sqluser = mysql_fetch_array(mysql_query("select * users id='3'")); $name = $sqluser['name']; $age = $sqluser['age']; echo $text;
result; name $name , im $age years old. html tags works name , age not shown :( hope can explane one
you can use sprintf()
echo sprintf("hi im %s , im %d years old.", "darius", $age);
Comments
Post a Comment