| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: May 2004 Location: www.dx3k.com
Posts: 581
![]() ![]() | php/mysql help needed hey can you tell me what is wrong with this script please i keep getting "unexpected ) on line 18" PHP Code: ????: NamePros.com http://www.namepros.com/programming/63178-php-mysql-help-needed.html thanks dx3k
__________________ I B Back |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: May 2004 Location: www.dx3k.com
Posts: 581
![]() ![]() | still dont want to work this is what i have now PHP Code:
__________________ I B Back |
| |
| | #4 (permalink) |
| NamePros Regular Join Date: Jun 2004 Location: Ekenas
Posts: 271
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | $query = "INSERT INTO 'ip' VALUES (''$ip"); that is wrong as well, you opened the quotes outside of the bracket but closed them in the bracket also wht do you have ''$ip try :- $query = "INSERT INTO 'ip' VALUES ('".$ip."')";
__________________ Flexi Web Host buy Advertising On Forum Hosts Free phpBB forum hosting Free Image Host |
| |
| | THREAD STARTER #5 (permalink) |
| NamePros Regular Join Date: May 2004 Location: www.dx3k.com
Posts: 581
![]() ![]() | now it is on about a T_STRING erro on line 18 ( i h8 this line lol) what is a t_string? <? include('sqlinfo.php'); $db = mysql_connect("$host", "$account"); mysql_select_db("dx3k_logger",$db); $query = INSERT INTO `data` ( `ip` , `browser` ) VALUES ( '$ip' ); ?> thanks dx3k
__________________ I B Back |
| |
| | #6 (permalink) |
| NamePros Regular Join Date: Oct 2003 Location: Sweden
Posts: 395
![]() ![]() | <? include('sqlinfo.php'); $db = mysql_connect($host,$account); mysql_select_db("dx3k_logger",$db); $query = "INSERT INTO `data` ( `ip` , `browser` ) VALUES ('$ip')"; ?> That should work. Just note that you have two fields defined in the fields list and only one value, in case you intend to run the query. I must really recommend you to read a few PHP beginner tutorials. |
| |
| | #8 (permalink) | ||||
| Senior Member Join Date: Aug 2004 Location: Washington
Posts: 4,324
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks
__________________ Download youtube videos at www.HugYouTube.com -NO LINKS TO PARKED PAGES- Anonymous access at www.Banned.net | ||||
| |
| | #10 (permalink) |
| NamePros Regular Join Date: Jun 2004 Location: Ekenas
Posts: 271
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | you will need to enclose them in quotes, also why are you only assigning ip when your query should be inserting 2 lots of data (ip and browser)
__________________ Flexi Web Host buy Advertising On Forum Hosts Free phpBB forum hosting Free Image Host |
| |