newbie
newbie

Reputation: 14950

Updating sql data through PHP

Good day!

I am having a problem in showing the data that I need to Update.

For example: I have a field - NAME. And user input "John Travolta" on it and enter to save it in SQL. Then to update it, he will click the update and a textbox will appear with the name "John Travolta" with it.

The problem is I am only getting "John" and the "Travolta" does not appear on the text box.

My code is as follows:

<input name="event" type="text" id="event" size="69" value=<?php print stripslashes($row_array['event'])?>>

What can i do in order for the whole name to appear in the textbox? Thank you in advance.

Upvotes: 0

Views: 84

Answers (2)

T4u
T4u

Reputation: 291

Use that code:

<input name="event" type="text" id="event" size="69" value="<?php print stripslashes($row_array['event']);?>">

Upvotes: 1

Dr.J
Dr.J

Reputation: 1218

You need to put quotes before and after the PHP line so HTML can parse it as a string. otherwise you will end with value=John Travolta when you want value="John Travolta"

Upvotes: 5

Related Questions