Jump to content

what went wrong..


scarezekiel

Recommended Posts

ok so before this.. if there isnt description for the company..the logo cant be click..only can be clicked if there is description added..im confused..

 

 



<?
if(isset($_GET[ttid])) {
$ttid = $_GET[ttid];
}

$connection=mysql_connect("$server", "$username", "$password")
or die("Could not establish connection");
mysql_select_db($database_name, $connection)
or die ("Could not select database");


$query = "select master_event.* , 
(DATE_FORMAT(event_datefrom, '%d %M %Y')) as datefrom,
(DATE_FORMAT(event_dateto, '%d %M %Y')) as dateto,
ucase(event_name) as eventname
from master_event
where master_event.event_id = '$ttid '";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){
$eventname = $row['eventname'];
$eventdesc = $row['event_desc'];
//$companydescription = $row['company_description'];
$eventvenue = $row['event_venue'];
$eventfee = $row['event_fee'];
$datefrom = $row['datefrom'];
$dateto = $row['dateto'];

echo "<font color='#000000'  face='arial' ><b> $eventname </b> </font> <br>";
echo "<font color='#000000'  face='arial' ><i>Date</i> : $datefrom - $dateto <br>";
echo "<i>Venue</i> : $eventvenue <br>";

$querypstype = "SELECT DISTINCT master_pstype.pstype_id,  pstype_desc FROM master_pstype
		INNER JOIN master_psevent ON master_psevent.pstype_id= master_pstype.pstype_id
		where master_psevent.event_id = '$ttid'
		ORDER BY pstype_order";

$resultpstype=mysql_query($querypstype);
while($rowpstype = mysql_fetch_array($resultpstype)){
		$pstypeid = $rowpstype['pstype_id'];
		$pstypedesc = $rowpstype['pstype_desc'];
		echo "<br><font color='#8B3A3A' size='1' face='georgia' ><b><i>$pstypedesc</i></b></font> <br>";

		$queryps = "SELECT master_psevent.*, pstype_desc, company_name, company_link, company_description, logo_filename FROM master_psevent
				LEFT JOIN master_pstype ON master_psevent.pstype_id = master_pstype.pstype_id
				LEFT JOIN master_ps ON master_ps.ps_id = master_psevent.ps_id
				WHERE master_psevent.event_id = '$ttid' and master_pstype.pstype_id= '$pstypeid' 
				ORDER BY pstype_desc,company_name ";

		$resultps=mysql_query($queryps);
		while($rowps = mysql_fetch_array($resultps)){
			$companyname = $rowps['company_name'];
			$companyid = $rowps['ps_id'];
			$companylinkori = $rowps['company_link'];
			$companydescription = $rowps['company_description'];
			$logopath = $rowps['logo_filename']; 


			$describelink = "index.php?ttid=$ttid&content=describe&pstypeid=$pstypeid&psid=$companyid";

			echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\"></a>";
			?>

			<br>
		<?			
		}
		echo "<br>";
}

}



?>

 

 

im new..so to make it simple..the problem is ..i want it to be (if there is description = logo can be click, if no = otherwise)

Link to comment
Share on other sites

ok so before this.. if there isnt description for the company..the logo cant be click..only can be clicked if there is description added..im confused..

 

 



<?
if(isset($_GET[ttid])) {
$ttid = $_GET[ttid];
}

$connection=mysql_connect("$server", "$username", "$password")
or die("Could not establish connection");
mysql_select_db($database_name, $connection)
or die ("Could not select database");


$query = "select master_event.* , 
(DATE_FORMAT(event_datefrom, '%d %M %Y')) as datefrom,
(DATE_FORMAT(event_dateto, '%d %M %Y')) as dateto,
ucase(event_name) as eventname
from master_event
where master_event.event_id = '$ttid '";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){
$eventname = $row['eventname'];
$eventdesc = $row['event_desc'];
//$companydescription = $row['company_description'];
$eventvenue = $row['event_venue'];
$eventfee = $row['event_fee'];
$datefrom = $row['datefrom'];
$dateto = $row['dateto'];

echo "<font color='#000000'  face='arial' ><b> $eventname </b> </font> <br>";
echo "<font color='#000000'  face='arial' ><i>Date</i> : $datefrom - $dateto <br>";
echo "<i>Venue</i> : $eventvenue <br>";

$querypstype = "SELECT DISTINCT master_pstype.pstype_id,  pstype_desc FROM master_pstype
		INNER JOIN master_psevent ON master_psevent.pstype_id= master_pstype.pstype_id
		where master_psevent.event_id = '$ttid'
		ORDER BY pstype_order";

$resultpstype=mysql_query($querypstype);
while($rowpstype = mysql_fetch_array($resultpstype)){
		$pstypeid = $rowpstype['pstype_id'];
		$pstypedesc = $rowpstype['pstype_desc'];
		echo "<br><font color='#8B3A3A' size='1' face='georgia' ><b><i>$pstypedesc</i></b></font> <br>";

		$queryps = "SELECT master_psevent.*, pstype_desc, company_name, company_link, company_description, logo_filename FROM master_psevent
				LEFT JOIN master_pstype ON master_psevent.pstype_id = master_pstype.pstype_id
				LEFT JOIN master_ps ON master_ps.ps_id = master_psevent.ps_id
				WHERE master_psevent.event_id = '$ttid' and master_pstype.pstype_id= '$pstypeid' 
				ORDER BY pstype_desc,company_name ";

		$resultps=mysql_query($queryps);
		while($rowps = mysql_fetch_array($resultps)){
			$companyname = $rowps['company_name'];
			$companyid = $rowps['ps_id'];
			$companylinkori = $rowps['company_link'];
			$companydescription = $rowps['company_description'];
			$logopath = $rowps['logo_filename']; 


			$describelink = "index.php?view=describe&ttid=$ttid&pstypeid=$pstypeid&psid=$companyid";

			echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\"></a>";
			?>

			<br>
		<?			
		}
		echo "<br>";
}

}



?>

 

 

im new..so to make it simple..the problem is ..i want it to be (if there is description = logo can be click, if no = otherwise)

Link to comment
Share on other sites

You want to use an if to check if there is anything in descrtiption and then display on true, or not on false:

if(!empty($companydescription)){
echo "<a href=\"$describelink\" target=\"_blank\"><img src=".$logo_dir."/".$logopath." width=\"15%\"></a>";
}
else
{
echo "<img src=".$logo_dir."/".$logopath." width=\"15%\">";
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.