[unixODBC-support] Prompt ok, PHP no.. :(]

cadastros at daniellima.net cadastros at daniellima.net
Wed Aug 16 13:54:56 BST 2006


I forgot, the SQL sentence that I'm trying to execute is just a "select
count(*) fom funcionarios"

> Hi again,
>
> The problem continues :D
>
> The problem is in the odbc_connect line. I've tried some ways:
> <code>
> //1st:
>
> $ser="192.168.0.229"; #the name of the SQL Server
> $db="test"; #the name of the database
> $user="X"; #a valid username
> $pass="x"; #a password for the username
>
> #one line
> $conn=odbc_connect("DRIVER=SQL
> Server;SERVER=".$ser.";UID=".$user.";PWD=".$pass.";DATABASE=".$db.";Address=".$ser.",1433","","");
>
> //2nd way:
> #one line
> $conexao = odbc_connect("Driver={SQL
> Server};Server=192.168.0.229;Database=test","X","x");
>
> </code>
>
> No way worked... Some hint?
>
> In php command continues to say:
> Segmentation fault
>
> Some configuration in odbc or freeTDS?
>
> My freeTDS conf file:
>
> [MyServer2k]
>         host = 192.168.0.229
>         port = 1433
>         tds version = 8.0
>
>
> Remembering that in isql command it works fantastic:
> isql MSSQLTestServer X x
>
> I've tried to change 192.168.0.229 to MSSQLTestServer in php conde...
>
> Regrads
>
> Daniel
>
>> Daniel,
>>
>> I've this problem with php once and there was nothing to do with
>> freeTDS. Try to limit your output in SQL query. It's probably the write
>> of a great number of tuples in your php code that's causing that
>> behaviour.
>>
>> Regards,
>> Henrique
>>
>> cadastros at daniellima.net wrote:
>>> Folks,
>>>
>>> I've tried the command php and got this answer:
>>>
>>> Segmentation fault
>>>
>>> What the hell is this?
>>>
>>> Att
>>>
>>> Daniel Lima
>>>
>>> Subject:
>>> RE: [unixODBC-support] Prompt ok, PHP no.. :(
>>> From:
>>> Stefan Radman <Stefan.Radman at ctbto.org>
>>> Date:
>>> Tue, 15 Aug 2006 10:46:49 +0200
>>> To:
>>> "Support for the unixODBC project" <unixodbc-support at easysoft.com>
>>>
>>> Ever tried executing php from the command line instead of using apache?
>>> What's the result?
>>>
>>>
>>> Some hints:
>>>
>>> Permissions on odbc.ini/odbcinst.ini
>>> http://mail.easysoft.com/pipermail/unixodbc-support/2005-February/000365
>>> .html
>>>
>>> Library search path
>>> http://www.easysoft.com/developer/languages/php/apache_odbc.html#appc
>>>
>>>
>>> Stefan
>>>
>>>
>>>
>>>>> -----Original Message-----
>>>>> From: unixodbc-support-bounces at easysoft.com
>>>>> [mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of
>>>>> cadastros at daniellima.net
>>>>> Sent: Monday, 14 August, 2006 19:34
>>>>> To: unixodbc-support at easysoft.com
>>>>> Subject: [unixODBC-support] Prompt ok, PHP no..  :(
>>>>>
>>>>> Lets see if I can make any progress here :D
>>>>>
>>>>> I'm using SuSe 9.3, PHP 4, Apache 2 with unixODBC and FreeTDS.
>>>>>
>>>>> I made all the things that I had to connect to my SQL Server.
>>>>>
>>>>> In prompt it works greatfully:
>>>>>
>>>>> isql -v MSSQLTestServer X x
>>>>>
>>>>> When it comes to PHP I did:
>>>>>
>>>>> $connect = odbc_connect("MSSQLTestServer", "X", "x");
>>>>> $query = "SELECT * FROM products";
>>>>> $result = odbc_exec($connect, $query);
>>>>>
>>>>> while(odbc_fetch_row($result)) {
>>>>>  $field1 = odbc_result($result, 1);
>>>>>  $field2 = odbc_result($result, 2);
>>>>>  print("$field1 $field2\n");
>>>>> }
>>>>>
>>>>> odbc_close($connect);
>>>>>
>>>>> In isql mode it works fantatisc but in PHP it seens that no aswers
>>>>> ins
>>>>> given... I think PHP is not able to talk to unixODBC and FreeTDS.
>>>>>
>>>>> The PHP error is somethink like "Empty page" (apache error)...
>>>>>
>>>>> Somebody makes any idea of what is wrong..
>>>>>
>>>>> Thanks
>>>>>
>>>>> Daniel LIma
>>>>>
>>>>> P.S: I've tried every single tip that I found on php help about
>>>>> odbc_connect...
>>>>> _______________________________________________
>>>>> unixODBC-support mailing list
>>>>> unixODBC-support at easysoft.com
>>>>> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>>>>>
>>>>>
>>>
>>>
>>> _______________________________________________
>>> unixODBC-support mailing list
>>> unixODBC-support at easysoft.com
>>> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> unixODBC-support mailing list
>>> unixODBC-support at easysoft.com
>>> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>>>
>>> Esta mensagem foi verificada pelo E-mail Protegido Terra.
>>> Scan engine: McAfee VirusScan / Atualizado em 15/08/2006 / Versão:
>>> 4.4.00/4830
>>> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>>>
>>
>>
>>
>> -------------------------------------------------------------------------
>> Somente as pessoas nomeadas no endereco podem abrir esta mensagem,
>> se voce recebeu por engano, por favor reenvie para qualquer delas,
>> comunicando o fato e elimine esta mensagem. E expressamente proibido
>> abrir,
>> divulgar ou copiar esta mensagem ou seus arquivos no todo ou em parte.
>>
>> --
>> Esta mensagem foi verificada pelo sistema de antivírus e
>>  acredita-se estar livre de perigo.
>>
>>
>> _______________________________________________
>> unixODBC-support mailing list
>> unixODBC-support at easysoft.com
>> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>>
>
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>




More information about the unixODBC-support mailing list