Easy PHP Calendar - We really take care of your dates!


Go Back   Easy PHP Calendar > General Discussion > General Support

General Support Questions about using the Easy PHP Calendar. (Not installation or customizations)

Closed Thread
 
Thread Tools Search this Thread Display Modes

Adding another php/mysql program on the same page
Old 08-30-2004, 08:30 PM   #1
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default Adding another php/mysql program on the same page

The calendar works great and is fabulous. But I added to the same page another php program which accesses the same database (but different table) and now the list of events that appears below the calendar only shows the first letter of the Title. Everything else is fine including the mouseover which shows the entire Title. Coincidentally, my other table also has a field named Title.

Does anyone know -- do I have to have these two programs on separate pages or is there a way to have them both?

Thanks.
 

Old 08-30-2004, 08:32 PM   #2
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Can you post or PM me a link to your page?
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

link
Old 08-30-2004, 08:34 PM   #3
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default link

http://setonshrine.com/bulletin.php
 

Old 08-30-2004, 08:37 PM   #4
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default

Also, here is the same page but with just the calendar minus the other program. The titles come out fine.

http://setonshrine.com/calendar.php
 

Old 08-30-2004, 08:41 PM   #5
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Your demo page works as expected, so there must be something on that page causing this problem. What's interesting is that the variable that prints the event title is unset before the script ever executes so it should be blank.

Additionally, if I look at the next month, one of the events shows up correctly?

There is no function to limit the length of the title string, so I don't know what may be causing this. Let me ponder on this a bit...
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 08-30-2004, 08:47 PM   #6
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default

Brian, I just realized something. The only event on the calendar whose Title did not get cut off after the first letter is the Mass For Labor, a single event. All the other events are recurring. It must have something to do with that.
 

Old 08-30-2004, 08:49 PM   #7
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

What does this other script on the page do?
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 08-30-2004, 08:50 PM   #8
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default

Yes, that's it. I just changed the Feast of the Assumption from a Recurring Event to a Single Event and now the title displays in whole.
 

Old 08-30-2004, 08:51 PM   #9
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Quote:
Originally Posted by donmarvin
Yes, that's it. I just changed the Feast of the Assumption from a Recurring Event to a Single Event and now the title displays in whole.
What about a floating event? It uses the same variables as recurring events do...
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 08-30-2004, 08:53 PM   #10
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default

The other script is for the "News and Announcements". Any current News items in the database are displayed on the page before the calendar.
 

Old 08-30-2004, 08:59 PM   #11
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default

I just added a floating event for the first Sunday of October. Only the first letter of the title appears just as with the Recurring Events.
 

Old 08-30-2004, 09:02 PM   #12
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Add this just below the <?php line in showCalendar.php:

unset($title);

Does that help?
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 08-30-2004, 09:12 PM   #13
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default

It didn't work. If it's a conflict with the field names I can easily change the field name in the other program.

Is there something wrong with the code I used in the other program? It's my first attempt at PHP so it might not be right:

PHP Code:
<?php 
$connection
=mysql_connect(IIII,****,****); 
if (!
$connection) { 
echo 
"Could not connect to MySql server!"
exit; 

$db=mysql_select_db("setonshrine",$connection); 
if (!
$db) { 
echo 
"Could not select database"
exit; 

$today date("Y-m-d");
$sql="SELECT * FROM events WHERE expiry >= '$today' ORDER BY id"
$mysql_result=mysql_query($sql,$connection); 
$num_rows=mysql_num_rows($mysql_result); 
if (
$num_rows 0

 echo 
"<P class='olive2' align='left'>News and Announcements</p>";
 while (
$row=mysql_fetch_array($mysql_result)) 
 { 
  
$title=$row["title"]; 
  
$description=$row["description"];
  
$description2=$row["description2"];
  
$description3=$row["description3"];
  
$website=$row["website"];
  
$email=$row["email"];
  echo 
"<p class='grey'>&nbsp;&bull;&nbsp;&nbsp;&nbsp;<b>$title</b><p>";
  echo 
"<blockquote>$description</blockquote>";
  if (
$description2 != "")
   {
   echo 
"<blockquote>$description2</blockquote>";
   }
  if (
$description3 != "")
   {
   echo 
"<blockquote>$description3</blockquote>";
   }
  if (
$website != "" or $email != "")
   {
   echo 
"<blockquote>Further info:&nbsp;&nbsp;";
 
   if (
$website != "")
    {
    echo 
"<a href='$website' target=_blank>Website</a>&nbsp;&nbsp;";
    }
   if (
$email != "")
    {
    echo 
"<a href='mailto:$email'>Email</a>";
    }
   echo 
"</blockquote>";
   }
 }  
//while row
 
 
echo "<HR><BR>";
// if have results
mysql_close($connection); 
?>
 

Old 08-30-2004, 11:11 PM   #14
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

I don't see anything in there that would cause this...

Can you change the $title variable to something like $titlex?
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Perfect!
Old 08-31-2004, 06:02 AM   #15
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default Perfect!

It works perfectly now!

Thank you, Brian!
 

Old 08-31-2004, 09:04 AM   #16
donmarvin
Calendar User
 
donmarvin is offline
Join Date: Aug 2004
Posts: 20
Default

BTW, FYI, using unset($title); prevented me from being able to add any new events. An alert box would appear saying the title field was empty.
 
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Category plugin makes page disappear andrejak General Support 3 07-18-2005 01:30 PM
Multiple different calendars on the same page anthony General Support 6 04-07-2005 06:48 PM
Adding the calander to a existing php page cyberchick General Support 7 01-28-2004 04:11 AM
adding to html page badmix General Support 6 12-19-2003 06:26 PM



All times are GMT -4. The time now is 08:57 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2009 NashTech, Inc.

| Home | Register | Today's Posts | Search | New Posts |