Data not fetching in the textfield.
am 26.09.2007 18:33:40 von Chris CarterI am trying to fetch data through this code:
My code:
for($i=0;$i
$rows = mysql_fetch_array($results);
echo '
echo '
echo ' ' ;
echo ' ' ;
echo ' ' ;
echo ' class="regForm" disabled="disabled" value=$rows[0]>' ;
echo '
The value option in the textfield is not fetching the data, neither is it
throwing errors. However the same code works perfectly as suggested by one
of expert Nabble users:
Nabble code:
for($i=0;$i
$rows = mysql_fetch_array($results);
echo("");
}
Please help.
Chris
--
View this message in context: http://www.nabble.com/Data-not-fetching-in-the-textfield.-tf 4523451.html#a12904665
Sent from the Php - Database mailing list archive at Nabble.com.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Data not fetching in the textfield.
am 26.09.2007 18:37:21 von NaintaraTry replacing this:
echo '
maxlength="35" id="storename"
class="regForm" disabled="disabled" value=$rows[0]>' ;
With this:
echo '
maxlength="35" id="storename"
class="regForm" disabled="disabled" value='. $rows[0].'>' ;
-----Original Message-----
From: Chris Carter [mailto:chandan9sharma@yahoo.com]
Sent: Wednesday, September 26, 2007 10:04 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Data not fetching in the textfield.
I am trying to fetch data through this code:
My code:
for($i=0;$i
$rows = mysql_fetch_array($results);
echo '
echo '
echo ' ' ;
echo ' ' ;
echo ' ' ;
echo ' maxlength="35" id="storename"
class="regForm" disabled="disabled" value=$rows[0]>' ;
echo '
The value option in the textfield is not fetching the data, neither is it
throwing errors. However the same code works perfectly as suggested by one
of expert Nabble users:
Nabble code:
for($i=0;$i
$rows = mysql_fetch_array($results);
echo(" value=$rows[0]>");
}
Please help.
Chris
--
View this message in context:
http://www.nabble.com/Data-not-fetching-in-the-textfield.-tf 4523451.html#a1
2904665
Sent from the Php - Database mailing list archive at Nabble.com.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Data not fetching in the textfield.
am 26.09.2007 18:39:03 von Jason GerfenYou could always do something like:
while( $x = myql_fetch_array( $results ) ) {
list( $var1, $var2, $var3, ... ) = $x;
echo "";
}
Chris Carter wrote:
> I am trying to fetch data through this code:
>
> My code:
> for($i=0;$i
> $rows = mysql_fetch_array($results);
> echo '
> echo '
> echo ' ' ;
> echo ' ' ;
> echo ' ' ;
> echo ' > class="regForm" disabled="disabled" value=$rows[0]>' ;
> echo '
>
> The value option in the textfield is not fetching the data, neither is it
> throwing errors. However the same code works perfectly as suggested by one
> of expert Nabble users:
>
> Nabble code:
>
> for($i=0;$i
> $rows = mysql_fetch_array($results);
> echo("");
> }
>
> Please help.
>
> Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Data not fetching in the textfield.
am 26.09.2007 18:53:17 von Instruct ICC--_853aff01-5633-4f67-a370-32d59d1c49a6_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> Date: Wed, 26 Sep 2007 09:33:40 -0700
> From: chandan9sharma@yahoo.com
> echo("");
If what you want rendered in html should have quotes like so:
Double quote the value like so:
echo("
>");
and escape $rows[0] in case it contains any double quotes thusly (or with s=
ome other escape function):
echo("
ows[0], '"') . "\">");
____________________________________________________________ _____
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx=
--_853aff01-5633-4f67-a370-32d59d1c49a6_--
Re: Data not fetching in the textfield.
am 27.09.2007 02:50:14 von dmagick
> echo("");
Change to
echo"
htmlspecialchars($rows[0], ENT_QUOTES) . "\">";
So html characters like > and < won't be interpreted by the browser.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Data not fetching in the textfield.
am 27.09.2007 03:23:06 von Niel ArcherYour variable value is not being inserted because you have used single
quotes for the echo, not double quotes as the nabble example does.
Special characters and variables are only interpreted in double quotes,
they are treated literally in single quotes.
--
Niel Archer
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Data not fetching in the textfield.
am 27.09.2007 11:24:34 von OskarNiel Archer napsal(a):
> Your variable value is not being inserted because you have used single
> quotes for the echo, not double quotes as the nabble example does.
> Special characters and variables are only interpreted in double quotes,
> they are treated literally in single quotes.
>
> --
> Niel Archer
>
>
Yes, also "disabled" field is not even sent
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php