RE: [PHP] Links with parameters in DB

2004-08-19 Thread Jay Blanchard
[snip]
$link=eval(mysql_result($result,$i,link));
[/snip]

Try just eval on the field you pull from the database...

echo eval($databaseItem) then work your processing.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Links with parameters in DB

2004-08-19 Thread Jay Blanchard
[snip]
$i=0;
$q=select * from links';
while ($imysql_num_rows($result))
  {
   $link=eval(mysql_result($result,$i,link));
.
.
 and then i put this:
[/snip]

What happens if you do this?

while($i  mysql_num_rows($result)){
$link = eval($result);
echo $link;
}


P.S. Please reply to the list too, I am quite busy and may not be able
to follow up.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Links with parameters in DB

2004-08-19 Thread WebMaster. Radio ECCA
It doesn´t work, I have other fields in the DB apart from the field 'Link',
so if I use
$link = eval($result);
I get a parse error. Apart from that, I have to write the name of the field
(link), if not the server won´t know the field I´m refering to.
Thanks

- Original Message - 
From: Jay Blanchard [EMAIL PROTECTED]
To: WebMaster. Radio ECCA [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, August 19, 2004 1:28 PM
Subject: RE: [PHP] Links with parameters in DB


[snip]
$i=0;
$q=select * from links';
while ($imysql_num_rows($result))
  {
   $link=eval(mysql_result($result,$i,link));
.
.
 and then i put this:
[/snip]

What happens if you do this?

while($i  mysql_num_rows($result)){
$link = eval($result);
echo $link;
}


RE: [PHP] Links with parameters in DB

2004-08-19 Thread Jay Blanchard
[snip]
It doesn´t work, I have other fields in the DB apart from the field 'Link',
so if I use
$link = eval($result);
I get a parse error. Apart from that, I have to write the name of the field
(link), if not the server won´t know the field I´m refering to.
[/snip]

Then did you eval that? I meant for you to use a proper rendering of the eval 
statement by itself, i.e.

$sql = SELECT * FROM table ;
$result = mysql_query($sql, $connection);

while($row = mysql_fetch_array($result)){
$link = eval($row['Link']);
echo $link;
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Links with parameters in DB

2004-08-19 Thread WebMaster. Radio ECCA
I tried what you said but i get an eval error:
  Parse error: parse error, unexpected '=' in /index.php(135) : eval()'d
code on line 1

  ;(
- Original Message - 
From: Jay Blanchard [EMAIL PROTECTED]
To: WebMaster. Radio ECCA [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, August 19, 2004 1:38 PM
Subject: RE: [PHP] Links with parameters in DB


[snip]
It doesn´t work, I have other fields in the DB apart from the field 'Link',
so if I use
$link = eval($result);
I get a parse error. Apart from that, I have to write the name of the field
(link), if not the server won´t know the field I´m refering to.
[/snip]

Then did you eval that? I meant for you to use a proper rendering of the
eval statement by itself, i.e.

$sql = SELECT * FROM table ;
$result = mysql_query($sql, $connection);

while($row = mysql_fetch_array($result)){
$link = eval($row['Link']);
echo $link;
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Links with parameters in DB

2004-08-19 Thread Jay Blanchard
[snip]
I tried what you said but i get an eval error:
  Parse error: parse error, unexpected '=' in /index.php(135) : eval()'d
code on line 1
[/snip]

You will probably have to escape the equals sign

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Links with parameters in DB

2004-08-19 Thread Jay Blanchard
[snip]
[snip]
I tried what you said but i get an eval error:
  Parse error: parse error, unexpected '=' in /index.php(135) : eval()'d
code on line 1
[/snip]

You will probably have to escape the equals sign
[/snip]

Have you RTFM on eval? http://www.php.net/eval

You have to use valid PHP code. Your stored code is currently not valid
if I read this correctly.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Links with parameters in DB

2004-08-19 Thread Matt M.
On Thu, 19 Aug 2004 14:01:45 +0100, WebMaster. Radio ECCA
[EMAIL PROTECTED] wrote:
 I tried what you said but i get an eval error:
   Parse error: parse error, unexpected '=' in /index.php(135) : eval()'d
 code on line 1
 
   ;(
 
 
 - Original Message -
 From: Jay Blanchard [EMAIL PROTECTED]
 To: WebMaster. Radio ECCA [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Thursday, August 19, 2004 1:38 PM
 Subject: RE: [PHP] Links with parameters in DB
 
 [snip]
 It doesn´t work, I have other fields in the DB apart from the field 'Link',
 so if I use
 $link = eval($result);
 I get a parse error. Apart from that, I have to write the name of the field
 (link), if not the server won´t know the field I´m refering to.
 [/snip]
 
 Then did you eval that? I meant for you to use a proper rendering of the
 eval statement by itself, i.e.
 
 $sql = SELECT * FROM table ;
 $result = mysql_query($sql, $connection);
 
 while($row = mysql_fetch_array($result)){
 $link = eval($row['Link']);
 echo $link;
 }
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
try this

eval(\$link = \$row[Link]\;);
echo $link;

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php