For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > July 2007 > PDO and MS Sql Server









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PDO and MS Sql Server
Bruce Cowin

2007-07-05, 9:58 pm

I'm using PHP 5.1. The documentation for PDO doesn't list MS Sql server =
as one of the drivers that support PDO but there is a php_pdo_mssql.dll =
which seems to work so I'm using that.

I need to get the id of a new record just inserted. I can't use lastInsert=
Id() as I get a message saying it's not supported. So I've created a =
stored proc that returns the id just created (code below). The insert =
works fine but the $emailid variable is not populated. I can run the =
stored proc in query analyzer and it outputs the id correctly so I know =
the stored proc works. All the examples I see return strings, not sure if =
that has anything to do with it. And as for the parameter length for the =
output parameter, I've tried nothing as well as 99999.

$stmt =3D $this->dbh->prepare("exec usp_EmailInsert :projectid, :mailfrom, =
:mailto, :mailcc, :subject, :body, :mimefilename, :emailid");
$stmt->bindParam(':projectid', $projectid, PDO::PARAM_INT);
$stmt->bindParam(':mailfrom', $from, PDO::PARAM_STR, 100);
$stmt->bindParam(':mailto', $to, PDO::PARAM_STR, 500);
$stmt->bindParam(':mailcc', $cc, PDO::PARAM_STR, 500);
$stmt->bindParam(':subject', $subject, PDO::PARAM_STR, 1000);
$stmt->bindParam(':body', $body, PDO::PARAM_LOB);
$stmt->bindParam(':mimefilename', $mimefilename, PDO::PARAM_STR, 500); =
=09
$stmt->bindParam(':emailid', $emailid, PDO::PARAM_INT, 99999);
$stmt->execute();
=09
echo "\nemailid =3D $emailid\n";



Anyone have any ideas? Thanks.


Regards,

Bruce
Hilermo

2007-07-14, 3:44 pm

Carmen Electra and Halle Berry Having Fun On The Piano!

beach download movie nudist slide show movie maker chicas video porn gratis new paris hilton picture free girl on girl video
free XXXXing video clip adult finder movie online ethiopian google music video free gay porn movie video post site
paris hilton x rated video free fem dom video clip top porn movie site tube u video web gay movie sex free
upcoming movie free full porn psp video pam anderson video hot hardcore movie page xxx video chat

japan adult video
abba dvd movie
hilton paris photo sex
blow job black movie
download free music video
free madonna song
lesbian recruiter video
flash gratis jocuri online
bangla music video
adult online movie rental
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com