In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hi i am very new to PHP so need some help ! > > i have a form which allows the user to put in 2 team names and then displays > them, at the moment it displays them side by side but i need to insert V > (versus) in the middle--how can i do that. > I am guessing it goes in the lines of the code below somewhere, This code > originally displayed someones input for --first name,last name and address > so i have adapted it. Is there anyway to have the 'address' field display a > set value as in a V , at the moment i have removed that part but the table > field is still there, i have just hidden the form input. > > > $result = mysql_query("SELECT * FROM teams",$db); > > while ($myrow = mysql_fetch_array($result)) { > > printf("<a href=\"%s?id=%s\">%s %s</a> \n", $PHP_SELF, $myrow["id"], > $myrow["teama"],$myrow["teamb"]);
I'm sure that printf and friends must be most confusing to those who don't come from a C background :-) I think something like this might work, and be a bit more comprehensible to a neophyte. $result = mysql_query("SELECT * FROM teams",$db); while ($myrow = mysql_fetch_array($result)) { extract($myrow); // allows you to access fields as $id, $teama etc // printf("<a href=\"%s?id=%s\">%s %s</a> \n", $PHP_SELF, $myrow["id"], // $myrow["teama"],$myrow["teamb"]); echo '<A HREF="'.$_SERVER{'PHP_SELF'}.'?id='.$id.'">' . "\n"; echo "$teama V $teamb</A>\n"; } -- Quod subigo farinam A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php