Page 1 of 1

need help about <input value>

Posted: Fri Oct 23, 2009 10:47 pm
by rexicon
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

Re: need help about <input value>

Posted: Fri Oct 23, 2009 11:04 pm
by guosheng1987
use funtion "print_r" to output array

Re: need help about <input value>

Posted: Fri Oct 23, 2009 11:13 pm
by rexicon
how do i use it? can u give a sample code for that, im new in php.

thanks,

rexicon

Re: need help about <input value>

Posted: Sat Oct 24, 2009 12:08 am
by guosheng1987
print_r($fname);

Re: need help about <input value>

Posted: Sun Oct 25, 2009 8:29 pm
by rexicon
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>