nightkarnation Posted July 7, 2009 Share Posted July 7, 2009 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! Link to comment https://forums.phpfreaks.com/topic/165112-problem-retrieving-a-link-address-from-mysql-to-php-because-it-has/ Share on other sites More sharing options...
thebadbad Posted July 7, 2009 Share Posted July 7, 2009 Show us the relevant code. Link to comment https://forums.phpfreaks.com/topic/165112-problem-retrieving-a-link-address-from-mysql-to-php-because-it-has/#findComment-870646 Share on other sites More sharing options...
nightkarnation Posted July 7, 2009 Author Share Posted July 7, 2009 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"; } Link to comment https://forums.phpfreaks.com/topic/165112-problem-retrieving-a-link-address-from-mysql-to-php-because-it-has/#findComment-870649 Share on other sites More sharing options...
p2grace Posted July 7, 2009 Share Posted July 7, 2009 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"; } ?> Link to comment https://forums.phpfreaks.com/topic/165112-problem-retrieving-a-link-address-from-mysql-to-php-because-it-has/#findComment-870659 Share on other sites More sharing options...
nightkarnation Posted July 7, 2009 Author Share Posted July 7, 2009 p2grace, thanks a lot for your reply! Unfortunately is not working...its doing exactly the same thing, cutting the link at the same point. Any other ideas? Thanks again! Link to comment https://forums.phpfreaks.com/topic/165112-problem-retrieving-a-link-address-from-mysql-to-php-because-it-has/#findComment-870666 Share on other sites More sharing options...
p2grace Posted July 7, 2009 Share Posted July 7, 2009 Can you show the link output and the print_r() of the mysql results? Link to comment https://forums.phpfreaks.com/topic/165112-problem-retrieving-a-link-address-from-mysql-to-php-because-it-has/#findComment-870668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.