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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.