Campagne Id

Gestart doorMitchels8 reacties44 weergaven

9 berichten · pagina 1 van 1

Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Van site X haal ik advertenties af. Dit is een affiliate site. Er is daar ook een systeem die een bestandje van je site aanroept als de lead gekeurd is. In dat bestandje staat bij mij een query die iets in de db zet. Onder andere campagne id. Nu wil ik dat ik de campagne naam kan koppelen aan het campagne id. Want ik maak een pagina waarop het lid kan zien welke al zijn goedgekeurd. Maar vanaf die site kan ik alleen het campagne Id afhalen. Nu wil ik elk campagne id koppelen aan een naam, maar hoe doe ik dat? Ik vind het niet erg als ik die in de db moet zetten (handmatig).

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../_include.php[/COLOR][COLOR= #007700]);[/COLOR]
design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Referrals[/COLOR][COLOR= #007700]);[/COLOR]
check_login[COLOR= #007700]();[/COLOR]
?>
<h2>Goedgekeurde Acties</h2>
<table width="100%">
<tr><td><strong>Campagne ID</strong></td><td><strong>Vergoeding</strong></td><td><strong>Datum</strong></td><td><strong>Uitbetaald &euro;</strong></td><td width="50"><strong>VIP</strong></td></tr>
[COLOR= #0000BB]<?
$top2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM `acties` WHERE user = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" ORDER BY date DESC"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$top1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top2[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top1[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vip[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]yes[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$actief[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<strong><font color="green">Ja</font></strong>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$actief[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<strong><font color="red">Nee</font></strong>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vergoeding[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]date[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uitbetaald2[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$actief[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</td></tr>[/COLOR][COLOR= #007700];
}[/COLOR]
?>
</table>
[COLOR= #0000BB]<?[/COLOR]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]1[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
cid in de tabel acties is je campagne id?
In welke tabel staat de campagnenaam, en hoe heet die kolom?
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Cid is campagne idwinkcampagne heet de tabalen
De kolommen zijn:
cid
naam
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Dan moet je deze query hebben denk:
SELECT
    a.vip,
    a.cid,
    a.vergoeding,
    a.date,
    a.uitbetaald2,
    
    c.naam
FROM
    acties a,
    campagne c
WHERE
    c.id = a.cid
AND
    user = ".$_SESSION[user]."
ORDER BY
    date
DESC


en dan kun je met $top[naam] de naam van de campagne gebruiken.
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hmm hij geeft ze niet weer confusedhttp://kliklinks.nl/leden/gacties1.php
De code

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../_include.php[/COLOR][COLOR= #007700]);[/COLOR]
design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Referrals[/COLOR][COLOR= #007700]);[/COLOR]
check_login[COLOR= #007700]();[/COLOR]
?>
<h2>Goedgekeurde Acties</h2>
<table width="100%">
<tr><td><strong>Campagne ID</strong></td><td><strong>Vergoeding</strong></td><td><strong>Datum</strong></td><td><strong>Campagnenaam</strong></td><td width="50"></td></tr>
[COLOR= #0000BB]<?
$top2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT
    a.cid,
    a.vergoeding,
    a.date,
 
    
    c.naam
FROM
    acties a,
    campagne c
WHERE
    c.id = a.cid
AND
    user = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"
ORDER BY
    date
DESC"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$top1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top2[/COLOR][COLOR= #007700]);
{[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vergoeding[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]date[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td>[/COLOR][COLOR= #007700];
}[/COLOR]
?>
</table>
[COLOR= #0000BB]<?[/COLOR]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]1[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Wat geeft ie dan nu weer als naam?

edit:
en je mist je while enzo..
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hij geeft totaal niets weer.
Die gaf een erroryummieWarning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/promotie/domains/kliklinks.nl/public_html/leden/gacties1.php on line 28
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Maak van dit:
eens dit:
$top1 = mysql_query($top2) or die(mysql_error());

en zet die while en dat hele stukje ook terug, anders werkt het sowieso niet; je moet alleen die query vervangen.
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankje voor je hulp LennardwinkHet werkt nu
c.id = a.cid
moest worden:
c.cid = a.cid
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren