如果存在值,如何禁用文本字段或输入?

I am trying to pull the value(which works) and disable the field from input(which will NOT work) and post it. Thanks in advance.

Here is my code below:

<textarea name="title" id="title"><?php
    $query  = "SELECT * FROM table WHERE id = '$member'";
    $result = mysql_query($query);
    $member = mysql_real_escape_string($member);

  while($row = mysql_fetch_array($result)) {
    $title = $row['title'];
    echo $title;
    }?> <?=($disable ? " disabled=\"disabled\"" : "");?>
    <?php if($title == true) {
    $disable = true;
    }
    else {
    $disable = false;
    }
    ?></textarea>

I'm not sure if you're trying to disable it based on query results (which it looks like what you're trying to do). You're closing the textarea opening tag before setting the disabled attribute. The disabled attribute has to be an attribute of the textarea tag:

<textarea disabled="disabled"></textarea>