Page 1 of 1

Correct querry

Posted: Fri Aug 16, 2002 10:19 am
by dinno2
im sure this sounds dumb, I am trying to pull an email off a DB that just reads email, and not the address, but as an actual email hyperlink, i have tried several different methodes, to some degree of sucess, not not quite.
heres what i have so far

Code: Select all

if ($row = mysql_fetch_array($result)) {

do {
  print "<table>";
  print "<td class="cell"> $row&#1111;"name"]\n";
  print (" ");
  print "<a href="mailto:" .'$email'. "">Click here!</a>";
  print (" ");
  print "<td class="cell"> $row&#1111;"hub"]\n";
  print (" ");
  print ("<p>");
&#125; while($row = mysql_fetch_array($result));

&#125; else &#123;print "Sorry, no records were found!";&#125;

  include("footer.php"); 
?>
doesnt seem to work

Posted: Fri Aug 16, 2002 2:46 pm
by gotDNS
That doesn't seem like enough to work with there....eh?

Posted: Fri Aug 16, 2002 3:01 pm
by ssand
You could try this:

Code: Select all

if (mysql_num_rows($result))
  &#123;
    while ($row=mysql_fetch_array($result))
       &#123;
        print "<table>"; 
        print "<td class="cell"> $row&#1111;"name"]\n"; 
        print (" "); 
        print "<a href="mailto:" .'$email'. "">Click here!</a>"; 
        print (" "); 
        print "<td class="cell"> $row&#1111;"hub"]\n"; 
        print (" "); 
        print ("<p>"); 
        &#125;
   &#125;
else &#123;print "Sorry, no records were found!";&#125; 

include("footer.php"); 
?>
Steve

Posted: Fri Aug 16, 2002 3:02 pm
by hob_goblin
first off change

Code: Select all

print "<a href="mailto:" .'$email'. "">Click here!</a>";
to

Code: Select all

print "<a href="mailto:" .$email. "">Click here!</a>";
variables wont be proccessed if they are encased in single quotes