Click here to Skip to main content
15,908,172 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi all

i am in update page with "id" as a querystring and take that id and retieve all item details from it , when i try this

PHP
$dtl=@mysql_query("select * from shop_item where id='$id'");
$id=@mysql_result($dtl,0,"id");
$judul=@mysql_result($dtl,0,"title");


PHP
<input name="judul" size='40' value='$judul'  />


the "$judul" appears on the textbox not its value

So, Any Help Please..........


Thanks
Posted

1 solution

This is expected result. The value you can see if shown based on your HTML code sample, not PHP processing. You initialize the input control named judul to the value of "$judul" in HTML and never update it in PHP code, anyway, not in the code you show.

Did you simply forget another PHP fragment inside your HTML code? If not, are you sure you understand how PHP generates HTML code delivered to the client on HTTP request? You need to echo $judul in PHP.

—SA
 
Share this answer
 
v3
Comments
moon2011 16-Nov-11 3:12am    
i am sorry , i don't know php as good as should , so , If you can help me , please tell me what should i do??

Thanks
Sergey Alexandrovich Kryukov 16-Nov-11 4:45am    
I already told you. You need to echo HTML code. Please see my very last statement. If you write "$judil" in HTML it will output "$judil", if you write echo $judul in PHP, it will output its value into HTML code. Please understand how PHP works. Inside PHP block only "echo" can write anything into HTML. (I'm not talking about headers.)

After all, echo whole next line in PHP, inside block.

--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900