MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 13th, 2002, 05:57 AM
vlad_k vlad_k is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Croatia
Posts: 13 vlad_k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question MySQL - selecting particular row

Hello!

I cannot find any SQL reference that explains how to select a particular ROW from a table. I need to select a row by its order value, not a column value. Could anyone help?

Thanks.

Reply With Quote
  #2  
Old November 13th, 2002, 03:00 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I think...

I just fool around and copy code, but I think you need to decide how you are going to choose the row...is it a link a user chooses? How is it choosen? That matters for how you will call it from the database. I can give you more spacifics when you decide how you will initiate the query....

Example: I have a link page that calls spacific rows from the database according to the link, in this case it's newsletters. They choose the link, they get a new page with the newsletter. The newsletter was generated from a form another person created. So all the user gets is the link page ( full of links from the database ( as many as there are completed newsletters ) and the (rows) newsletters they choose to view.

The code for the link page is:


$result = mysql_query("SELECT * FROM newsletteremily",$db);
if ($myrow = mysql_fetch_array($result))
{ do {
echo "<p align=center>\n";
printf ("<a href= msemilynewsletter1.php?id=%s%s>%s</a><br>\n",$php_self,$myrow["id"],$myrow["date"]);
}
while ($myrow = mysql_fetch_array($result));
}
else {
echo "Sorry, no records were found.";
}

Hope this helps...
__________________
bow wow!

Reply With Quote
  #3  
Old November 14th, 2002, 01:27 AM
vlad_k vlad_k is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Croatia
Posts: 13 vlad_k User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Too much data?

Hello...

What I actually need is to select the particular RECORD. Thus
if I have 10 records in a table, I wish to select, for example, record no. 3, regardless of the values in columns.

I might do it with SELECT *, and fetch record by record in void until I hit the wanted record. But what worries me is the lenght of data transmitted from the MySQL server to the PHP script. For example if I have 2000 records, and wish to access record no. 1356, the previous solution would be too expensive. Furthermore
I have BLOBs in the records...

So is there anything like SELECT * FROM table WHERE table.row=1356; ?

Thanks in advance!

Reply With Quote
  #4  
Old November 14th, 2002, 01:40 AM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
What I gave was..

What I gave was not the solution you were looking for. what I gave would give all records in database with a link to display the record on a new page, however you would want it displayed ( another page in itself).

to show what you are asking... yes I've seen the code, just don't have any code on me now, wrong computer.

Hang in there, help is on the way. I'm stuck on another computer for a few days and am lost without my other computer, can just surf web.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > MySQL - selecting particular row


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek