Ok, I have some php pages running under IISv5 that connect to a MS SQl database via ODBC.
Now, select and insert statements work - great - BUT updates do not. If I use the query below and use a select or insert statement - it works. I have seached on phpbuilder - there was a simailar comment but no answer.
Any ideas?
Heres the code:-
<?php
$dbConnection = odbc_connect('ITREQUEST' , '$SERVER[PHP_AUTH_USER]', '$SERVER[PHP_AUTH_PASSWORD]');
if (!$dbConnection)
{
exit("Unable to connect to database: $dbConnection");
}
if($campaign == ''){
exit ("Please enter a campaign name");}
if ($quotedHours == "") {
$quotedHours = 0;}
$SQL_Exec_String = "Update requests (requester,email,campaign,
required, detail,objective,clientRequest,
quoted,quoteAccepted,quotedHours)
VALUES
('$_SERVER[PHP_AUTH_USER]',
'$email',
'$campaign',
'$required',
'$detail',
'$objective',
'$clientRequest',
'$quoted',
'$quoteAccepted',
'$quotedHours')
WHERE request='$request'";
$dbConnection = odbc_exec( $dbConnection, $SQL_Exec_String );
echo '
';
print_r ("<B><U>IT Request Form Summary</U></B><br><br>
<B>Request No:</B> $request <br><br>
<B>Name:</B> $_SERVER[PHP_AUTH_USER] <br><br>
<B>Email Address:</B> $email <br><br>
<B>Campaign:</B> $campaign <br><br>
<B>Required by?:</B> $required <br><br>
<B>Whats Required:</B> $detail <br><br>
<B>Objective:</B> $objective <br><br>
<B>Client Request:</B> $clientRequest <br><br>
<B>Quoted?:</B> $quoted <br><br>
<B>Quote Accepted?:</B> $quoteAccepted <br><br>
<B>Quoted Hours?:</B> $quotedHours <br>");
echo '
';
odbc_close($dbConnection);
?>
Scott
Previous Topic | Next Topic