yesterday i was doing work in php mysql i wrote a query
mysql_query("INSERT INTO `first` (`firstName`, `lastName`, `address1`, `city`, `state`, `zip`, `country`, `amount`, `date`) VALUES ('$firstName','$lastName','$address1','$city','$state','$zip','$country','$amount','$date')")
it did not work for me and then my boss wrote below query
mysql_query("INSERT INTO `first` (`firstName`, `lastName`, `address1`, `city`, `state`, `zip`, `country`, `amount`, `date`) VALUES ('".$firstName."','".$lastName."','".htmlentities($address1)."','".$city."','".$state."','".$zip."','".$country."','".$amount."','".$date."')");
and it works!!
is there anything wrong in first query..please help me out..
$address1? The only differences here is the use ofhtmlentities()in the second query.