Correct querry

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dinno2
Forum Newbie
Posts: 9
Joined: Sun Aug 11, 2002 10:25 am

Correct querry

Post 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
User avatar
gotDNS
Forum Contributor
Posts: 217
Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA

Post by gotDNS »

That doesn't seem like enough to work with there....eh?
ssand
Forum Commoner
Posts: 72
Joined: Sat Jun 22, 2002 9:25 pm
Location: Iowa

Post 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
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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
Post Reply