Jump to content

retrive data from database on registration id.?


tanvirzafar
 Share

Recommended Posts

hello everyone..i have a database...i want users to get their data by entering their registration id into forum... i am working on phpmyadmin..please tell me the code of .php file with query.....

any phph expert please help....??

Edited by tanvirzafar
Link to comment
Share on other sites

what have you done so far? any code?

It is usually done by passing the id in GET request or POST Request and capture the data and then use WHERE clause in SELECT query to retireve that sepcified id.

  • Like 1
Link to comment
Share on other sites

what have you done so far? any code?

It is usually done by passing the id in GET request or POST Request and capture the data and then use WHERE clause in SELECT query to retireve that sepcified id.

i get input of registratio_id from a forum with post method....i create a record.php file...connenct database and want to show record on student on the basis of registration id....here is the record.phph file...correct this code..

<?php$con = mysql_connect("abc.com","colg","Pta@1","colg");// Check connectionif (mysql_connect_errno()) { echo "Failed to connect to MySQL: " . mysql_connect_error(); }$result = mysql_query($con,"SELECT * FROM fsc_engg_ics WHERE reg_id='".mysql_real_escape_string($con, $_POST["registrationid"])."'"$result = mysql_query($con, $sql);while($row = mysql_fetch_array($result)) { echo $row['f_name'] . " " . $row['l_name']; echo "<br>"; }?>

Link to comment
Share on other sites

does it work? does it show any error?

Link to comment
Share on other sites

$result = mysql_query($con,"SELECT * FROM fsc_engg_ics WHERE reg_id='".mysql_real_escape_string($con, $_POST["registrationid"])."'"$result = mysql_query($con, $sql);
What's going on with those 2 lines? That's the problem. That's also a syntax error, if you're not seeing the error messages then you need to turn on error messages in php.ini.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...