Re: How to Retreive Web Links from MySQL to HTML ???

2002-11-25 Thread Michael T. Babcock
On Sat, Nov 23, 2002 at 04:37:01AM +0200, Octavian Rasnita wrote:
 I can do all the job with Perl, but if the link contains a ? sign, it is
 replaced by the string NULL in the MySQL database and the link stored will
 be something like:
 
Just look up $dbh-quote(...) in the documentation.

$URL = ;
$QUERY = INSERT INTO foo (bar) VALUES(.$dbh-quote($URL).);

(Or you can use prepare, which makes this even cleaner; exercise left to reader)
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




How to Retreive Web Links from MySQL to HTML ???

2002-11-22 Thread tmb
I want to store some web links in a MySQL db...

than later using PHP retreive them and put them on a
web page...

Does PHP have to do all the work here...

1 - fetch the url from the db
2 - fetch the link name from the db
3 - construct the html code to display it

or is there a better way?

thanks for any info - tmb


__
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How to Retreive Web Links from MySQL to HTML ???

2002-11-22 Thread Peter L. Berghold
On Fri, 2002-11-22 at 10:40, tmb wrote:
 I want to store some web links in a MySQL db...
 
 than later using PHP retreive them and put them on a
 web page...
 
 Does PHP have to do all the work here...
 

Personally I would use Perl to do this.. :-P :-)

Yeah... you're going to have to write an app for this. MySql just ain't
gonna do all that for ya.
-- 

Peter L. Berghold [EMAIL PROTECTED] -or- [EMAIL PROTECTED] 
Manager Unix Engineering,MT Sinai NYU (212) 659-1468  
For PGP public key send email to: [EMAIL PROTECTED] 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How to Retreive Web Links from MySQL to HTML ???

2002-11-22 Thread Paul DuBois
At 7:40 -0800 11/22/02, tmb wrote:

I want to store some web links in a MySQL db...

than later using PHP retreive them and put them on a
web page...

Does PHP have to do all the work here...

1 - fetch the url from the db
2 - fetch the link name from the db
3 - construct the html code to display it

or is there a better way?


Define better.  What's wrong with doing it as you suggest?



thanks for any info - tmb



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How to Retreive Web Links from MySQL to HTML ???

2002-11-22 Thread Michael T. Babcock
On Fri, Nov 22, 2002 at 07:40:26AM -0800, tmb wrote:
 Does PHP have to do all the work here...
 
 1 - fetch the url from the db
 2 - fetch the link name from the db
 3 - construct the html code to display it

Yes; what else had you imagined?

If you do it right, it will probably look something like:

UL
?php
$results = ...
while ($row = mysql_fetch_array($results))
{
?
LIA HREF=?php echo $row['href']; ??php echo $row['name']; ?/A/LI
?php
}
?
/UL

-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How to Retreive Web Links from MySQL to HTML ???

2002-11-22 Thread Octavian Rasnita
I have the same problem with inserting the links in MySQL using Perl.

I can do all the job with Perl, but if the link contains a ? sign, it is
replaced by the string NULL in the MySQL database and the link stored will
be something like:

http://www.server.com/cgi-bin/script.plNULLid=3

Do I need to put a backslash before all non word characters before inserting
the link into the database?

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: Michael T. Babcock [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 22, 2002 6:51 PM
Subject: Re: How to Retreive Web Links from MySQL to HTML ???


On Fri, Nov 22, 2002 at 07:40:26AM -0800, tmb wrote:
 Does PHP have to do all the work here...

 1 - fetch the url from the db
 2 - fetch the link name from the db
 3 - construct the html code to display it

Yes; what else had you imagined?

If you do it right, it will probably look something like:

UL
?php
$results = ...
while ($row = mysql_fetch_array($results))
{
?
LIA HREF=?php echo $row['href']; ??php echo $row['name'];
?/A/LI
?php
}
?
/UL

--
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php