Hi All,

I am new in php and i am creating an application of attendence management where i have mark 'present' or 'absent'. I can do listing with the last column of two radio button 'A' or 'P' , user will select and then finally press submit.

Please tell how to achive this

My problem is solved thanks to DaniWeb Community !

SELECT * FROM tbl_book WHERE DATEDIFF(CURDATE(),fld_uploadedon) = 29
This query working fine

Guys please help me i dont know it is right or wrong.

Hi All, I am new in PHP and MySQL. As of now i am building a web application , where i have to get the list of all those clients whose date of joining - current date equals to 30. I have a table in database where there is a field fld_DOJ where i am saving date like this (2017/7/21). I simply want a query like this SELECT name FROM table WHERE ( SELECT fld_DOJ - current date = 30). I appreciate your response.

Hi All,

I want to do pagination in php can any one tell how to do this?

Hi All,

When i am trying to open any php file by Macromedia Dreamweaver 8, i am getting an error.
" Please reinstall your software"
A problem was detected with your application. Please reinstall this software to correct the problem"
I had reinstalled and installed it , but issue still persist.

Please guide me what to do?

SELECT fld_projectname,fld_projectline,fld_projectpunchline,fld_projectbestimage,fld_projecttype,fld_projectdesp, fld_projectfeature1,fld_projectfeature2,fld_projectfeature3,fld_projectfeature4,fld_locationmap,fld_googlemap, fld_sitemap,fld_projectimage1,fld_projectimage2,fld_projectimage3,fld_projectimage4,fld_projectimage5,fld_projecttype,fld_projectlocation FROM tbl_allproject WHERE fld_encryptname = '84db7b5d4ddff5fb9afffc07d5fe6669'

If i run this query i get desired results, but when i used the varialbes i m getting values of last entry of database.

I am always getting values of last row..plz guide me.

<?php 
$projectname = $_GET['type'];
echo $projectname;

include('config.php');
            $sql = "SELECT 
            fld_projectname,fld_projectline,fld_projectpunchline,fld_projectbestimage,fld_projecttype,fld_projectdesp,
            fld_projectfeature1,fld_projectfeature2,fld_projectfeature3,fld_projectfeature4,fld_locationmap,fld_googlemap,
            fld_sitemap,fld_projectimage1,fld_projectimage2,fld_projectimage3,fld_projectimage4,fld_projectimage5,fld_projecttype,fld_projectlocation

         FROM tbl_allproject WHERE fld_encryptname = '$projectname'";

        // echo $sql; exit;

            $rs = mysql_query($sql);
            if(mysql_affected_rows()>0)
            {
            while($row = mysql_fetch_array($rs))
            {
                $projectname = $row['fld_projectname'];
                $projectline = $row['fld_projectline'];
                $projectpunchline = $row['fld_projectpunchline'];
                $propertbestimage = $row['fld_projectbestimage'];

                $projectdesp = $row['fld_projectdesp'];
                $projectfeature1 = $row['fld_projectfeature1'];
                $projectfeature2 = $row['fld_projectfeature2'];
                $projectfeature3 = $row['fld_projectfeature3'];
                $projectfeature4 = $row['fld_projectfeature4'];

                @$projetlocationmap = $row['fld_locatonmap'];
                $projectgooglemap = $row['fld_googlemap'];
                $projectsitemap = $row['fld_sitemap'];
                $projectimage1 = $row['fld_projectimage1'];
                $projectimage2 = $row['fld_projectimage2'];
                $projectimage3 = $row['fld_projectimage3'];
                $projectimage4 = $row['fld_projectimage4'];
                $projectimage5 = $row['fld_projectimage5'];
            }   

            }
            else
            {
                header('location: 404.php');
            }

?>

Hi All,

I am developing a website in which i am selecting some values form database by a query When i am running query on PHPMyAdmin i am getting desired results but when i am using this query in actual PHP code, i am getting value of Last row. Can any one tell me , whats happening wrong?

Hi All,

I want to know how to write a php script that run in background in browser when anyone login.

Hi All,
I am developing a fee management system in which i want to view unpaid fee of students. Can any one guide me how to to do this in php. I need a logic. Please guide me.

Hi diafol,

i will change mysql to mysqli , but please guide me how to achive this task, i really appreciate you, please help me

Hi i am developing Attendence mgt sys. and i have to insert name,section,class,status in database of n number of students. I am able to do listing by the code below:

<?php
@session_start();
include('config.php');
$sessionName = $_SESSION['NAME'];
$sessionID = $_SESSION['UID'];

if($sessionName == "" && $sessionID == "")
{
    header('location:index.php');
}
    $class = $_REQUEST['class'];
    $section = $_REQUEST['section'];
    $_SESSION['class'] = $class;
    $_SESSION['section'] = $section;

    /*This is by me*/

    $infoArr = array();

    $sql = "SELECT tbl_name,tbl_gender,tbl_class,tbl_section FROM tbl_student_record WHERE tbl_class = '$class'            AND tbl_section = '$section'";       
    $res = mysql_query($sql);

    if(mysql_affected_rows() > 0){

        $i=0;

        while($row = mysql_fetch_array($res)){

            $infoArr[$i]['name'] = $row['tbl_name'];
            $infoArr[$i]['gender'] = $row['tbl_gender'];
            $infoArr[$i]['class'] = $row['tbl_class'];
            $infoArr[$i]['section'] = $row['tbl_section'];

            $i++;
        }

    }

    $count = count($infoArr);
    $newCount = $count - 1;
    ?>
    // HTML 

    <form action="submitAttendence.php" method="post"/>
            <input name="cnt" id="cnt" type="hidden" value="<?=$newCount;?>"/>
            <div>
                <div class="li-label" style="width:50px;">S.No.</div>
                <div class="sep"></div>
                <div class="li-label" style="width:250px;">Name</div>
                <div class="sep"></div>
                <div class="li-label" style="width:100px;">Student ID</div>
                <div class="sep"></div>
                <div class="li-label" style="width:50px;">Class</div>
                <div class="sep"></div>
                <div class="li-label" style="width:80px;">Section</div>
                <div class="sep"></div>
                <div class="li-label" style="width:100px;">Gender</div>
                <div class="sep"></div>
                <div class="li-label" style="width:100px;">Status</div>

            </div>

            <div class="cBoth"></div>
            <?php               
                if($newCount > 0){

                    for($i=0; $i<=$newCount; $i++){

                        $name = $infoArr[$i]['name'];
                        $gender = $infoArr[$i]['gender'];
                        $class = $infoArr[$i]['class'];
                        $section = $infoArr[$i]['section'];
            ?>

                <div class="vLine"></div>
                <div>
                <div class="li-txt" style="width:50px;"><?=$i;?></div>
                <div class="sep"></div>
                <div class="li-txt" style="width:250px;"><input type="hidden" id="name_<?=$i;?>" name="name_<?=$i;?>"/><?=$name;?></div>
                <div class="sep"></div>
                <div class="li-label" style="width:100px;"><input type="hidden" id="stud_<?=$i;?>" name="stud_<?=$i?>"/>Student ID</div>
                <div class="sep"></div>
                <div class="li-label" style="width:50px;"><input type="hidden" id="clas_<?=$i?>" name="clas_<?=$i;?>"/><?=$class;?></div>
                <div class="sep"></div>
                <div class="li-label" style="width:80px;"><input type="hidden" id="sec_<?=$i?>" name="sec_<?=$i?>"/><?=$section;?></div>
                <div class="sep"></div>
                <div class="li-txt" style="width:100px;"><input type="hidden" id="gen_<?=$i;?>" name="gen_<?=$i?>"/><?=$gender;?></div>
                <div class="sep"></div>
                <div class="li-txt" style="width:100px;">
                <select id="status_<?=$i;?>" name="status_<?=$i;?>"/>
                    <option value="Present" />Present</option>
                    <option value="Absent" />Absent</option>
                </select>               
                </div>
           </div>

            <div class="cBoth"></div> ...
<?php
include('config.php');
@session_start();
@$sessionName = $_SESSION['NAME'];
$date = date('d-m-y');
$loc = $_POST['locationID'];
@$name = $_POST['name'];
$status = $_POST['status'];
$class = $_POST['class'];
$section = $_POST['section'];
$i = 0;
while($i<count($loc)){
        $fname = mysql_real_escape_string($name[$i]);
        $sts = mysql_real_escape_string($status[$i]);
        $cls = mysql_real_escape_string($class[$i]);
        $sec = mysql_real_escape_string($section[$i]);
    $query = "INSERT INTO tbl_attendence ( 
       fld_studentname, fld_status, fld_class,fld_section,fld_date,fld_takenby)

        VALUES (
        '$fname',
        '$sts',
        '$cls',
        '$sec',
        '$date',
        '$sessionName'
            )
        "; 
    mysql_query($query);          
    $i++;  
}
if(mysql_affected_rows()>0){
    echo "Attendance Updated Successfully";
} else {
    echo "There was an error updating attendance.please contact with server admin or try again";
    echo "<br><br>Error: " . mysql_error();
    echo "<br><br>Query: " . $query;
} 
?>

Hi Maruff, I am not getting any value it is shwoing blank. Please guide me.

hi maruf22,

i am getting no values, however in $status , it is saving P,r,e as loop is running three time. Please help me Maruf..

how to build a value clause? Please guide me.

so what i have to do? please guide me

I m fetching some values from database , like this
<?=$name;?>
<?=$class;?>
<?=$section;?>
<?=$status;?>

And above is the php code which i am uing to insert these values, i am not getting any error but results are in not my favour, i am getting "Array","Array","Array" multiple times as per the loop.

please guide me , i appreciate your response, i am new in this domain.