0

what is the problem?
i have this message when insert?

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 '4'', `data_no` = ''1'', `note_date` = 1293628283, ' at line 4

and this is form

<form id="form1" name="form1" method="post" action="">
      <label for="textarea">notetext</label>
      <p>
        <textarea name="notetext" id="notetext"></textarea>
      </p>
      <p>
        <label for="Submit">add</label>
        <input type="submit" name="add" value="add" id="add" />
</p>
    </form> 
	<?php
	if(isset($_POST['add']))
{
    $note_contact=$_GET['uni'];
	$note_text=mysql_real_escape_string($_POST['notetext']);
	$data_no=$_GET['id'];
	
	$sql_note = "
    INSERT INTO `notes` SET
	      
		 `note_text` = '$note_text',
		 `note_contact` = '$note_contact',
         `data_no` = '$data_no',
         `note_date` = " . time() . ",
         `note_status` = 1
";  
		if (!mysql_query($sql_note,$contacts))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";
	}
	?>
2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by diafol
0
`note_contact` = '$note_contact',

seems to be the problem. Does this field exists in your DB? I can't even see where the value ($note_contact) is passed.

0
$note_contact=$_GET['uni'];

i have it from path
and it's field

0

details.php?id='2'&uni='3'
i have path like this
when remove quote it work good
details.php?id=2&uni=3
??

0

Yep, don't use quotes in a querystring (url).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.