Re: MySQL not updating...

From: Date: Tue, 06 Jun 2000 21:57:45 +0000
Subject: Re: MySQL not updating...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-232@lists.php.net to get a copy of this message
Try changing $iresult = mysql_query($sql); to: $iresult = mysql_query($sql) or die(mysql_error()); SQL syntax errors are not echoed by mysql_query(), unless you echo mysql_error(). It's probably something as simple as needing to escape an inverted comma somewhere. You can also test for the success of the query by: if ($iresult) { } > if ($submit) { > $sql = "INSERT INTO hist_info > (fname,lname,dept,title,prior_agencies,nature_of_business,"; > $sql .= "categories,previous_clients,areas_of_interest) VALUES > ('$fname','$lname',"; > $sql .= > > "'$dept','$title','$nature_of_business','$categories','$previous_clients',"; > $sql .= "'$areas_of_interest')"; > $iresult = mysql_query($sql); > > echo "Thank you! Information entered.\n"; > > } else { > // It just displays the form again. > } ?>

« previous php.db (#232) next »