Forum Moderators: coopster
$variablename->Value = '
$data = mysql_query ("SELECT * FROM dbtable ORDER BY id DESC")
or die (mysql_error());
$info = mysql_fetch_array ( $data );
{
echo "" .$info[\'FCKeditor1\'] . "";
}
';
:)
$data = mysql_query ("SELECT * FROM dbtable ORDER BY id DESC")
or die (mysql_error());
$info = mysql_fetch_array ($data);
With your original -
$variablename->Value = ' // start of variable
// get info from database, removed to save space
$info = mysql_fetch_array ( $data );
{ // start of statement-group...but no conditions attached to this
echo "" .$info[\'FCKeditor1\'] . ""; // echo " ' would break you out of the variable, as you are using ' to group everything
} // end of statement-group
'; // end of variable
You are trying to run all of your get info/fetch array within your variable. You are sort of trying to run a function within a variables, like you can do within javascript. You can do a similar thing with php using create_function [uk2.php.net].
However as you are trying to get a known array value into your $variablename->Value it would be a lot easier to read if you just use one = other.
So get all of your information. Then -
$variablename->Value = $info['FCKeditor1'];
[edited by: PHP_Chimp at 10:19 am (utc) on Jan. 30, 2008]