I need an update form on a page that will look to see if anything is entered in the users "welcome" field in their record and, if there is content, display it for editing / updating.
If there is nothing in the user's field enter "My Default Text" and let me use that to update the user's welcome field in their record.
Thus far I have the following:
<? session_start();
if (!isset($_SESSION['kt_login_id'])):
$_SESSION['kt_name'] = $_POST['kt_name'];
$_SESSION['kt_welcome'] = $_POST['kt_welcome'];
endif;
?>
<?php $sql = "SELECT 'welcome' FROM `users` WHERE `id` = $kt_login_id";
$qry = mysql_query($sql);
if(@mysql_num_rows($qry) > 0)
{
while($r = mysql_fetch_array($qry))
{
$kt_welcome = $r[1];
}
}
else
{
$kt_welcome = "My default text";
}
?>
<textarea name="welcome" cols="80" rows="20"><?php echo $_SESSION['kt_welcome']; ?></textarea>
<?php mysql_close(); ?>
Problem here is that the only thing ever returned is "My default text" regardless of whether there is any content in the user's record.
It's like the query is looking at it and not seeing it any content or the query isn't looking at the user's record at all
Thanks for any assistance