dumb question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kippy
Forum Commoner
Posts: 84
Joined: Wed Jun 07, 2006 8:25 pm

dumb question

Post by kippy »

My database values are returning to my sticky form, but all data after the spaces are being dropped. What am I missing?
User avatar
N1gel
Forum Commoner
Posts: 95
Joined: Sun Apr 30, 2006 12:01 pm

Post 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
kippy
Forum Commoner
Posts: 84
Joined: Wed Jun 07, 2006 8:25 pm

Post by kippy »

so i need to add quotation marks prior to entering data into the database?
User avatar
N1gel
Forum Commoner
Posts: 95
Joined: Sun Apr 30, 2006 12:01 pm

Post 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
kippy
Forum Commoner
Posts: 84
Joined: Wed Jun 07, 2006 8:25 pm

Post by kippy »

Gotcha, thanks...
Post Reply