[thelist] Displaying MySQL Records Using PHP

Dan McCullough dan.mccullough at gmail.com
Fri Jan 28 07:24:10 CST 2005


Also there are sites where if you are more of a hands on learner you
can get snippets and examples to play with.

Google is a wealth of information if you only type. :)


On Fri, 28 Jan 2005 00:33:49 +0100, Richard Harb <rharb at earthling.net> wrote:
> I wonder if anyone bothers any more to read any kind of documentation before
> posting to any kind of list. I heard there are even books covering the very
> basics of just about any subject that take just an hour to read and understand
> from start to finish.
> 
> My interpretation of your question is that you have URLs in that field of yours.
> Like: www.example.com - maybe you even have the http:// part prepended.
> 
> So to make that nice collection of characters clickable I suggest to read up on
> the HTML spec, namely the A element (
> http://www.w3.org/TR/html4/struct/links.html ). And then on the php spec on how
> to manipulate strings ( http://www.php.net/manual/en/ref.strings.php ), maybe
> even advanced stuff like regex if simple string comparison doesn't suffice.
> Don't worry, it's also there in the documentation.
> 
> And there are plenty of well answered questions on this subject in the mailing
> list archives.
> 
> 
> -----Original Message-----
> From: Albert Shala
> Sent: Thursday, January 27, 2005, 11:02:00 PM
> > Here's the code:
> 
> > <?php
> > $connection = mysql_connect("localhost", "e_novative", "e_novative")
> > or die("Error connecting to database");
> > mysql_select_db("members", $connection);
> 
> > $result = mysql_query("SELECT * FROM members ORDER BY id",
> > $connection) or die("error querying database");
> > $i = 0;
> > while($result_ar = mysql_fetch_assoc($result)){
> ?>>
> > <tr <?php if($i%2 == 1){ echo "class='body2'"; }else{echo "class='body1'";}?>>
> > <td>
> > <?php echo $result_ar['name']; ?></td>
> > <td>
> > <?php echo $result_ar['email']; ?>
> > </td>
> > <td>
> > <?php echo $result_ar['website']; ?>
> > </td>
> > </tr>
> > <?php
> > $i+=1;
> > }
> ?>>
> 
> > Now the "website" part of my database contains actuall links, and i
> > want to have a loop that displays all these links, and of course each
> > link is different and the links will be different of course, to
> > external and internal sites.
> 
> > Thank You.
> 
> > Albert
> 
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list