Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

when apostrophe ( ' ) is entered. doesnt continue to save

Status
Not open for further replies.

Keendev

Technical User
Jan 23, 2006
106
PH
hi,
I have a small problem on my form and insert page.
I noticed that everytime I put apostrophe on the textfield
and on text area for the description field, the data doesn't insert/save on my database.

any advice would be a great help.. thanks.

 
you must escape input before you insert it in to a database

Code:
$_POST['input']= "John O'Grady";

$sql = "insert into $table set name = '" . [red]mysql_escape_string($_POST['input'])[/red]."'";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top