Here is my code I'm trying to use to store the ip address of the client. I'm trying to store the ip address to an unsigned int, by trying to do something seen in this question: Which MySQL datatype to use for an IP address?
Here is my code:
$client_ip = $_SERVER['REMOTE_ADDR'];
$ip_insert = "SELECT INET_ATON('$client_ip')";
$sql = "INSERT INTO rtv_sign_cispa (name_cispa,ip_cispa,email_cispa,message_cispa) VALUES ('$name','$ip_insert','$email','$message')";
There are other things in that statement being stored but just ignore those ones, they work, it's the ip address that isn't.
Error:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '192.168.2.1')','email@email.com','Hmmmm')' at line 1
The ip address after near does in fact show the correct IP, I just switched it to a local ip for security reasons of course. email@email.com and Hmmm is from a form that is filled out to activate this so don't really mind that.
Does anyone know what I'm doing wrong? I'm kinda new to SQL.