I am trying to get an update command to work in PHP.  I am able to update 
records going directly to phpmyadmin command line. I have even let it 
produce the php code to insert, but have not been able to get it to work.

I have it stripped down to one command hoping to get it to work then 
replicate entire forms for clients to use direct.I get no error codes, I 
only get my message "It did not enter into DB";

Anyone see where I am going wrong?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="http://www.w3.org/1999/xhtml";>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
test<input name="test" type="text" />
<input name="submit" type="submit" value="submit" />


$batchconnetion = mysql_connect(host, 'un', 'pw', 'db')//sanatized for board
or die('Error connecting with MySQL Database');


//$sql="update contact set type = \'$test\' where item_id = \'164\'"; //this 
is the code created by phpmyadmin

 $sql = "INSERT INTO contact  comments, VALUES = $test WHERE contact_id = 


$result = mysql_query($sql,$batchconnetion);

if($result == true) {
       echo "Successfully Inserted Records";
   } else {
       echo "It did not enter into DB";




__________ Information from ESET Smart Security, version of virus signature 
database 5171 (20100604) __________

The message was checked by ESET Smart Security.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to