TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 04-22-2009, 05:15 PM   #1 (permalink)
The Wanderer
 
Join Date: Apr 2009
Posts: 19
Thanks: 9
shankar is on a distinguished road
Default php mysql month function?!!

I want to create php code to only display user to view only entries from a particular month, can anybody help me!!
this is the code i used; its not working .. can any1 fix it up.

php Code:
$get_month = '01'
$query = "SELECT * FROM stud_attendance WHERE username='$username',month(date)='$get_month'";
$result = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) == 0)
{
   header("Location:stud_no_attend.php");
}
else
{

    echo "<table border=1px cellpadding=3 width=430px>";
    while ($row = mysql_fetch_assoc($result))
    {
        echo "<tr>";
        echo "<td>" . $row['date'] . "</td>";
        echo "<td>" . $row['status'] . "&nbsp;&nbsp;</td>";
        echo "<td>" . $row['reason'] . "</td>";
        echo "</tr>";
    }
    echo "</table>";
}
__________________
--
Regards
Shankar

Last edited by Wildhoney : 04-22-2009 at 11:28 PM.
shankar is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a gallery class Tanax Advanced PHP Programming 25 02-19-2013 04:25 AM
Help on PHP MYSQL Forms Input deesudesu Absolute Beginners 1 03-20-2009 10:50 AM
[Tutorial] How to organize your classes | Part 1 Tanax Advanced PHP Programming 10 03-01-2009 10:08 PM
Error in connecting to MySQL via PHP EyeDentify MySQL & Databases 0 01-03-2008 01:06 PM
Safe MySQL Parse Function Wildhoney Script Giveaway 2 11-30-2007 11:34 PM


All times are GMT. The time now is 05:30 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design