Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to build a dinamic link...
Hi there!!!
This is one of my first postings to this list. I spend most of the time read
ing the postings, but now I need to ask:
How to build a link dinamicly from an output of a query to a web page?

Much clearly. I need that certain user can upload a text content into the we
b site. It doesn´t have to be made in a web format or design, it would be en
ough as a simple text. To do this I provide him with a form based in a datab
ase.  That content will be save directly into a database (MySQL). There are 
other web page made in PHP that using a query will show the new text introdu
ced by the user. The matter is that the user will introduce diferent content
s on a diferent subjects, that is why I need that a link is generated authom
aticly pointing to each web page that has being updated by that user. Taking
 into account that each new text is referenced as a row in the database. 

I thought that asking through the formulary for a name of the new link to th
e new content and then working with variables in a loop...... how to force a
 link to show up on a web page pointing to the propiate place authomaticly e
very time that a content is introduced for a new web page? 

I hope you understood my question.
Thank´s you all....

Regards....
Daniel...

NOTE: Please forgive my Englihs Grammar. I´m doing the best I can. I speak S
panish.



Report this thread to moderator Post Follow-up to this message
Old Post
Daniel A. Betancourt
12-27-04 08:55 PM


Re: How to build a dinamic link...
Hola,

I think what you want would be like  this:

Let's say your table has these fields:  id, title, authorID, category 
and article (which  is the text).

so the first query might be - SELECT id, title, category  FROM  myTable 
WHERE authorID = $myID

and you want to know how to present a list of his articles so the user 
can click one and  be taken to the detail page where they can see their 
article body, yes?

I assume you can run the query and display the results - so the only 
exotic thing here  is:

while ($row = mysql_fetch_array($result))
{
print "<tr><td><A HREF='detail.php?id=" . $row["id"] . "'>" .  
$row["title"] . "</A></td><tr>";
}

This  will produce a list of titles (in table rows) that are linked to 
a page called "detail.php" and each title will 'GET' on this page the 
id of that record with that title.  So make a page called "detail.php" 
that will display the body of an article given it's ID.

I've been kind of brief here - but if you need more details please ask.

Frank

On Dec 27, 2004, at 5:23 PM, php-db-digest-help@lists.php.net wrote:

> From: "Daniel A. Betancourt" <dabet@infosol.gtm.sld.cu>
> Date: December 27, 2004 2:25:11 AM PST
> To: <php-db@lists.php.net>
> Subject: How to build a dinamic link...
> Reply-To: "Daniel A. Betancourt" <dabet@infosol.gtm.sld.cu>
>
>
> Hi there!!!
> This is one of my first postings to this list. I spend most of the 
> time reading the postings, but now I need to ask:
> How to build a link dinamicly from an output of a query to a web page?
>
> Much clearly. I need that certain user can upload a text content into 
> the web site. It doesn´t have to be made in a web format or design, it 
> would be enough as a simple text. To do this I provide him with a form 
> based in a database.  That content will be save directly into a 
> database (MySQL). There are other web page made in PHP that using a 
> query will show the new text introduced by the user. The matter is 
> that the user will introduce diferent contents on a diferent subjects, 
> that is why I need that a link is generated authomaticly pointing to 
> each web page that has being updated by that user. Taking into account 
> that each new text is referenced as a row in the database.
>
> I thought that asking through the formulary for a name of the new link 
> to the new content and then working with variables in a loop...... how 
> to force a link to show up on a web page pointing to the propiate 
> place authomaticly every time that a content is introduced for a new 
> web page?
>
> I hope you understood my question.
> Thank´s you all....
>
> Regards....
> Daniel...
>
>  NOTE: Please forgive my Englihs Grammar. I´m doing the best I can. I 
> speak Spanish.
>


Report this thread to moderator Post Follow-up to this message
Old Post
Frank M Flynn
12-28-04 08:55 AM


Re: How to build a dinamic link...
Hi Frank:
Thank´s for answering. 

>I assume you can run the query and display the results 

Yes, I can run the query very well.

>- so the only exotic thing here is:
>
>while ($row = mysql_fetch_array($result))
>{ 
>print "<tr><td><A HREF='detail.php?id=" . $row["id"] . "'>" . $row["title"]
 . "</A></td><tr>";
>} 
>
>This will produce a list of titles (in table rows) that are linked to a page called
 "detail.php" and each title will 'GET' on this >page the id of that record with tha
t title. So make a page called "detail.php" that will display the body of an article
 given it's >ID.

In that page I assume that there is another query to SELECT body FROM a give
n table WHERE ID='$ID';
Isn't that so?

Regards...
Daniel...


Report this thread to moderator Post Follow-up to this message
Old Post
Daniel A. Betancourt
12-30-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:21 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.