0

I have a script which takes the variable from a form and puts it into a mysql table.

There is an entry, but inside the field it is blank.

I have attached screenshots.

This is my code

// prepare form values for insert
$URL = mysql_real_escape_string($_POST['url']);

// Make mysql connection below

$sql = "INSERT INTO `addurl` (`u_link`) VALUES ('$URL')";
$res = mysql_query($sql) or die(mysql_error());
  if(!$res){
  echo "Could not enter data";
  } else {
  echo "data entered into database";
  }
  ?>
</html>
2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by redZERO
0

Get rid of the single quotes around your table name and field name. $sql = "INSERT INTO addurl (u_link) VALUES ('$URL')";

0

It still shows a blank field. The thing i don't understand is that it registers the entry, just its blank.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.