Jump to content

Problem retrieving a link address from mysql to php because it has &


nightkarnation

Recommended Posts

Hey guys...when I retrieve from mysql with select function on php the following address...it gets cut off when the "&" appears...

Here is the link:

 

http://clickcashv2.webpower.com/Refer.dll?Acct=DIEGO22&url=http://blahblahblah&pclub=pinocho

 

And this is what I get when I echo it:

 

http://clickcashv2.webpower.com/Refer.dll?Acct=DIEGO22

 

How can I solve this??

 

Thanks a lot in advance!

The relevant code is ok...it works with any link...it just doesnt when it finds a: (&)

 

here is the code anyway:

 


if ($action == "shimmyList")
{


        $result = mysql_query("SELECT name, picture, votes, url_ FROM swebcam_shimmy ORDER BY `swebcam_shimmy`.`votes` DESC"); 
        $cant = 0; 
        while($row=mysql_fetch_array($result)){ 
            echo "name$cant=$row[name]&picture$cant=$row[picture]&votes$cant=$row[votes]&url_$cant=$row[url_]&"; 
            $cant++;
        }
        echo "cant=$cant";
}

Try this, I'm using mysql_fetch_assoc and the extract() method.

 

<?php

if ($action == "shimmyList"){
   

$result = mysql_query("SELECT `name`, `picture`, `votes`, `url_` FROM `swebcam_shimmy` ORDER BY `swebcam_shimmy`.`votes` DESC");
$cant = 0;
while($row=mysql_fetch_assoc($result)){
	extract($row);
	echo "name$cant=$name&picture$cant=$picture&votes$cant=$votes&url_$cant=$url&";
	$cant++;
}
echo "cant=$cant";
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.