0

I am trying to store an ip after i have used the function ip2long() but it won't INSERT anything when i use this function? if i change $ip = 10; it will store 10 as my ip in the database, but it won't store the number returned from the function.

I have tried to check if the returned value is a int with is_int() and it returns true.

The ip in the database is a int(39), so basically why won't it update my database?

PHP/SQL

$ip = ip2long($_SERVER['REMOTE_ADDR']);

$stmtt = $dbCon->prepare("INSERT INTO rating_users (imgId, rating, ip) VALUES (?, ?, ?)");
$stmtt->bind_param('iii', $imgValue, $voteValue, $ip);
$stmtt->execute();
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141

0 Answers0