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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -