473,503 Members | 11,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

row identifier

Hello!

I need advice on how to identify a row with particular field
value?

I have a table with 3 fields: id, title, date.

I need to know the order number for the row where
title=sometitle.
I need it for the $start variable in next query:

Code:
# make a query on a table in your database
// $start = ???;
$query = "SELECT * FROM table LIMIT $start,1";
$query_result_handle = mysql_query ($query)
or die ('The query failed! table_name must be a valid table
name that exists in the
database specified in mysql_select_db');

# make sure that we recieved some data from our query
$num_of_rows = mysql_num_rows ($query_result_handle)
or die ("The query: '$query' did not return any data");

print "The query: '$query' returned $num_of_rows rows of
data.<br>";

# use mysql_fetch_row to retrieve the results
$row = mysql_fetch_row ($query_result_handle);
print "The name is '$row[1]'";
What i am trying to acomplish is to get the data of the next row
of current row in which title = sometitle.
Any help/advice appreciated.

--
Vesna
http://forum.moljac.hr OBAVEZNO SKOKNITE!
__________________________________________________ _______________
Implementation is the sincerest form of flattery.
Jul 17 '05 #1
2 1883
I noticed that Message-ID: <4p********************************@4ax.com>
from VeSn@ contained the following:
I need advice on how to identify a row with particular field
value?

I have a table with 3 fields: id, title, date.

I need to know the order number for the row where
title=sometitle. But you don't have a field called order number
I need it for the $start variable in next query:

Code:
# make a query on a table in your database
// $start = ???;
$query = "SELECT * FROM table LIMIT $start,1";


I don't know what that $start is doing there.

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
Geoff Berrow <bl******@ckdog.co.uk> u comp.lang.php:
I need advice on how to identify a row with particular field
value?

I have a table with 3 fields: id, title, date.

I need to know the order number for the row where
title=sometitle.
But you don't have a field called order number


i do, but what when some rows are deleted?
I solved it using id>$start in query.
I need it for the $start variable in next query:

Code:
# make a query on a table in your database
// $start = ???;
$query = "SELECT * FROM table LIMIT $start,1";


I don't know what that $start is doing there.


to tell the query where to start :-)

it`s ok, I solved it.

--
Vesna
http://forum.moljac.hr OBAVEZNO SKOKNITE!
__________________________________________________ _______________
I came, I saw, I deleted all your files.
Jul 17 '05 #3

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

Similar topics

4
1658
by: Florian Preknya | last post by:
I work on building a metamodel from an UML diagram (serialized as xmi). There I have a class called Class that represents a class from the UML model. The Class has a name member and ininitially it...
7
2170
by: Kobu | last post by:
The code below isn't compiling for me (error message: conflicting types for 'total' - pointing to the extern declaration). Why wouldn't this work, since the types are different, the extern...
5
4113
by: Marc Gustafson | last post by:
This function is executed when a application file is double-clicked to open in a VC++ application. Specifically, this function is enabled by RegisterShellFileTypes () in the application's...
2
1823
by: VicVic | last post by:
Hello, I have an old project, built with VC++. Now need to be compiled in Visual Studio .Net 2003. The project is going to build a DLL. When i try to compile the project, i got the following...
0
1290
by: Laurent Deniau | last post by:
I know that everything related to OO is off topic here, but... I am designing a framework which allows to do OO in pure C, called COS (stands for 'C Object System' inspired by CLOS and...
7
3185
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the...
1
9284
by: mknoll217 | last post by:
I am recieving this error from my code: The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part identifier...
2
6191
by: Ken | last post by:
Hi, I have a form whose control source is a view from SQL server 2005 database. The view has a primary key that is a unique identifier field with keys generated by newid() function from SQL server...
0
955
by: Jeff | last post by:
I have been using a view state decoder utility to understand the contents of ViewState. In looking at the decoded contents of many aspx pages (from my own projects and from asp.net sites out on...
6
37999
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
0
7212
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,...
1
7017
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...
0
7470
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...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
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
3186
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
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
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 ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.