Re: Textfields dont fully populate

From: Date: Sat, 22 Nov 2003 17:01:09 +0000
Subject: Re: Textfields dont fully populate
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-170671@lists.php.net to get a copy of this message
Sorry m8 i am a total newbie to php+html, I dont get these problems with PHP+Flash Here is the code i am using to return the edit page with the data. $result = mysql_query("SELECT * FROM $tablename WHERE id= $id")or die("<br>ther was an error<br> tablename:= $tablename<br> row id:= $id"); if ($myrow = mysql_fetch_array($result)) { echo "<form method='post' action='edit3.php?tablename=$tablename'>\n"; do { printf("<input type='hidden' name='id' value=%s> Artist <br><input type='text' name='artist' size=25 maxlength=25 value=%s><br> Title <br><input type='text' name='title' size=25 maxlength=25 value=%s><br> Picture <br><input type='text' name='picture' size=25 maxlength=25 value=%s><br> Review <br><textarea name='review' cols=30 rows=5>%s</textarea><br> Label<br><input type='text' name='label' size=25 maxlength=25 value=%s><br> Format <br><input type='text' name='format' size=25 maxlength=25 value=%s><br> Price <br><input type='text' name='price' size=10 maxlength=8 value=%s><br> Rating <br><input type='text' name='rating' size=10 maxlength=8 value=%s><br>\n", $myrow["id"], $artist=$myrow["artist"], $title=$myrow["title"], $picture=$myrow["picture"], $review=$myrow["review"], $lable=$myrow["label"], $format=$myrow["format"], $price=$myrow["price"], $rating=$myrow["rating"]); } while ($myrow = mysql_fetch_array($result)); echo "<br><input type='submit' value='Submit' name='submit'>"; echo "<input type='reset' value='Reset' name='reset'></form>\n"; } Cheers Paul "Bas" <famde.jong@home.nl> wrote in message news:20031122165308.30144.qmail@pb1.pair.com... > > "Paul Ferrie" <info@innovativedesigns.org.uk> wrote in message > news:20031122164938.22711.qmail@pb1.pair.com... > > Hello again guys > > > > This week i have been on here and made a few posts regarding a small > > admin site app > > > > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html > > > > Most of it is now working thank god, but still have have problems fully > > populating the textfields when i go to edit a record. > > Only one of the fields fully populates with the data returned from the > > $query > > If i view the source file via the broswer(right click / view source) i can > > see that the data has been sent ok > > <input type='text' name='format' size=25 maxlength=25 value=cd > > format> > > But all i see is "cd" > > Anyone > > > > cheers > > > > Paul > > Try to do it in double quotes(the query-data) > In an echo statement, there you must escape the double quotes.

« previous php.general (#170671) next »