473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

mysql_data_seek follow up

This is a follow up to my last post. I've been working trying to
figure this out, to no avail. I've made it so that I could pass an
index down and use mysql_data_seek to force the database resource
pointer (the result resource) to the row that I want. But its not
working. This is the method:
/**
* 11-04-03 - it is important that the resource which points to the
returned dataset gets passed into this method
* by reference, not by copy, or else, in the outside code that is
calling this method, the pointer in that resource
* will never advance to the next resource row.
*/
function dsRowIntoArrayWithStringIndex(&$dsResult, $index=false) {
// 11-04-03 - this first lines test to see if anything came back
from the datastore
if (is_resource($dsResult)) {
$this->resultsObject->debugNotes("In
dsRowIntoArrayWithStringIndex(), in McFormatResultsMySql, the index is
' $index '. If it is numeric, we will try to use it as an index to
access the database return.");
if (is_numeric($index)) {
$success = mysql_data_seek($dsResult, $index);
if ($success) {
$this->resultsObject->debugNotes("In
dsRowIntoArrayWithStringIndex(), in McFormatResultsMySql, we
successfully set the database resource pointer to the index of
$index.");
} else {
$this->resultsObject->addToErrorResults("In
dsRowIntoArrayWithStringIndex(), in McFormatResultsMySql, we failed to
set the database resource pointer to the index of $index.");
}
}
$row = mysql_fetch_assoc($dsResult);
$row = $this->stripslashesFromEntryWithKeyIndex($row);
return $row;
} else {
$this->resultsObject->addToErrorResults("In
dsRowIntoArrayWithStringIndex(), in the class McFormatResultsMySql, we
expected the method to be handed a pointer to a database return
resource, but we were not.");
}
}


These are some of the error messages that my resultsObject is printing
out (the 3rd one is the failure message from the method above):

---------------------------------------------
In getRowAsArrayWithStringIndex(), in the class
McGetDatastoreResults, we were handed a resource pointer for a
database result, and will now hand it to mcgetdatastoreresultsmysql.
The index, if there is one, is ' 1 '.

In dsRowIntoArrayWithStringIndex(), in McFormatResultsMySql, the index
is ' 1 '. If it is numberic, we will try to use it as an index to
access the database return.

In dsRowIntoArrayWithStringIndex(), in McFormatResultsMySql, we failed
to set the database resource pointer to the index of 1.

In stripslashesFromEntryWithKeyIndex(), in the class
McFormatResultsMySql, we expected the method to be handed an array,
but it was not.
----------------------------------------------

The index, of course, is 0 during the first loop, 1 during the second
loop, and 2 during the 3rd loop. I'm coping and pasting these
particular error messages that get printed out during the second loop.

Again, when I use phpMyAdmin to run the same query, I get 3 returns.
Jul 17 '05 #1
0 1562

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

Similar topics

1
by: JS Bangs | last post by:
Yesterday, I ran into a problem that seems to stem from an unusual behavior of mysql_fetch_row() and mysql_fetch_assoc(). Specifically, I have a query that selects all of the id's of fields...
2
by: Joris Gillis | last post by:
Hi everyone, I have this nasty little problem to which I can't find a solution: Consider an anchor <a name="Top" id="Top">Top</a> How can I follow/execute this link from within javascript?...
1
by: oketz1 | last post by:
Hi I am writing an application very similar to notepad and I have to implement the status bar feature, which mean that I have to follow after the cursor is there any event that raised when...
3
by: MPR | last post by:
Hi guys; I'm using an AxSHDocVw.AxWebBrowser control to show a web page. I need to know if i can ( and how? ) i do the following things: 1 - I need to follow 1 link in the webpage diplayed...
0
by: Mikey | last post by:
This sample code demonstrates how to send an email message using CDO and have it set the Outlook Importance property and the Outlook Follow Up reminder attributes in the recipient's InBox. The...
0
by: Stephen Hynds | last post by:
Hi, I'm writing a VB app that sends mail to a number of users when an important deadline is approaching. I can get the mail to show up as high priority and I can even get it to have a follow up...
0
by: sherlockweb | last post by:
Does anyone know if there is a equiavalent method to the mysql_data_seek() function call to reset a result set in PDO?
0
by: woodglass | last post by:
I want to use object.hyperlink.Follow to follow a hyperlink to a web page. The web page requests a username & password. Can I programmatically supply both instead of having to type them in ?....
93
by: lorlarz | last post by:
Here, let's see what you JavaScript programmers have got Here is a place to share your large or larger full-blown JavaScript applications: real.comp.lang.js.apps (a new google group) Here is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.