I have written a function which is meant to split text entries from a db into several different layout configurations based on an entry in the "layout" column of the texts table.
I loop through the "mysql_fetch_array()" concatonating text onto one of three posible layout config elements. Heres where I get my error...
I dont see a problem but if anyone can explain why on my very first text concatonation the parsing engine returns an "unexpected T_VARIABLE" error for my concatonating onto the object property first thing in an if() statement - please comment here.
...code below
thanks
protected function run_select(){
mysql_connect("path","user","pass");
mysql_select_db("mydatabase");
$sql = $this->select . " " . $this->from . " " . $this->where . ";";
$result = mysql_query($sql);
//echo($sql);
$this->text_right = '<div class="content_text_right">';
$this->text_left = '<div class="content_text_left">';
$this->text_full = '';
$this->image = '';
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
if($row['layout'] == 'right'){
/*HERE's THE WARNING->*/ $this->text_right .= '<p class="'$row['style']'">'$row['text']'</p>';
}
if($row['layout'] == 'left'){
$this->text_left .= '<p class="'$row['style']'">'$row['text']'</p>' ;
}
if($row['layout'] == 'full'){
$this->text_full .= '<p class="'$row['style']'">'$row['text']'</p>' ;
}
}
$this->text_right .= '</div>';
$this->text_left .= '</div>';
if($this->text_left != '<div class="content_text_left"></div>'){
echo($this->text_left);
}if($this->text_right != '<div class="content_text_right"></div>'){
echo($this->text_right);
}if($this->text_full != ''){
echo($this->text_full);
}
mysql_close();
//echo($this->select . "<br />" . $this->from . "<br />" . $this->where . "<br />");
}