2
여기에 문제가 있습니다. 내가 배열의문자열/데이터베이스를 변수로 만들려면
$query = mysql_query("SELECT * FROM users Where username = 'fahmi'");
$result = mysql_fetch_array($query);
결과가 변수로 문자열을 원하는 - $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;
이 코드, 결과는 $a
인을 실행하면하지만 난 결과가 "This is a result 1"
이다 싶어, 도와주세요 나, 덕분에 ...
이 [가변 변수] (http://php.net/manual/en/language.variables.variable.php)를 원할 수도 있습니다. –
'$ a'에서 이중 따옴표를 제거하면됩니다 :'$ result [ 'data'] = $ a','$ a'는 변수이므로''', –
@FrayneKonok 어떻게'$ a'가 데이터베이스에 저장되었고 asker는이 데이터를 원한다는 것을 이해합니다 어떤 변수를 사용할 변수를 결정하기위한 필드 –