Re: binding data type error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 16, 2015 at 11:35 PM, hadi <almarzuki2011@xxxxxxxxxxx> wrote:

>
>
> > -----Original Message-----
> > From: Aziz Saleh [mailto:azizsaleh@xxxxxxxxx]
> > Sent: Friday, April 17, 2015 5:46 AM
> > To: hadi
> > Cc: PHP General
> > Subject: Re:  binding data type error
> >
> > On Thu, Apr 16, 2015 at 10:33 PM, hadi <almarzuki2011@xxxxxxxxxxx>
> wrote:
> >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Aziz Saleh [mailto:azizsaleh@xxxxxxxxx]
> > > > Sent: Friday, April 17, 2015 5:20 AM
> > > > To: hadi
> > > > Cc: PHP General
> > > > Subject: Re:  binding data type error
> > > >
> > > > On Thu, Apr 16, 2015 at 10:02 PM, hadi <almarzuki2011@xxxxxxxxxxx>
> > > wrote:
> > > >
> > > > > Hi dear list,
> > > > >
> > > > >
> > > > > i have php script with Microsoft database. im trying to bind
> > > > > SQLSRV_SQLTYPE_NVARCHAR('max') but im getting error Fatal error:
> > > > > Unknown
> > > > > PDO::PARAM_* constant given
> > > > >
> > > > > here is my code
> > > > >
> > > > > $stmt = $con->prepare('insert into [feedtable]
> > > > > (title,link,pubdata,description,category,image,imagelink,source)
> > > > > values
> > > >
> > > (:title,:link,:pubdata,:description,:category,:image,:imagelink,:sourc
> > > e)');
> > > > >
> > > > > $stmt->bindParam(':title',$item-
> > > > >title,SQLSRV_SQLTYPE_NVARCHAR('max'))
> > > > > ;
> > > > > $stmt->execute();
> > > > >
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/) To unsubscribe,
> visit:
> > > > > http://www.php.net/unsub.php
> > > > >
> > > > >
> > > > The allowed PDO params list:
> > > >
> > > > http://php.net/manual/en/pdo.constants.php
> > > >
> > > > I think you are trying to use this instead (mixing it with PDO):
> > > >
> > > > http://php.net/manual/en/book.sqlsrv.php
> > > >
> > > > What are you trying to do here?
> > >
> > > Im trying to insert data to mssql with "
> > SQLSRV_SQLTYPE_NVARCHAR('max')".
> > >
> > > I already have the links which you post.
> > >
> > >
> > Not sure what that method does to the query, but you can not use the
> > constant SQLSRV_SQLTYPE_NVARCHAR in PDO. You will need to use sqlsrv
> > driver instead (as pointed out in the StackOverflow question you posted):
> >
> > https://msdn.microsoft.com/en-us/library/cc626305.aspx
>
> Im already using sqlsrv driver.
> You can see here in my dba connection ,
>
> $con = new PDO("sqlsrv:Server=hadi-tosh;Database=rssfeed", "rssuser",
> "rssuser");
>
>
I was referring to the actual driver functions located here:

http://php.net/manual/en/book.sqlsrv.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux