Jump to content

loop proplem


hyster

Recommended Posts

i have a query nested in another query that takes a var from the 1st query

the 1st var uses 1 table and takes nested uses a 2nd.

 

the 2nd var produces a onlick alert box with the query results.

 

it all works fine if theres an entry there is no entry for the nested var in which case the 1st var dosent display.

 

ive moved the } for the nested above the 1st query's results it puts the table header and returned data into the table header.

 

hope this makes sense as i lost myself writting this.

(the code for the onclick wont work as i posted it. i formatted it like that so it didnt extend the page).

 

Thanks

<td > </td>
<table  class="tableresult" align="center">
<tr class="tablehead1">
<td></td>
<td class="tdhdr" ><div align="center">Rsku</div></td>
<td class="tdhdr"> <div align="center">Osku</div></td>
<td class="tdhdr"> <div align="center">Make</div></td>
<td class="tdhdr"> <div align="center">Model</div></td>
<td class="tdhdr"> <div align="center">Recovery</div></td>
<?php
// Start looping rows in mysql database.
while( $rows=mysql_fetch_array($result) ) {   
$rows = array_map('strtoupper', $rows);   


?>
<?php


//row colours


if    ($rows['auth'] == 'YES' and $rows['location'] == 'SERVER'){ 
$bgc = "pass" ; } 

elseif($rows['auth'] == 'YES' and $rows['location'] == 'HDD'){ 
$bgc = "wait" ;  

}else{
$bgc = "fail"; }

?>

<?php

$src = $rows['rsku'];
$sql10="SELECT * FROM safesku where rsku='$src' ";
$result10=mysql_query($sql10);
while( $rows10=mysql_fetch_array($result10) ) { 
?>
<tr id="tabledata" class="<?php echo "$bgc"; ?>" onclick="alert('Recon Sku <?php  echo $rows10['rsku']; ?>\r
Origanal Sku<?php  echo $rows10['orsku']; ?>\r
Make <?php  echo $rows10['make']; ?>\r
MOdel <?php  echo $rows10['model']; ?>\r
Year <?php  echo $rows10['year']; ?>\r
Quarter <?php  echo $rows10['qtr']; ?>\r
Colour <?php  echo $rows10['colour']; ?>\r 
cpu <?php  echo $rows10['cpu']; ?>\r
Ram <?php  echo $rows10['ram']; ?>\r
hdd <?php  echo $rows10['hdd']; ?>\r
Graphics <?php  echo $rows10['gfx']; ?>\r
Graphics Ram <?php  echo $rows10['gram']; ?>\r
screen <?php  echo $rows10['screen']; ?>\r
Oparating System <?php  echo $rows10['os']; ?>\r
Odd <?php  echo $rows10['odd']; ?>\r')">
<td ><?php
$img=mysql_num_rows($result10);
if($img >= 1){ 
echo "$img";
echo '<img src="http://localhost/dsgi/images/info.jpg" width=25 border=0>';
}else{
echo "empty";
}

?>
</td>
<td  class="tdhdr">  <?php  echo $rows['rsku']; ?></td>
<td  class="tdhdr">  <?php  echo $rows['orsku']; ?></td>
<td  class="tdhdr">  <?php  echo $rows['make']; ?></td>
<td  class="tdhdr">  <?php  echo $rows['model']; ?></td>
<td class="tdhdr" >  <?php  echo $rows['recovery']; ?></td>
<p>
  
  <?php
}
}
}
}
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.