Page 1 of 1

dumb question

Posted: Mon May 14, 2007 10:13 am
by kippy
My database values are returning to my sticky form, but all data after the spaces are being dropped. What am I missing?

Posted: Mon May 14, 2007 10:16 am
by N1gel
quotaion marks.

if the value being returned from the db isn't in quotes it will only show the bit upto the first space that also goes for submitting data to a db

Posted: Mon May 14, 2007 11:22 am
by kippy
so i need to add quotation marks prior to entering data into the database?

Posted: Mon May 14, 2007 11:30 am
by N1gel
sorry

all i meant was any strings in the sql query would have to be inside quotation marks.

as long as the data in the database is correct just put quotes in your form
here is a quick example

$result = mysql_query( $query );

$row=mysql_fetch_row($result);

echo "<input type='text' name='field1' value=' ".$row[0]." '>";
echo "<input type='text' name='field2' value=' ".$row[1]." '>";

Hope this is what you mean, and i hope this helps

Posted: Mon May 14, 2007 1:55 pm
by kippy
Gotcha, thanks...