www.webdeveloper.com
Results 1 to 3 of 3

Thread: Parse Error Inserting IP on the datae base

Threaded View

  1. #1
    Join Date
    May 2010
    Posts
    133

    Parse Error Inserting IP on the datae base

    Why do I get this parse error message when I try to insert an ip into the data base.

    Parse error: syntax error, unexpected T_DNUMBER
    Below is my code
    PHP Code:
     $ip2=219.90.90.2;
    $ip2=mysql_real_escape_string($ip2); 

    mysql_query("INSERT INTO table_name(ip_string)
       VALUES(
    $ip2)"); 
    Now if I try to put single or double quote like this
    PHP Code:
     $ip2='219.90.90.2' 
    the error will be gone, but it will not insert into the data base
    Last edited by anishgiri; 04-07-2013 at 10:47 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles