getNumOfRows

Returns the number of rows for the most recent query.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

require_once 'dalmp.php';

$user = getenv('MYSQL_USER') ?: 'root';
$password = getenv('MYSQL_PASS') ?: '';

$DSN = "utf8://$user:$password".'@127.0.0.1/test';

$db = new DALMP\Database($DSN);

$rs = $db->FetchMode('ASSOC')->PGetRow('SELECT * FROM Country WHERE Region = ? LIMIT 1', 'Caribbean');

// output of print_r($rs);
Array
(
    [Code] => ABW
    [Name] => Aruba
    [Continent] => North America
    [Region] => Caribbean
    [SurfaceArea] => 193
    [IndepYear] =>
    [Population] => 103000
    [LifeExpectancy] => 78.400001525879
    [GNP] => 828
    [GNPOld] => 793
    [LocalName] => Aruba
    [GovernmentForm] => Nonmetropolitan Territory of The Netherlands
    [HeadOfState] => Beatrix
    [Capital] => 129
    [Code2] => AW
)

echo $db->getNumOfRows(); // return 1

Thanks Navicat for supporting Open Source projects.

Navicat



A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.

Donating helps ensure continued support, development and availability.

dalmp


comments powered by Disqus