Jump to content

a Little help please


scarface83

Recommended Posts

Hi,

 

at the moment this code is executed imediatly ,

<?php

	$query = mysql_query("SELECT tbl_colour.colour, absence_mgt.notes, absence_mgt.ID FROM tbl_colour,absence_mgt  WHERE absence_mgt.datestamp='$date' ") or die(mysql_error()); 



	$row = mysql_fetch_array( $query );
	$any_entry = $row["colour"];

			if($any_entry =="" OR $anye_ntry == "0") { require ('select_absence.php');
			unset($date); }
			else { echo $row['ID'], " " ,$row['notes']; }


mysql_close();	

?>

  how would i get it to run only if the link had been click , nb the link referes to the same file

 

here is the rest of the code

 

<?php

function gen_day_url($data,$day) {


			return "<a href=\"new_cal.php3?date=$data\">$day </a>";

}	
	require ('db_connect.inc');

	$query = mysql_query("SELECT tbl_colour.colour, absence_mgt.notes, absence_mgt.ID FROM tbl_colour,absence_mgt  WHERE absence_mgt.datestamp='$date' ") or die(mysql_error()); 



	$row = mysql_fetch_array( $query );
	$any_entry = $row["colour"];

			if($any_entry =="" OR $anye_ntry == "0") { require ('select_absence.php');
			unset($date); }
			else { echo $row['ID'], " " ,$row['notes']; }


mysql_close();	

?>

Link to comment
https://forums.phpfreaks.com/topic/44337-a-little-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.