riapro una nuova discussione , perche avrei un problema che non riesco a saltarci fuori , vi spiego io da una funzione sempre tramite query estraggo il valore di tre tabelle sarebbe a dire, la primaria , e due secondarie , l estrazione la faccio tramite left join .
succede che : che estrae perfettamente i valori , soltanto che dove trova una tabella che si autoincrementa , e trova lo stesso id mi somma il template , per quanti id ci stanno. adesso succede che io ho messo limit 1 però non mi seleziona i dati nel select vi faccio vedereCodice PHP:
<select name="departmentassigned[]" multiple="multiple" size="5" class="rcwswiftselect" style="width: 170px;" >
<?php foreach ($deparassigned as $dep){
?>
<option value="<?php echo $dep['departid']; ?>" <?php if( $dep['departid'] == $row['departmentid']){echo'selected';}?> ><?php echo $dep['departname']; ?></option>
<?php }?>
</select>
<?
/* e questa e la query:*/
function ViewStaffFromId($staffid){
global $dbcore ;
$viewstaffid = $dbcore->getlist("select t. *,tass. departmentid ,tsign.signature from tech as t left join techassigns as tass on t.staffid = tass.staffid
left join techsignatures as tsign on t.staffid = tsign.staffid
where t. staffid = ".$staffid." limit 1");
if(!$viewstaffid)
{
return false;
}
return $viewstaffid;
}
?>

Rispondi quotando