FAQ
•
Search
•
User Groups
•
Forum Admins
•
Smilies List
•
Statistics
•
Rules
•
Login
•
Register
H
ome
FAQs
L
inks
N
ews
Online Tools
phpBB
Scripts
T
utorials
A
bout us
C
ontact us
Contribute
Credits
Link to us
How do I put a http Link inside a PHP code?
Forum Index
»
Server-Side Coding
Author
Message
I_Need_PHP_Help
Junior WebHelper
Joined: 19 Jan 2005
Posts: 1
Location: London
Posted: Wed Jan 19, 2005 7:34 pm (19 years, 3 months ago)
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
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
Forum Index
»
Server-Side Coding
Jump to:
Select a Forum
» 4WebHelp
Announcements
Our Site: Feedback & Questions
» General
Chit Chat
Freedom2Surf
Advertisements
» Support
General
Website Reviews
Client-Side Coding
Server-Side Coding
Databases
Web Servers
Hosting & Domain Names
Graphics & Flash
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.124969 seconds :: 18 queries executed :: All Times are GMT
Powered by
phpBB
2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme