php-windows Digest 1 Jul 2003 14:05:07 -0000 Issue 1803
Topics (messages 20635 through 20639):
Re: Problem with Insert with ODBC
20635 by: Veselina Jecheva
20639 by: Radovan Radic
SQL Server - 255 field size limit in PHP ?
20636 by: DessieD
20637 by: Svensson, B.A.T. (HKG)
Re: Using ODBC in PHP to connect to a sql server
20638 by: Svensson, B.A.T. (HKG)
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
How can I do this - odbc_exec returns just false on error?
At 16:41 6/30/03 +0200, Svensson, B.A.T. (HKG) wrote:
>You ought to test for an error in your "error detection"
>not for an return value on the execute of an SQL query.
>
>> -----Original Message-----
>> From: Veselina Jecheva [mailto:[EMAIL PROTECTED]
>> Sent: Monday, June 30, 2003 3:19 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP-WIN] Problem with Insert with ODBC
>>
>>
>> Hello,
>> I've got the following problem: the following line prints "Error" all the
>> time:
>>
>> $link = odbc_connect("conference","","");
>> $query="insert into participants (name, surname, family, degree,
>> work_place, speaker, listener, topic, title,
>> co_author, aspekt, comp, proektor, video, date15, date16, date17,
>> fee)
>> values ('$name', '$surname', '$family', '$degree', '$work_place',
>> '$speaker', '$listener', '$topic', '$title',
>> '$co_author', '$asp', '$computer', '$proekt', '$video', '$date15',
>> '$date16', '$date17', '$fee')";
>> $result=odbc_exec($link,$query);
>> if ($result) echo "Thank you, your request has been processed.";
>> else echo "Error";
>>
>> The database is created by Access, all variables are defined and have their
>> values. It seems the SQL statement is not ok.
>> Thank's in advance.
>> Veselina
>>
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
--- End Message ---
--- Begin Message ---
Try this:
odbc_error
Get the last error code (PHP 4 >= 4.0.5)
string odbc_error ( [resource connection_id] )
"Veselina Jecheva" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How can I do this - odbc_exec returns just false on error?
>
> At 16:41 6/30/03 +0200, Svensson, B.A.T. (HKG) wrote:
> >You ought to test for an error in your "error detection"
> >not for an return value on the execute of an SQL query.
> >
> >> -----Original Message-----
> >> From: Veselina Jecheva [mailto:[EMAIL PROTECTED]
> >> Sent: Monday, June 30, 2003 3:19 PM
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP-WIN] Problem with Insert with ODBC
> >>
> >>
> >> Hello,
> >> I've got the following problem: the following line prints "Error" all
the
> >> time:
> >>
> >> $link = odbc_connect("conference","","");
> >> $query="insert into participants (name, surname, family, degree,
> >> work_place, speaker, listener, topic, title,
> >> co_author, aspekt, comp, proektor, video, date15, date16,
date17,
> >> fee)
> >> values ('$name', '$surname', '$family', '$degree', '$work_place',
> >> '$speaker', '$listener', '$topic', '$title',
> >> '$co_author', '$asp', '$computer', '$proekt', '$video', '$date15',
> >> '$date16', '$date17', '$fee')";
> >> $result=odbc_exec($link,$query);
> >> if ($result) echo "Thank you, your request has been processed.";
> >> else echo "Error";
> >>
> >> The database is created by Access, all variables are defined and have
their
> >> values. It seems the SQL statement is not ok.
> >> Thank's in advance.
> >> Veselina
> >>
> >>
> >> --
> >> PHP Windows Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
>
--- End Message ---
--- Begin Message ---
Hi
Im new to PHP so may be an obvious workaround to this. Not sure if it could
be a bug in PHP..
I have a SQLServer table that contains a large nvarchar field (size: 2000).
My php code to retireve and display this field is something like (dont have
code to hand right now):
$quote = mssql_fetch_array($query);
echo $quote[0];
The problem is that only the first 255 characters are getting returned by
PHP !? The mssql_fetch_array function creates the returned array so its not
something I can manually size etc.
Anyone seen this before, or offer any comments ??
Thanks
D
--- End Message ---
--- Begin Message ---
For instance as default the ODBC driver is set to return maximum
255 chars in column. Change your setting to reflect your needs.
> -----Original Message-----
> From: DessieD [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 01, 2003 11:55 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] SQL Server - 255 field size limit in PHP ?
>
>
> Hi
>
> Im new to PHP so may be an obvious workaround to this. Not sure if it could
> be a bug in PHP..
>
> I have a SQLServer table that contains a large nvarchar field (size: 2000).
> My php code to retireve and display this field is something like (dont have
> code to hand right now):
>
> $quote = mssql_fetch_array($query);
> echo $quote[0];
>
> The problem is that only the first 255 characters are getting returned by
> PHP !? The mssql_fetch_array function creates the returned array so its not
> something I can manually size etc.
>
> Anyone seen this before, or offer any comments ??
>
> Thanks
>
> D
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Try the manual pages at www.php.net
> -----Original Message-----
> From: Harpreet [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 30, 2003 10:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Using ODBC in PHP to connect to a sql server
>
>
> Does anyone know of a nice artical that explains how I connect to a sql
> server using odbc connection in my PHP pages.
>
> I use mssql_connect right now and it works fine. I would like to use odbc
> instead to connect.
>
> Any help is appreciated.
>
> Thanks,
>
> Regards,
> Harpreet Kaur
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---