Re: Shorting code

From: Date: Thu, 26 Oct 2000 02:38:47 +0000
Subject: Re: Shorting code
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22018@lists.php.net to get a copy of this message
On Thu, 26 Oct 2000, Gary wrote: > Hi, > There has to be a way of making these two line less verbose? > > echo > > "<tr><td>ID</td><td>Accepted</td><td>Username</td><td>Password</td><td>Email</td></tr>\n"; > > > printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s<td>/td><td>%s</tr>\n",$myrow["id"],$myrow["accepted"],$myrow["username"],$myrow["password"],$myrow["email"]); > > Thanks > Gary echo will make your second line a bit easier to understand, and if you combine that with extract() to get your field names direct from the result of mysql_fetch_Array it should be a bit tidier. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#22018) next »