4 Replies - 616 Views - Last Post: 31 March 2010 - 08:52 PM Rate Topic: -----

#1 ninethousandfeet@msn.com  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 310
  • Joined: 09-February 09

Blank page caused by mysql/php

Posted 31 March 2010 - 12:00 AM

Not sure what is going on here, but if I try to access the page, it's blank. I've tried playing around with it and nothing seems to work. This is supposed to simply check the user's city (the session) and also if there are any events listed for today (the current day).

Any ideas?

$eventcity_getEvent = $_SESSION['city'];
$eventdate_getEvent = date("m/d/y");
mysql_select_db($database_connUser, $connUser);
$query_getEvent = sprintf("SELECT event_id, name, street, city, phone, email, website, contact, review, date, dateofevent, DATE_FORMAT(dateofevent, '%%m %%d, %%y') AS us_format FROM eventTAB WHERE dateofevent = '".$eventdate_getEvent."' AND city = '".$eventcity_getEvent."'", GetSQLValueString($eventdate_getEvent, "text"), GetSQLValueString($eventcity_getEvent, "text"));
$getEvent = mysql_query($query_getEvent, $connUser) or die(mysql_error());
$row_getEvent = mysql_fetch_assoc($getEvent);
$totalRows_getEvent = mysql_num_rows($getEvent);

...

<h6>Today's events in <?php $_SESSION['city'];?></h6>
<?php if ($totalRows_getEvent) > 0) { ?>
<?php do { ?>
<ul class="rt">
<li><div id="ltBox">Event</div><div id="rtBox"><a href="/viewEvent.php?event_id=<?php echo $row_getEvent['event_id'];?>"><?php echo $row_getEvent['name'];?></a></div></li>
<li><div id="ltBox">Where</div><div id="rtBox"><?php echo $row_getEvent['street']; ?></div></li>
<li><div id="ltBox">What</div><div id="rtBox"><?php echo $row_getEvent['review']; ?>&nbsp;<a href="/viewEvent.php?event_id=<?php echo $row_getEvent['event_id'];?>">(more)</a></div></li>
</ul>
<?php } while ($row_getEvent = mysql_fetch_assoc($getEvent)); ?>
<p><b>Want to add an event?</b> <a href="/advertise">Click here</a>.</p>

<?php } else { ?>

<p>Urbhub makes it easy to add local events, just <a href="/advertise">click here</a>.</p>

<?php } ?>



Thanks for taking a look!
Brad

Is This A Good Question/Topic? 0
  • +

Replies To: Blank page caused by mysql/php

#2 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: Blank page caused by mysql/php

Posted 31 March 2010 - 12:49 AM

Is error reporting mistakenly turned off?

If you're not sure, or if it is, try adding error_reporting(E_ALL); to the start of the script and see if any errors show up.
Was This Post Helpful? 0
  • +
  • -

#3 Chopster  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 134
  • Joined: 29-March 08

Re: Blank page caused by mysql/php

Posted 31 March 2010 - 09:23 AM

perhaps its because you have two closing brackets on your if statement yet only one opening bracket?

your code:
<?php if ($totalRows_getEvent) > 0) { ?>


try changing it to:
<?php if ($totalRows_getEvent > 0) { ?>

Was This Post Helpful? 1
  • +
  • -

#4 ninethousandfeet@msn.com  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 310
  • Joined: 09-February 09

Re: Blank page caused by mysql/php

Posted 31 March 2010 - 11:23 AM

thanks for the help guys.... choster, that did it! i can't believe i missed that (that's what i get for trying to do this at 3 in the am)

cheers,
brad
Was This Post Helpful? 0
  • +
  • -

#5 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: Blank page caused by mysql/php

Posted 31 March 2010 - 08:52 PM

Ah, so it was a parse error. Thought it might be. Good catch, Chopster :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1