Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old February 20th, 2004, 02:41 AM
jgs jgs is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 jgs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
best approach for this query?

hi,

im currently developing a web database for a conservation genetics company. on a few of the forms i have long textareas in the shape of collums that allow the input of multiple rows once the text input has been parsed for carriage returns (i know this is hazardous but theyre adamant). what im trying to write at the moment is a script to query the database and build a string to display if the user wishes to edit the data. the affected tables are:

PCRPosition(idPCRPosition(PK), PCRRun_idPCRRun(FK), Sample_idSample(FK), PCRPositionNum, PCRPositionAttributes)

SequencerLane(idSequencerLane(PK), PCRPosition_idPCRPosition(FK), SequencingRun_idSequencingRun, SequencingLaneNum, Sequence)

SequencingRun(idSequencingRun, various attribs......)

and this is my script:

$queryLane = "SELECT * FROM SequencerLane WHERE SequencingRun_idSequencingRun = "
. $idSequencingRun;

if(!($resultLane = @ mysql_query($queryLane, $connection)))
showerror();

$pcr = "";
$place = "";
$sample = "";

while($rowLane = mysql_fetch_array($resultLane))
{

$queryPCR = "SELECT * PCRPosition WHERE idPCRPosition = " .
$rowLane["PCRPosition_idPCRPosition"];

if(!($resultPCR = @ mysql_query($queryPCR,$connection)))
showerror();

$rowPCR = mysql_fetch_array($resultPCR);

$sample .= $rowPCR["Sample_idSample"];
$sample .= "r";
$place .= $rowPCR["PCRPositionNum"];
$place .= "r";
$pcr .= $rowPCR["PCRRun_idPCRRun"];
$pcr .= "r";
}

now were still waiting on our server to arrive, so im not even sure this script is correct - but im sure there must be a more effecient means of extracting the data with a single sql query. im just not sure how - or i cant quite picture how the data will be structured.

if anyone has the inclination to discuss this with me i would be very grateful indeed.

cheers

j

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > best approach for this query?


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT