i store the value of my select statement result to an array and stored it to a variable named $fname the i used it as the value of:
<input type='text' name='fname' value=<?php echo $fname ?> />
but when $fname's value is more than 1 word it only displays the first word, but when i:
echo $fname;
i get the right result. What is the problem with this?
Need help. ASAP.
Thanks,
Rexicon
need help about <input value>
Moderator: General Moderators
-
guosheng1987
- Forum Newbie
- Posts: 24
- Joined: Thu Oct 15, 2009 3:03 am
Re: need help about <input value>
use funtion "print_r" to output array
Re: need help about <input value>
how do i use it? can u give a sample code for that, im new in php.
thanks,
rexicon
thanks,
rexicon
-
guosheng1987
- Forum Newbie
- Posts: 24
- Joined: Thu Oct 15, 2009 3:03 am
Re: need help about <input value>
print_r($fname);
Re: need help about <input value>
it's still the same output, only the first word appears the second word does not appear.
here's a sample code:
<?php
.
.
while ($row = oci_fetch_array($result))
{
$fname = $row['FIRST_NAME'];
}
?>
<html>
.
.
.
<input type='text' name='fname' value=<?php echo $fname ?> />
.
.
</html>
here's a sample code:
<?php
.
.
while ($row = oci_fetch_array($result))
{
$fname = $row['FIRST_NAME'];
}
?>
<html>
.
.
.
<input type='text' name='fname' value=<?php echo $fname ?> />
.
.
</html>