Results from Db outputted twice

Posted on 16th Feb 2014 07:03 pm by admin

Hey guys.. for come reason my data is outputted twise shown in the image below and i cant figure out why.

Code: [Select]<html>
<title>Month Summary</title>

<!-- change styles if you want -->
<style type="text/css">
p {font-family: georgia, verdana, sans-serif; font-size: 13px; color: #333333; }
h1 {font-family: georgia, verdana, sans-serif; font-size: 16px; color: #26618e; }
body {background-color: #fcfcfc;}



$mon = $_GET['mon']; // month from clicked month name
$month = intval($mon); // var to use with month name array
if (strlen($mon)==1) { $mon = "0". $mon; }
$yr = $_GET['yr']; // year from clicked month name

include("./lang/dat_nam_en.php"); // load default language file so as not to mess anything upp with new text.
include($dat_names); // retrieved from cal_parms.php as a 'language' file
mysql_connect($db_host, $db_login, $db_pass) or die ("Can't connect!");
mysql_select_db($db_name) or die ("Can't open database!");

$min_dat = $yr. "-". $mon. "-01";
$max_dat = $yr. "-". $mon. "-31"; //sloppy but effective

// retrieve all events for the month
$query = "SELECT * from $db_table WHERE (ev_dat>='$min_dat') AND (ev_dat<='$max_dat') ORDER by ev_dat";
$result = @mysql_db_query($db_name, $query);
echo "<table width='480' cellpadding='3' cellspacing='3' align='center' style='border: thin dotted #999999;' bgcolor='#f7f7f7'><tr><td>";

while ($myrow = mysql_fetch_array($result)) // loop through all results
$found = $myrow['ev_dat'];
$pieces = explode("-", $found);
$monum = intval($pieces[1]);
$danum = intval($pieces[2]);
echo "<h1>". $danum. " ". $mo[$month]. ", ". $yr. "</h1>";
echo "<p><strong>". $EventText. ":&nbsp;". $myrow['ev_title']. "</strong><br/>";
echo $LocationText. ": &nbsp;". $myrow['ev_locn']. "<br/>";
echo $DetailsText. "<br/>". nl2br($myrow['ev_desc']). "</p>";
if ($i==0) { echo "<h1>".$noEventsText." ". $mo[$month]. "</h1>"; }
if ($sho == "1") {
echo "<p align='right'><a href='javascript:self.close()'>".$closewindowText ."</a>";
else {
echo "<p align='right'>&laquo;&nbsp;<a href='javascript:history.go(-1)'>".$backToCalendar."</a></p>";
hopefully someone can see the reason why


No comments posted yet

Your Answer:

Login to answer
312 Like 42 Dislike
Previous forums Next forums
Other forums

How to form a xml form table with a single sql statement..?
Hi everyone,
I don't know if this is going to be a duplicate thread but i couldn't

Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing

Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out wh

help with database debug pls
Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/s/mesick/html/students/05/php/chec

Table control is disappearing from Screen
Hi Experts,

I have a screen with multiple table control(TC). Each table control has two c

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

help need on ob_start()

I am a newbie in php, I have a code
Line number On/Off | Expand/Contract <?phpo

Applet JTextField Size Problem

I recently started making an applet to calculate certain values for airplanes. However

Find occurences of unicode characters in string
I need to prohibit filenames with everything but English characters and numbers but regexp and strin

How to get variable value on next page
Hello friends
i am working on payentry page ..there i have this code.........

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS

Play Free Quiz and Win Cash