Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pquery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
pquery
Commits
3460a986
Commit
3460a986
authored
Dec 10, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed affected_rows function in SQL plugin.
parent
64b6998e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
pquery.sql.php
pquery.sql.php
+1
-1
tests/sql.php
tests/sql.php
+2
-1
No files found.
pquery.sql.php
View file @
3460a986
...
@@ -169,7 +169,7 @@ class pQuerySql extends pQuery {
...
@@ -169,7 +169,7 @@ class pQuerySql extends pQuery {
function
affected_rows
()
{
function
affected_rows
()
{
$this
->
assert_execution
();
$this
->
assert_execution
();
return
is_resource
(
$this
->
result
)
?
mysql_affected_rows
(
$this
->
result
)
:
0
;
return
mysql_affected_rows
(
self
::
$link
)
;
}
}
/**
/**
...
...
tests/sql.php
View file @
3460a986
...
@@ -181,6 +181,7 @@ class pQuerySqlTest extends PHPUnit_Framework_TestCase {
...
@@ -181,6 +181,7 @@ class pQuerySqlTest extends PHPUnit_Framework_TestCase {
function
test_insert
()
{
function
test_insert
()
{
$insert
=
__sql
::
insert_row
(
'foo'
,
array
(
'bar'
=>
'test3'
))
->
execute
();
$insert
=
__sql
::
insert_row
(
'foo'
,
array
(
'bar'
=>
'test3'
))
->
execute
();
$this
->
assertTrue
(
$insert
->
result
);
$this
->
assertTrue
(
$insert
->
result
);
$this
->
assertEquals
(
1
,
$insert
->
affected_rows
());
}
}
/**
/**
...
@@ -190,7 +191,7 @@ class pQuerySqlTest extends PHPUnit_Framework_TestCase {
...
@@ -190,7 +191,7 @@ class pQuerySqlTest extends PHPUnit_Framework_TestCase {
function
test_delete
()
{
function
test_delete
()
{
$delete
=
__sql
::
delete
(
'foo'
,
array
(
'bar'
=>
'test3'
))
->
execute
();
$delete
=
__sql
::
delete
(
'foo'
,
array
(
'bar'
=>
'test3'
))
->
execute
();
$this
->
assertTrue
(
$delete
->
result
);
$this
->
assertTrue
(
$delete
->
result
);
$this
->
assertEquals
(
$delete
->
affected_rows
());
$this
->
assertEquals
(
1
,
$delete
->
affected_rows
());
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment