4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 How do I put a http Link inside a PHP code?
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
I_Need_PHP_Help
Junior WebHelper
Junior WebHelper


Joined: 19 Jan 2005
Posts: 1
Location: London

PostPosted: Wed Jan 19, 2005 7:34 pm (19 years, 3 months ago) Reply with QuoteBack to Top

Hello people,

I'm a NewB 2 PHP. Can anyone help me with this:

I have created a simple DB table using PostgreSQL with values in the table.

My PHP code to retrieve data is:

<?PHP
echo "<br><left><small>CONNECTION MESSAGES <br>";
echo "<ul>";
echo "<li>establishing connection with database</li>";
$conn = pg_Connect ("port=5432 dbname=abu user=ma401ak");
if (!$conn) {
echo "<li>connection to database failed</li>"
; exit; }
$result = pg_exec ($conn, "SELECT DISTINCT name
FROM staff
ORDER BY name");

if (!$result) {
echo "<li>an error has occured in getting data from
database</li>";
exit;}
echo "<li>connection to database ok</li>" ;
echo "<br></left></small></ul><hr>";
echo "<b>LIST OF STAFF<br><ol>";
for ($row = 0; $row < pg_numrows($result); $row++) {
$tuple = pg_fetch_array($result, $row);
echo "<li>" . $tuple["name"] . "</li>";

}
pg_Close($conn);
echo "</ul></b><hr>";
?>

Output looks like this:

CONNECTION MESSAGES

. establishing connection with database
. connection to database ok


--------------------------------------------------------------------------------
LIST OF STAFF

1. Dr What Ever
2. Dr Joe Blogs

Here what I can't do:

I want each staff to have an actual website link next to there name. So lets say:

1. Dr What Ever Vist My Home Page

Visit My home page should be a website link... Also is it possible have a BUTTON i.e: 'Visit My Home Page' as a button rather than just a link.

Both the button & Link solution will be most appreciated.

Thanks a Million
OfflineView User's ProfileFind all posts by I_Need_PHP_HelpSend Personal MessageMSN Messenger
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.206132 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme