|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > best approach for this query? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|