Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
how to call sybase view using odbc in PHP

I am trying to fetch the records from the sybase view ODBC in PHP but it does not return data. I am getting records from table but not able to get data from view.

Query -- select * from odb.VP_myview;

odb = odbc DSN VP_myview = view

Above query does not show any error but same time it does not return any records.

Below is PHP code

<?php
$con = @odbc_connect('DSN','USERNAME','PASSWORD',SQL_CUR_USE_ODBC) or die("<B>Error!</B> Couldn't Connect To Database. Error Code:  ".odbc_error());
$query = 'select * from odb.VP_myview';
$result = odbc_exec($con,$query);
$totrec = odbc_num_rows($result);
var_dump($totrec);// it return negative integer number
exit;

?>

It would be really great help. I am trying since last 3-4 days but no success.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

From the manual:

Using odbc_num_rows() to determine the number of rows available after a SELECT will return -1 with many drivers.

That's especially true for Sybase. C.f. this question

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda