Jump to content

Unknown column 'student_id' in 'field list'


ipsa24

Recommended Posts

$student_id = $_POST['st_id'];

$student_pass = $_POST['st_pass'];

$first_name = $_POST['first_name'];

$last_name = $_POST['last_name'];

$gender = $_POST['gender'];

$contact_no = $_POST['contact_no'];

$qualification= $_POST['qualification'];

$city = $_POST['city'];

$state = $_POST['state'];

$country = $_POST['country'];

$pin_code = $_POST['pin_code'];

$email1 = $_POST['email1'];

$address = $_POST['address'];

$resumename = "";

$imagename = "";

$dobdate = date("Y-m-d",strtotime($_POST['dob']));

$select_query="select student_id from student_registration where student_id = '$student_id'";

 

Error : Unknown column 'student_id' in 'field list'

Link to comment
https://forums.phpfreaks.com/topic/267588-unknown-column-student_id-in-field-list/
Share on other sites

Unknown column 'student_id' in 'field list'

 

$student_id = $_POST['st_id'];

$student_pass = $_POST['st_pass'];

$first_name = $_POST['first_name'];

$last_name = $_POST['last_name'];

$gender = $_POST['gender'];

$contact_no = $_POST['contact_no'];

$qualification= $_POST['qualification'];

$city = $_POST['city'];

$state = $_POST['state'];

$country = $_POST['country'];

$pin_code = $_POST['pin_code'];

$email1 = $_POST['email1'];

$address = $_POST['address'];

$resumename = "";

$imagename = "";

$dobdate = date("Y-m-d",strtotime($_POST['dob']));

$select_query="select student_id from student_registration where student_id = '$student_id'";

 

Error : Unknown column 'student_id' in 'field list'

 

It's thing like this that make me feel good about myself.

ipsa24: Check your table structure again, and you'll see what the problem is.

In fact, it's so basic you should have done this immediately upon seeing that error, without us having to tell you. If you want people to help you, you have to put in some effort to solve the problem yourself. After all, why should we bother to spend our time (which often is very limited) to help you, when you can't be bothered to do so yourself?

I hope you are checking if these post variables are set before actually assigning them to another variable, and that you are sanitizing them before using them against the database.

 

With that said, ChristrianF told you to pretty much what there is to be said. The error message speaks for itself.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.