Here is a tricky one that im having issues with...

I have a page called events.php that has a include to query sql and pull events from the database after todays date and include the artist information from a include file. here is the code. The events page has a include of events2.php...

$con = mysql_connect("hostname","username","password");
if (!$con)
  die('Could not connect: ' . mysql_error());

mysql_select_db("database", $con);
$today = date("Y-m-d");
$result = mysql_query("SELECT * FROM events where Date > '$today' limit 0,4");
   while ($row = mysql_fetch_array($result)) {
   echo "<?include ('";
   echo $row['IncFile'];
   echo "');?>";
   echo '<div class="clear"></div><BR>';

the above creates the name of the include file to include. And it does so when viewing the source code for event.php it shows the following

<?include ('events/Event-Showdown.inc');?><div class="clear"></div><BR>
<?include ('events/Event-TOW.inc');?><div class="clear"></div><BR>
<?include ('events/Event-Jamie-Davis.inc');?><div class="clear"></div><BR>
<?include ('events/Event-Postal-Monkey.inc');?><div class="clear"></div><BR>

However it doesnt show the data within such as below. all it shows is a blank. I would asume that insead of seeing the above code I should be seeing the below within the events.php what am i doing wrong.

<!-- Showdown -->
<? $thisevt = event('June 30th','Showdown','http://www.myspace.com/ShowdownOrlandoFL',
'Showdown plays Country music, and a little <br>sprinkle off Classic Rock here and there.<br>
Willy Bouton: Bass Guitar and Vocals
Danny Evans: Drums
Bill Posten: Keyboards
Billy Varnes: Lead Guitar and Vocals<br>
<em>Excerpt from the <a href="http://www.myspace.com/ShowdownOrlandoFL" target="new_frame">Showdown Website.</a></em>',
echo $thisevt;
<!-- END Showdown -->

Edited by azgold

5 Years
Discussion Span
Last Post by pritaeas

Well it got a little better. Now i get the following. and the error on line 20 is the

include "{$row['IncFile']}";

Warning: main(/Events/Events-Dan-Story-Band.inc) [function.main]: failed to open stream: No such file or directory in C:\Websites\www\Mysitename.com\www\concerts-events2.php on line 20

Warning: main() [function.include]: Failed opening '/Events/Events-Dan-Story-Band.inc' for inclusion (include_path='.;c:\php4\pear') in C:\Websites\www\Mysitename.com\www\concerts-events2.php on line 20

Edited by azgold


the include file exist in C:\Websites\www\Mysitename.com\www\events\Events-Dan-Story-Band.inc. So im not sure what is going on.


Failed opening '/Events/Events-Dan-Story-Band.inc'

The first slash points back to the webroot. So I think it is trying to open C:\Websites\www\events\Events-Dan-Story-Band.inc

Try removing the first slash.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.