473,498 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

troubles with mdb2's numRows() function

function odstran($jmeno) {
$this->res=&$this->mdb2->query("DELETE FROM auth WHERE
username='".$jmeno."' LIMIT 1");
if (PEAR::isError($this->res)) die($this->res->getMessage());
//var_dump($this->res);
//echo $this->res->numRows();
//if ($this->res->numRows()==1) echo ('<p>Uzivatel odstranen</p>');
////////////////////BUG ^^^
}

it should return 0 or 1 but it is NULL. the record has been deleted
allright but numRows() doesn't return anything even if nothing has been
deleted.
Jul 26 '07 #1
2 3878
Wonder what happens if you do:

$db->loadModule('Extended');
$count = $db->extended->execParam('delete from auth where username = ?
limit 1', array('.$|meno.'), null);

echo "Delete $count records.";

On Jul 26, 7:31 am, Milan Krejci <r...@mail.czwrote:
function odstran($jmeno) {
$this->res=&$this->mdb2->query("DELETE FROM auth WHERE
username='".$jmeno."' LIMIT 1");
if (PEAR::isError($this->res)) die($this->res->getMessage());
//var_dump($this->res);
//echo $this->res->numRows();
//if ($this->res->numRows()==1) echo ('<p>Uzivatel odstranen</p>');
////////////////////BUG ^^^
}

it should return 0 or 1 but it is NULL. the record has been deleted
allright but numRows() doesn't return anything even if nothing has been
deleted.

Jul 26 '07 #2
thanks mate! now it works, only
array('.$|meno.')
should be array($jmeno)
petersprc napsal(a):
Wonder what happens if you do:

$db->loadModule('Extended');
$count = $db->extended->execParam('delete from auth where username = ?
limit 1', array('.$|meno.'), null);

echo "Delete $count records.";

On Jul 26, 7:31 am, Milan Krejci <r...@mail.czwrote:
>function odstran($jmeno) {
$this->res=&$this->mdb2->query("DELETE FROM auth WHERE
username='".$jmeno."' LIMIT 1");
if (PEAR::isError($this->res)) die($this->res->getMessage());
//var_dump($this->res);
//echo $this->res->numRows();
//if ($this->res->numRows()==1) echo ('<p>Uzivatel odstranen</p>');
////////////////////BUG ^^^
}

it should return 0 or 1 but it is NULL. the record has been deleted
allright but numRows() doesn't return anything even if nothing has been
deleted.

Jul 27 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3430
by: Robert Fritz | last post by:
Hello, i'm using pear (for the first time). the function "numRows" (Win XP SP2 , IIS, MS ACCESS) gives me always the value "-1" (= the ErrrorObject) - although the sqlResult contains data. I...
1
1718
by: Swincher | last post by:
Hey - - -- --- --- - -- - Any data folks out there? I have started investigating the use of MDB2 for a data object. So far, it is winning the struggle... I am just trying to connect to a...
0
1308
by: scottauge | last post by:
I cannot for the life of me get a connection using MDB2 to a PostgreSQL 8.1 database. I can get a connection just fine using: $db = pg_connect ("host=localhost port=5432 dbname=subscriber...
2
6290
by: salvadorvp | last post by:
Hi, I have the following code that gives me this odd error message at a line of code inside the PEAR libraries: "Fatal error: Call to undefined function: MDB2_Driver_mssql::getMessage(). in...
2
2707
by: salvadorvp | last post by:
Hi, I wonder If somebody has experience this or could point me in the right direction: I have the following script (commented out just to use the username): // Check username and password //...
2
1777
by: Sal | last post by:
I have error_reporting set at E_ALL | E_STRICT and get 35 Strict Standards notices every time I load MDB2. Is this something to be concerned about, and is this typical of other PEAR packages?
4
6441
by: Kim | last post by:
I keep getting "function not defined" when trying to get a result count on my queries ("numRows()") and dont see a bug report on PHP.net on this matter. And yes, my queries DO have results. Any...
3
6404
by: Rob Wilkerson | last post by:
Hey all - I'm bumping into an issue with my installation of the MDB2 package that I'm hoping someone else has seen. I'm trying to execute a query, but get an "unknown error" exception that I...
0
1480
by: exclaim | last post by:
Apologies if this is not the right forum. I have an application written originally to work with MySQL which now has to be extended to work with MSSQL also. I have modified all my database calls...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.