hi i have this code which prints out from database but would like to have a line number some thing like num$ i tried let num$=0 let num$=num$+1 but not sure how to put it into code here is the code i have //Retrieves data from MySQL $data = mysql_query("SELECT * FROM members WHERE region='exchange' OR region='EXCHANGE/HIRE' or region='EXCHANGE' or region='HIRE'") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { //Outputs the image and other data Echo "<b>Name:</b> ".$info['name'] . " "; Echo "<b>Email:</b> ".$info['email'] . " <br>"; } ?> </p> <p><a href="javascript: window.print();">Print Out</a></p> <p><a href="index.php">Home</a> </p> </body> PHP: cheers Doug
//Retrieves data from MySQL $data = mysql_query("SELECT * FROM members WHERE region='exchange' OR region='EXCHANGE/HIRE' or region='EXCHANGE' or region='HIRE'") or die(mysql_error()); //Puts it into an array $i=1; //line one to start while($info = mysql_fetch_array( $data )) { //Outputs the image and other data echo "Line Number: " . $i; Echo "<b>Name:</b> ".$info['name'] . " "; Echo "<b>Email:</b> ".$info['email'] . " <br>"; $i++; //add one to $i for the next loop. This is the same as doing $i = $i+1; } ?> </p> <p><a href="javascript: window.print();">Print Out</a></p> <p><a href="./">Home</a> </p> </body> PHP:
how do you put a space between the fields not between the lines i tried Echo " "; but this did not work cheers Doug