Forum Moderators: coopster
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Name: %s", $row["id"], $row["name"]);
} As you can see the individual fields may be accessed as a hash. You can do whatever you want with the $row array. To use them as values in a form just print the form and the corresponding value from the database whereever it goes.
echo '<input type="text" name="name" value="', $row['name'], '">';
Hope this helps.
Andreas
This applies to both sprintf() and printf().Each conversion specification consists of a percent sign (%), followed by one or more of these elements
A type specifier that says what type the argument data should be treated as. Possible types:
% - a literal percent character. No argument is required.
b - the argument is treated as an integer, and presented as a binary number.
c - the argument is treated as an integer, and presented as the character with that ASCII value.
d - the argument is treated as an integer, and presented as a (signed) decimal number.
u - the argument is treated as an integer, and presented as an unsigned decimal number.
f - the argument is treated as a float, and presented as a floating-point number.
o - the argument is treated as an integer, and presented as an octal number.
s - the argument is treated as and presented as a string.
x - the argument is treated as an integer and presented as a hexadecimal number (with lowercase letters).
X - the argument is treated as an integer and presented as a hexadecimal number (with uppercase letters).
Have a look at this post [webmasterworld.com] to see how sprintf() compares to concatenation and interpolation speedwise.
Andreas