Hello friends. I have two files as follows : 1. The test.htm is as follows :
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <form name="form1" method="post" action="testphp1.php"> <p> <input type="text" name="newsid"> </p> <p> <input type="text" name="title"> </p> <p> <input type="text" name="author"> </p> <p> <input type="text" name="body"> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> </body> </html> 2. The testphp1.php is as follows: <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <?php $link=mysql_connect("localhost","myid","Mypassword"); if ($link){ print "link id is $link"; } else { print "error connecting to database"; } $posted=time(); $query="INSERT INTO news (newsid,title, author, body, posted) //VALUES($newsid,'$title','$author', '$body', $posted)";) //Newsid is an INT, title is a VARCHAR author is a VARCHAR, body is a VARCHAR IF (mysql_query($query)){ print "Row added to table"; } else { print "error adding row"; } ?> </body> </html> Explanation : I run the test.htm and then the testphp1.php executes well. The databse is connected, but the error "error adding row" appears all the time. Can someone tell me my error in SDyntax? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php