Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!