4
Contributors
9
Replies
31
Views
2 Years
Discussion Span
Last Post by diafol
0
xmlhttp.open("GET","getuser.php?q="+str+"&&k="+str,true);

You should have

xmlhttp.open("GET","getuser.php?q="+str+"&k="+str,true);
1

Please tell me that you have a <head> and that you've just randomly decided to show the end of the page and not the start.

Also, please, PLEASE, indent your code properly and only put a neccessary amount of gap lines in to keep it readable. Frankly, your code is making my eyes bleed.

In regards to your problem: "results wont come" isn't best helpful and doesn't really match your title. Provide an accuracte description of what you have got, including error messages, and what you're not getting that you need. Screenshots always useful as well.

Edited by mattster

0

now my problem is at here...
$sql="SELECT * FROM schoolentry WHERE classs =".$q." and division = ".$k."";
//if i didnt gave division its working and if i choose division its not working

0

this is my getuser.php

<!DOCTYPE html>
<html>
<head>
<style>
table {
    width: 100%;
    border-collapse: collapse;
}

table, td, th {
    border: 1px solid black;
    padding: 5px;
}

th {text-align: left;}
</style>
</head>
<body>
<th>
<a href="editschoolentry.php?classs=<?php echo $row['classs'];?>">Edit</a> 
</th>
<th>
<a href="deleteschoolentry.php">Delete</a> 
</th>
<th>
<a href="logout.php">logout</a> 
</th>
<?php
if(isset($_POST['update']))
{
    include "edit.php";
}
$q = intval($_GET['q']);
$k= intval($_GET['k']);
$con = mysqli_connect('localhost','root','');
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"shamsu");
$sql="SELECT * FROM schoolentry WHERE classs =".$q." and division =' ".$k."'";
$result = mysqli_query($con,$sql);

echo "<table>
<tr>
<th>Image</th>
<th>Student Name</th>
<th>Admission No</th>
<th>Parent Name</th>
<th>Classs</th>
<th>Division</th>
<th>Address1</th>
<th>Address2</th>
<th>Address3</th>
<th>Address4</th>
<th>Pincode</th>
<th>Phone No</th>
<th>DOB</th>
<th>Adhar No</th>
<th>Blood Group</th>
<th>Mobile No</th>
<th>Edit</th>
<th>Delete</th>


</tr>";

while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<form action=edit.php method=POST>";
    echo "<td>" . $row['image'] . "</td>";

    echo "<td>" . $row['student_name'] . "</td>";
    echo "<td>" . $row['admission_no'] . "</td>";
    echo "<td>" . $row['parent_name'] . "</td>";
    echo "<td>" . $row['classs'] . "</td>";
    echo "<td>" . $row['division'] . "</td>";
    echo "<td>" . $row['p_address'] . "</td>";
    echo "<td>" . $row['p_address1'] . "</td>";
    echo "<td>" . $row['p_address2'] . "</td>";
    echo "<td>" . $row['p_address3'] . "</td>";
    echo "<td>" . $row['p_address4'] . "</td>";
    echo "<td>" . $row['p_address5'] . "</td>";
    echo "<td>" . $row['dob'] . "</td>";
    echo "<td>" . $row['adhar_no'] . "</td>";
    echo "<td>" . $row['blood_group'] . "</td>";
    echo "<td>" . $row['mobile_no'] . "</td>";

    echo "</tr>";
}

echo "</table>";
mysqli_close($con);
?>

</body>
</html>
0

did you try removing an extra space in the query below -

$sql="SELECT * FROM schoolentry WHERE classs =".$q." and division =' ".$k."'";

should have been -

$sql="SELECT * FROM schoolentry WHERE classs =".$q." and division ='".$k."'";
0

If you are using integers, no need to quote the vars. Additionally, you shoud be using prepared statements and build a dynamic where clause, depending on the get variables passed.

0

now also its not w orking..the division was not an integer thats y i had given like that

0

now also its not w orking..the division was not an integer thats y i had given like that

Make up your mind. Is division an integer or not? Your code says it is and now you say it's not. Your code (line 108):

$k= intval($_GET['k']);

If it's not working, be specific with what's happening. We do not have access to your site/DB - no crystal ball. Help yourself by being less cryptic. It should not be a secret that we have to drag out of you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.