i hawe some problem here. i want make a string to be a variable,
$query = mysql_query("SELECT * FROM users Where username = 'fahmi'");
$result = mysql_fetch_array($query);
Result of the array is - $result['data']="$a"
$a = "This is a Result 1" ;
$b = "This is a Result 2" ;
$c = "This is a Result 3" ;
$final = $result['data'];
echo $final;
When i ran this code, result is $a but i want the result is "This is a result 1", please help me, thanks...
$a, like:$result['data'] = $a,$ais a variable so you not needs to use those",$ais stored in the database and the asker wants this data field to determine which variable to usea / b / c, then it will be just variable of variables. Ex:$final = $$result['data'];, and then echo$final.$resultactually have data from db in array format and you are over-writing this array with your$a,$b,$cvariables. and from where they come from and what they mean here is not clear too.