← Desenvolvimento

Ajuda Mysql com php!

Lida 5932 vezes

Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Ajuda Mysql com php!


Bem, passo a explicar,

Tenho um tabela numa base de dados chamada sites e esta tabela tem os seguintes campos, id | banner | link !  o que eu queria era criar um sistema em que ele fosse a bd e mostra-se na pagina o que eu quero!

Tipo deixo aqui o codigo com que eu tenho tentado fazer isso:

<?php
include"config.php";
$y = mysql_query("SELECT * FROM sites WHERE `id` = RAND(id)");
while($a = mysql_fetch_array($y)){
echo '<a href="'.$a["link"].'"><img src="'.$a["banner"].'" width="480" height="60" ></a>';
}
?>


ele vai a base de dados, copia o link e o banner e adiciona ao <a href="'.$a["link"].'"><img src="'.$a["banner"].'" width="480" height="60" > para fazer o codigo html, e agora a parte mais dificil é eu por este banner com o respectivo link, randonomico!


Alguem sabe o que tenho de fazer, alguem me pode ajudar? Eu queria fazer mais ao menos isto >>> http://publicidade.espelhodigital.com/show.php?uid=11&cat=1&size=468x60
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Se alguem te ajudar depois kero o scrtio :P
N havera por ai alguma coisa ja pronta?
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Citação de: "asturmas"
Se alguem te ajudar depois kero o scrtio :P
N havera por ai alguma coisa ja pronta?


pode ser que haja, mas eu quero é adaptar ao meu script www.designtuga.be
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Poix n sei..
Ja agr tens la bues referecencias..devias as apagar...
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Citação de: "asturmas"
Poix n sei..
Ja agr tens la bues referecencias..devias as apagar...


vou fazer isso apos criar este script!
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

ok.faxes bem :wink:
Offline

kebrus 
Membro
Mensagens 459 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

como ja respondi ao cenourinha por pm, amanhã deve ter alguma coisa, mas enquanto isso porque nao dão uma vista de olhos no sticky do morpheus..

http://forum.maistrafego.pt/index.php?topic=1100
Offline

morpheus 
Membro
Mensagens 1199 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 1000 Posts

olá! estarei aqui a ver alguma concorrência? :lol:
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

LOL
Nunca se sabe.. lol  :lol:
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Nada disso, apenas quero por o banner rotatorio em cima do site!
Offline

ViiPER 
Membro
Mensagens 1208 Gostos 1
Troféus totais: 29
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

porque não usas uma das 2 soluçoes neste topico: http://forum.maistrafego.pt/index.php?topic=52
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Porque ele ker por isso automaticamente adptando ao scritp dele..
EU por acaso kero te faxer concurencia loool
tou a brincar :lol:
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

<?php
include"config.php";
$y = mysql_query("SELECT * FROM sites ORDER BY RAND() LIMIT 1");
while($a = mysql_fetch_array($y)){
echo '<a href="'.$a["link"].'"><img src="'.$a["banner"].'" width="480" height="60" border="1"></a>';
}
?>


Bem é isso! Já consegui por a dar, agora é só upar para o servidor!

Tanks a todos que se esforçaram!
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

ta fixe..n te eskecas de tirar as referencias..