Jump to content

[SOLVED] Problem with displaying field in text box?


wwfc_barmy_army

Recommended Posts

Hello.

 

I have this code:

 <?php
$result = mysql_query("SELECT title FROM optionaltext WHERE id= 1");
  
$row = mysql_fetch_array($result);
$titletoedit = $row['title'];
//to test value
echo $titletoedit;
?>
  Title: <input name="title" type="text" value=<?php echo $titletoedit; ?> size="50" maxlength="30"/>
  <br/><br/>

 

The variable $titletoedit gets the field which has some text data in which is 'Optional Text 1',  when using echo it shows 'Optional Text 1', but when i try to display it in the textbox it just says 'Optional'. Any ideas why?

 

Thanks.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.