Hi all,

I am trying to rotate adds that are from tradedoubler !!

I have created a mysql db as follows
id,add,link,title
and i can succesfully connect via a php include and rotate my query to show a different add each time the page loads

$sql = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 0, 1");

The problem im having is that add itself is not showing,
Im new to php, but im learning each day new coding skills.

I am yet to start using javascript.

Is there anyone here that could help with successfully calling a java script from a mysql database.

The format of the add from TD is as follows

******
<script type="text/javascript">
var uri = 'http://impgb.tradedoubler.com/imp?type(img)g(88888888)a(88888888)' + new String (Math.random()).substring (2, 11);
document.write('<a href="http://clkuk.tradedoubler.com/click?p=18710&a=88888888&g=88888888" target="_BLANK"><img src="'+uri+'" border=0></a>');
</script>
****************

I have tried using just the 'http://impgb.tradedoubler.com/imp?type(img)g(88888888)a(88888888)

if anyone could point me in the right direction and help me enhance my programming skills,

thanks
Lloyd

This is now solved, the problem was with spaces in the javascript when adding to the mysql DB -

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.