Hi,

Pretty new to php so would like some advice on how to insert linefeed to the text area.

here is my senario

the query:

$polQuery   = "SELECT * FROM users WHERE user_id='$userid' AND status='active' LIMIT 1";
$polResult = smart_mysql_query($polQuery);
$polTotal   = mysql_num_rows($polResult);

if ($polTotal > 0)
{
$row = mysql_fetch_array($polResult);
}

textarea

<textarea name="payment_details" cols="40" rows="3" class="inputt2"><?php echo $row['polnum']; ?> <?php echo $row['provider']; ?></textarea>

How do I insert carriage return between <?php echo $row['polnum']; ?> <?php echo $row['provider']; ?>

ie <?php echo $row['polnum']; ?> Carriage Return Here <?php echo $row['provider']; ?>

The test area will then look like:
12345
Lloyds TSB

Thanks for help in advance
Darren

Try by adding ."\n" at the first echo:

<textarea name="payment_details" cols="40" rows="3" class="inputt2"><?php echo $row['polnum']."\n"; ?> <?php echo $row['provider']; ?></textarea>

bye!

What you really need is a newline (As @cereal posted in the above reply)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.