![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
php/mysql getting column values from db into textbox on a formiam storing a variable in db as follows
$str='<html><b>ABCD</b></html>'; by using insert query,i put it in mysql db. in my second program iam creating one textbox and inserting it in db as follows $textbox1='name<input type="text" name="t1" value="<?php echo $str;?>">'; by using insert query iam storing it in db.... finally i have written a third program to retrieve these textboxes with $str values from db;but iam getting textbox with <?php echo $str;?> value.but i want to get <html><b>ABCD</b></html> in that textbox.please tell me how to do it. mrjameer |
|
#2
|
||||
|
||||
Re: php/mysql getting column values from db into textbox on a formyou can't put in code like you would to run it inside an HTML page. you to fully construct the string via concatenation...
PHP Code:
__________________
If practice makes perfect and nobody's perfect... why practice? Homepage: http://www.treywhite.com Blog: http://www.treywhite.com/blog.php Web Design Company: http://www.ewebproductions.com |
|
#3
|
|||
|
|||
Re: php/mysql getting column values from db into textbox on a formhere is the code and help me where i was wrong
//program for storing html code in db PHP Code:
//program for storing textboxes with some values in db PHP Code:
//program for retriving the textboxes with the values from db (the values which i stored in db by writing first program) PHP Code:
iam getting blank textboxes or getting some value like <?php $var1;?> help me i was strucked. Last edited by LuciWiz : 21-Aug-2006 at 06:44.
Reason: Please insert your Php code between [php] & [/php] tags
|
|
#4
|
||||
|
||||
Re: php/mysql getting column values from db into textbox on a formIn your second script above... print out the values for $var1, $var2, $var3, and $var4... or use a tool like phpmyadmin to see what these values are in the database.
I wouldn't think that they are being stored properly (if the scripts are actually broken into sections like you have displayed). You would need a SELECT query in the second script to retrieve the variables. Code:
See if that fixes it... if not, let me know, and we can keep at it. PS: Sorry about the formatting... if I put the code in the PHP tags, it would show all of the code on 1 line for some reason... so, I just put it in the generic CODE tag. __________________
If practice makes perfect and nobody's perfect... why practice? Homepage: http://www.treywhite.com Blog: http://www.treywhite.com/blog.php Web Design Company: http://www.ewebproductions.com |
|
#5
|
|||
|
|||
Re: php/mysql getting column values from db into textbox on a formtreyAU21
thanks a lot.i got the result with your code.i want to know that iam using the following code for storing a variable in db,is it correct or not for storing in db: $var11='<b>ABCD</b>'; $var1 = htmlentities($var11); iam retriving the variable from db and passing it through html_entity_decode(variable name): $v1 = html_entity_decode($var1); if i use above format then iam getting the correct output what i want.is it correct or i have to follow some other.please tell me. my second question is that i want to create a horizontal menu in which one end is asusual but the other end should be like cross cut means like following format. |------------------------------------\ |-------------------------------------\ mrjameer |
|
#6
|
||||
|
||||
Re: php/mysql getting column values from db into textbox on a formQuote:
Hello, Trey. I wanted to edit your post, and when I hit "Preview Changes", the code looked all right to me (see bellow). If that is not what it looked like to you, please let me know, and I will pass it to the admin. PHP Code:
Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#7
|
||||
|
||||
Re: php/mysql getting column values from db into textbox on a formHey Lucian,
No matter what I did, it sould strip out all of the line breaks. The code would appear in one line. I edited it several times... going through and and manually hitting enter after every line... copying to notepad and copying it back... and others. Looks like it's working in this post below vvvvv... so maybe it was a fluke? PHP Code:
__________________
If practice makes perfect and nobody's perfect... why practice? Homepage: http://www.treywhite.com Blog: http://www.treywhite.com/blog.php Web Design Company: http://www.ewebproductions.com |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP/MySQL coding issue | cmarti | MySQL / PHP Forum | 3 | 26-Jul-2004 08:01 |
| help with form | orbitel | MySQL / PHP Forum | 11 | 21-Jan-2004 15:29 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The