zimulis Posted August 20, 2009 Report Share Posted August 20, 2009 ir textdb file 1vertiba$2vertiba$3vertiba$4vertiba$5vertiba 12vertiba$22vertiba$32vertiba$42vertiba$52vertiba 13vertiba$23vertiba$33vertiba$43vertiba$53vertiba ir skripts ar ko es vinu lasu $fp = fopen('orders.php','r'); if (!$fp) {echo 'ERROR: Unable to open file.</table></body></html>'; exit;} while (!feof($fp)) { $line = fgets($fp, 1024); //use 2048 if very long lines list ($field1, $field2, $field3, $field4, $field5, $field6) = split ('/$', $line); echo ' <tr> <td>'.$field1.'</td> <td>'.$field2.'</td> <td>'.$field3.'</td> <td>'.$field4.'</td> <td>'.$field5.'</td> <td>'.$field6.'</td> </tr>'; $fp++; } fclose($fp); pirmais ieraksts ir unikalais ID. Ka var selektēt vienu db rindu tikai pēc ID nu cipa ka MYSQ SELECT From tabula WHERE id=$_get[id] Quote Link to comment Share on other sites More sharing options...
bubu Posted August 20, 2009 Report Share Posted August 20, 2009 Ieteiktu visu salikt asociatīvajā masīvā: $array[$field1] = array($field2, $field3, ...); Un tad attiecīgi vērsties pie masīva pēc atslēgas: print_r($array[$id]); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.