Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to retrive category wise data of students bt dont know where im stuck .
here is my code. my config file contain database conectivity


PHP
include('config.php');

$st = "select * from student";
$result = mysql_query($st);

$cat = "SC";

        echo "<table><tr><td>Fname</td><td>Mname</td><td>Lname</td><td>Category</td></tr>";

while($array = mysql_fetch_array($result))
{
    echo " ".$array['Category'];
    echo "<br>";
    echo "String cat=".$cat." ";
    $match = strcasecmp($st ,$array['Category']);

    echo $match;
    if($match)
    {
        echo "<tr><td>".$array['FName']."</td>";
        echo "<td>".$array['MName']."</td>";
        echo "<td>".$array['LName']."</td>";
        echo "<td>".$array['Category']."</td>";

    }
}
Posted
Comments
Mohibur Rashid 7-Sep-15 20:25pm    
where is your mysql connect?
Member 10011989 8-Sep-15 11:52am    
i have define tht i have my my sql connectivity code if config file and yes i m using mysql, which is also selected as tags

1 solution

where is SQL connection and are you using MYSQL or Oracle
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900