Jump to content

poojagirl

Members
  • Posts

    3
  • Joined

  • Last visited

poojagirl's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thank you. This helps explain a lot. Now, to figure out how to use cookies in PHP.
  2. Like I said, I am new to this, so don't want to make too many changes and cause some other issues. If by what you said, the variable $spkdate does not hold the value, then how is it that I get the (subsequent) echo statement working fine? Could this have something to do with the way the variable is passed into the "sql" variable/statement? The date format is set this way because it is put into the database that way. I don't want to change too many things all at once. Thanks.
  3. Hi there, I am new to PHP so need some help/set me in the correct direction towards debuging this issue. I am trying to extract some data from a MySQL database based on a date criteria and display on the web site. However, since I have the web and data server in PST, when the query is executed from someone in, say, GMT, then the results are for the previous day. So, below is a portion of my script where I am trying to set the "spkdate" variable based on the computer time, with "m/d/Y". This however does not work when setting the query for the "sql". The query returns no rows. For verification, I echoed the [spk]date to the web page and that works just fine. I need help setting the "sql" variable properly. What mistake am I making in concatenating the strings together? PS: '" is a single back quote (') followed by the double quote ("). "' is a closure for the above, double quote, followed by the single quote. "'" is a double quote, then a single and finally by the quoble quote. Thanks in advance for your help. $my_id=$get_id['id']; $my_date=$get_id['event_date']; $today = date("m/d/Y"); $spkdate='<script type="text/javascript"> { var d = new Date(); var numMonth = d.getMonth() + 1; var day = d.getDate(); var year = d.getFullYear(); var whole = numMonth + "/" + day + "/" + year;} document.write(whole) </script>'; $sql="select * from tbl_events where event_location='".$id."' and event_date='".$spkdate."'"; $query=mysql_query($sql); $count=mysql_num_rows($query); if($count!=0) { if($id=="Birthdays" || $id=="Weddings" || $id=="Memorials" || $id=="Anniversaries") { ?> <div class="ptext"><?php echo $id;?> on <?php echo $today;?></div><p><p> <?php } while($dypages=mysql_fetch_array($query)) { ?><tr><td><div class="ftext">My Date</div></td><td><?php echo $spkdate; ?></td></tr><tr><td><div class="ftext">Event:</div></td><td><?php echo urldecode($dypages['event_title']); ?></td></tr>
×
×
  • Create New...