note 11640 added to mssql_query
| From: | php-general at lists dot php dot net | Date: | Wed, 28 Feb 2001 20:53:37 +0000 |
| Subject: | note 11640 added to mssql_query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11668@lists.php.net to get a copy of this message | ||
Has anyone else noticed that INSERT and UPDATE queries always return false? How are you supposed to
know if the query worked? Here is an example:
<?php
mssql_connect('EPROD_DB_TEST', 'sa', 'freagle');
mssql_select_db('Support');
$Result = mssql_query("UPDATE testforum_seq SET nextval=nextval+1");
if ($Result)
{
echo("Result is TRUE<BR>");
}
else
{
echo("Result is FALSE<BR>");
}
echo '<BR><BR>';
$Result = mssql_query("INSERT testforum_seq values(10)");
if ($Result)
{
echo("Result is TRUE<BR>");
}
else
{
echo("Result is FALSE<BR>");
}
?>
This will print "Result is FALSE" for both queries.
Greg
http://www.php.net/manual/en/function.mssql-query.php