Jump to content

printing selected record from database


enid1horse

Recommended Posts

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.

???

Link to comment
https://forums.phpfreaks.com/topic/94589-printing-selected-record-from-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.