By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

row identifier

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.