Jump to content

Problem printing data from database


rstewar

Recommended Posts

I am trying to print data from a database into a form. I used  the mysql_escape_string() function before the data was inserted so slashes were added before all quotes. The problem is that when I try to print the data and use stripslashes() to remove the slashes the output stops before the single quote (').

 

 

It is supposed to output "Billy Ray's.."

 

The code that outputs the text:

<input type='text' name='name' id='name' value='<?php echo stripslashes($fields['name']['value']); ?>' />

 

Image of output

field.jpg

 

What I find odd is that the html source from the webpage shows the full string:

<label>Name of Bar: <span class='required'>*</span></label> 
<input type='text' name='name' id='name' value='Billy Ray's...' /> 

 

Does anyone have any idea what is going on?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/191182-problem-printing-data-from-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.