enid1horse Posted March 5, 2008 Share Posted March 5, 2008 I have a form that passes info to db, then to another form with a drop down menu, when I try to print out a single record I get all records instead of the selected one. Code is: $fileName="assess1.file"; $fh= fopen( $fileName, 'r'); while ( ! feof($fh)) { $line = fgets( $fh, 2048 ); $line = trim ( $line ); $dataArray = explode("~",$line); if ( $line == $_POST['name'] ) { print $dataArray[0]." ".$dataArray[1]."<br />"; print $dataArray[2]." ".$dataArray[3]."<br />"; print $dataArray[4]." ".$dataArray[5]." ".$dataArray[6]."<br />"; print $dataArray[7]; } else { print $line."<br /><br />"; } } fclose( $fh); This has me and others going crazy. Any help would be greatly appriciated. ??? Quote Link to comment Share on other sites More sharing options...
uniflare Posted March 5, 2008 Share Posted March 5, 2008 debug ur vars, try: echo($line." - ".$_POST['name']."<br />\n"); if ( $line == $_POST['name'] ) { print $dataArray[0]." ".$dataArray[1]." "; hope this helps, Quote Link to comment Share on other sites More sharing options...
enid1horse Posted March 7, 2008 Author Share Posted March 7, 2008 I've solved the problem, Thanks for the help. Now I can get into my finals project, maybe graduate some day. 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.