Problem Solved!!
[PHP]"SELECT * from $table where day BETWEEN CURDATE() AND DATE_ADD(curdat e(),INTERVAL 7 day);"[/PHP]
Thanks for any help!
User Profile
Collapse
-
-
That worked to get everything out of the database but how do I then do the AND part - so I get todays info out and then the info for the next 7 days and nothing past the next seven days out?
So today I would want to see 2007-04-06 through 2007-04-13 info
tomorrow I would want to see 2007-04-07 through 2007-04-14 info
etc...
Thanks for the help so far!Leave a comment:
-
Date Calculation to select all data for a week
I need to output data for today and the following week.
Here is what I have:
[PHP]// Get all the data from the table
$result = mysql_query("SE LECT * FROM $table where curdate() >= day AND curdate() < DATE_ADD(curdat e(),INTERVAL 7 day);")
or die(mysql_error ());
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_arr ay( $result... -
Extra rows being put into database
When I refresh the page or every time I go to it, a blank row is inserted into the database. This can not happen as I'm then printing out all the contents of the database. How can I stop it?
index.php:
[PHP]
<?php include "header.php "; ?>
<td valign="top"><b r />
<a href="addAnnoun ce.php">Click Here</a> to enter an announcement. <br... -
addAnnounce.php
<?php
include "header.php ";
$DBhost = "localhost" ;
$DBuser = "E098575";
$DBpass = "177Jess#";
$DBName = "announcements" ;
$table = "main";
?>
<td align=top>
<form action="index2. php" method="post">H eading:<br /><textarea name="heading" cols="50"...Leave a comment:
-
Input not saving.
I have no clue why the data from the form isn't saving into the database. What am I doing wrong?
addAnnounce.php :
[HTML]<td align=top>
<form action="index2. php" method="post">H eading:<br /><textarea name="heading" cols="50" rows="10"></textarea><br /><br />Announcement:< br />
<textarea name="announce"...
No activity results to display
Show More
Leave a comment: