Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
beginners trouble with php
#1
Hi,

I'm new to cms systems, so i'm trying to figure out how everything works.

On my website I have a php script.
http://www.festivalstegendierenleed.nl/t...or-pagina/


But somehow when I echo the output from the following script, it only shows what you see on the link above.

The script should show a few companies who help our organisation.

So somehow the script does not echo the variables. But the system is reading the script, if I make an error in the Query he will report that.[/php]

When I use the script on a normal website it works fine.

PHP Code:
<?php

$connection 
mysql_connect("localhost""***""***"true) or die(mysql_error()); 
$db =mysql_select_db('***'$connection) or die(mysql_error());

$goldsponsors ='';
$silversponsors ='';
$bronssponsors ='';

$sponsorqry "
                        SELECT
                                sponsors.logo,
                                sponsors.waarde,
                                bedrijven.naam,
                                sponsors.linknaam,
                                bedrijven.website,
                                bedrijven.bedrijfsnummer
                        FROM
                                sponsors
                        INNER JOIN
                                bedrijven
                        ON
                                sponsors.bedrijf=bedrijven.bedrijfsnummer
                        WHERE
                                bedrijven.taal='"
.$lang."'
                        ORDER BY
                                sponsors.waarde DESC
                            "
;
                        
$sponsorsqlmysql_query($sponsorqry);

if(
$sponsorsql === false)
{
 echo(
"Er ging iets fout met de query: ".mysql_error($connection)." (".$sponsorqry.")");
}
else
{    
    WHILE (
$sponsor mysql_fetch_array($sponsorsql))
    {
$sponsorlogo ='<div id="sponsorslogo"><a href="http://'.$sponsor['website'].'"rel="external" title="'.$sponsor['naam'].'"><img src="/logos/'.$sponsor['logo'].'.jpg" height="80" width="80" alt="'.$sponsor['naam'].'" /></a></div>';
$sponsornaam ='.<div id="sponsorsnaam"><a href="http://'.$sponsor['website'].'"rel="external" title="'.$sponsor['naam'].'">'.$sponsor['naam'].'</a></div>';

        if(
$sponsor['waarde']>=10)
        {
$goldsponsors.= 
$sponsorlogo
.$sponsornaam;

$sponsorsocialqry    "
                        Select
                                link,
                                soort_social
                        FROM
                                bedrijvensocial
                        WHERE
                                bedrijfsnummer = '"
.$sponsor['bedrijfsnummer']."'
                        ORDER BY
                                soort_social"
;
                                
$sponsorsocialsqlmysql_query($sponsorsocialqry$connection);

            if(
$sponsorsocialsql === false)
            {
             echo(
"Er ging iets fout met de query: ".mysql_error($connection)." (".$sponsorsocialqry.")");
            }
            elseif(
mysql_num_rows($sponsorsocialsql) == 0)
            {
$goldsponsors.='
<div id="sponsorsocial">&nbsp;</div>'
;
            }
            else
            {    
                WHILE (
$sponsorsocial mysql_fetch_array($sponsorsocialsql))
                {
$goldsponsors.='
<div id="sponsorsocial">'
;            
                    if(
$sponsorsocial['soort_social'] == 1)
                    {
$goldsponsors.='
<a href="https://www.facebook.com/'
.$sponsorsocial['link'].'" alt="'.$sponsor['naam'].'">facebook</a>';
                    
                    }
                    elseif(
$sponsorsocial['soort_social'] == 2)
                    {
$goldsponsors.='
<a href="https://www.twitter.com/'
.$sponsorsocial['link'].'" alt="'.$sponsor['naam'].'">twitter</a>';
                    }
                }
$goldsponsors.='
</div>'
;    
            }        
        }
        elseif(
$sponsor['waarde']>=5)
        {
$silversponsors.= 
$sponsorlogo
.$sponsornaam;
        }
        elseif(
$sponsor['waarde']>=1)
        {
$bronssponsors.=
$sponsornaam;
        }
    }
}
echo 
'Gold sponsors
'
.$goldsponsors.'
Silver sponsors
'
.$silversponsors.'
Brons sponsors
'
.$bronssponsors;
?>
Reply


Messages In This Thread
beginners trouble with php - by J.S. Coolen - 2013-06-14, 23:49:06
RE: beginners trouble with php - by J.S. Coolen - 2013-06-15, 01:05:53
RE: beginners trouble with php - by Connie - 2013-06-15, 16:08:30
RE: beginners trouble with php - by J.S. Coolen - 2013-06-15, 16:25:02



Users browsing this thread: 1 Guest(s)