Jump to content

Simple question or not...


Gruzin

Recommended Posts

hi everybody,
I've got a little problem, when I'am trying to write something like this: [color=red]Let's Go[/color], mysql says: [color=green]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 's','80.241.240.89')' at line 4[/color]

P.S in other ways it works correctly.

here is the code, hope u guys can help me, thanks a lot.

<?php
require("../ban/ban.php"); //check if the address is banned
$text = nl2br(stripslashes($_POST['The_Textarea'])); // text inputed in form
$userip = $_SERVER['REMOTE_ADDR']; // get user ip and store it in db

$con = mysql_connect("localhost","3d","pass");
if(!$con)
{
  die('Couldn"t connect'.mysql_error());
}
mysql_select_db("3d",$con);
$insert = "INSERT INTO func_auction
(user,mes,ip)
VALUES
('$_POST[user]','$text','$userip')"; 
if(!mysql_query($insert,$con))
{
  die('Error:'.mysql_error());
}
header( 'Location: http://www.3d.caucasus.net/auction.php' ) ;
mysql_close($con);
?>
Link to comment
https://forums.phpfreaks.com/topic/17428-simple-question-or-not/
Share on other sites

[quote author=Barand link=topic=104103.msg415096#msg415096 date=1155496817]
[quote]$text = nl2br(stripslashes($_POST['The_Textarea'])); // text inputed in form[/quote]


[/quote]
umm... nothing wrong with that script, I've got a problem with:
[color=red]$userip = $_SERVER['REMOTE_ADDR']; [/color] // get user ip and store it in db

becouse of that I get this error...
Link to comment
https://forums.phpfreaks.com/topic/17428-simple-question-or-not/#findComment-74183
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.