使用PHP IBase,是否有任何方法可以在阅读几行后返回第一行(以避免重新提及数据库)

发布于 2025-02-10 00:29:14 字数 763 浏览 1 评论 0原文

使用PHP IBase,Ibase_query获取了关系,几个函数可以从该关系中获取行,但是所有这些功能提取 下一行

在Delphi中,我有能力返回第一行(dataset.first;) - PHP IBase中是否有任何等效的?

我当然可以重新查询数据库,但是如果仍然可以访问原始关系,这似乎浪费了资源。

示例代码:

$table = ibase_query($sql);
$row = ibase_fetch_object($table);

while (!empty($row))
{
    echo $row->ENTRYNO.'<br>';
    $row = ibase_fetch_object($table);
}

//The missing functionality
$table.First;     
//or maybe
$row = ibase_fetch_object($table,first);  
     //in which case of course the following line would be redundant


$row = ibase_fetch_object($table);
while (!empty($row))
{
    //process record

    $row = ibase_fetch_object($table);
}

With php ibase, ibase_query fetches the relation, several functions can then fetch rows from that relation, but all these functions extract the next row.

In Delphi I have the ability to return to the first row (DataSet.First;) - is there any equivalent in PHP ibase?

I could of course re-query the database, but this seems a waste of resources if the original relation is still accessible.

Example code:

$table = ibase_query($sql);
$row = ibase_fetch_object($table);

while (!empty($row))
{
    echo $row->ENTRYNO.'<br>';
    $row = ibase_fetch_object($table);
}

//The missing functionality
$table.First;     
//or maybe
$row = ibase_fetch_object($table,first);  
     //in which case of course the following line would be redundant


$row = ibase_fetch_object($table);
while (!empty($row))
{
    //process record

    $row = ibase_fetch_object($table);
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一影成城 2025-02-17 00:29:14

IBASE/FIREBIRD-PHP驱动程序只能向前获取。如果您想咨询较早的行,则需要以某种形式自己存储它们,或再次执行查询。

The ibase/firebird-php driver is only able to fetch forward. If you want to consult earlier rows, you will need to store them yourself in some form, or execute the query again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文