473,549 Members | 2,655 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("DELET E FROM auth WHERE
username='".$jm eno."' 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 3891
Wonder what happens if you do:

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

echo "Delete $count records.";

On Jul 26, 7:31 am, Milan Krejci <r...@mail.czwr ote:
function odstran($jmeno) {
$this->res=&$this->mdb2->query("DELET E FROM auth WHERE
username='".$jm eno."' 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('Ex tended');
$count = $db->extended->execParam('del ete from auth where username = ?
limit 1', array('.$|meno. '), null);

echo "Delete $count records.";

On Jul 26, 7:31 am, Milan Krejci <r...@mail.czwr ote:
>function odstran($jmeno) {
$this->res=&$this->mdb2->query("DELET E FROM auth WHERE
username='".$j meno."' 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
3437
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 have to check the number of rows before I use the sqlResult. How do I get the numbers of rows? Something like this:
1
1721
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 database and run a "select * from <table>" query. The language is below, taken essentially from the docs. the language does, well, nothing. it neither...
0
1320
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 user=scottauge password=mypassword"); and using a dsn:
2
6294
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 C:\php\PEAR\lib\MDB2.php on line 1921" My code is a simple submit processing form for a login page: <?php
2
2714
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 // Assume you have a valid DB handler ($dbh) already connected $result = false; if ( isset($_POST) && isset($_POST) ) { $username = $_POST;
2
1785
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
6446
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 idea why I get that message ? I followed example 2332 on PHP.net, but no luck. (http://www.php.net/ manual/en/function.sqlite-num-rows.php) Im...
3
6421
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 can't seem to track down (exact message is "MDB2 Error: unknown error"). I have an ObjectDAO class (which I'm creating via a factory) that extends...
0
1494
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 to use the PEAR MDB2 methods rather than mysqli. Everything still works fine with MySQL, but I have an odd problem when I test against MSSQL. Any...
0
7541
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7826
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5385
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5107
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3512
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1960
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 we have to send another system
1
1074
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
781
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.