tanvirzafar Posted March 3, 2014 Share Posted March 3, 2014 (edited) 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 March 3, 2014 by tanvirzafar Link to comment Share on other sites More sharing options...
birbal Posted March 3, 2014 Share Posted March 3, 2014 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. 1 Link to comment Share on other sites More sharing options...
tanvirzafar Posted March 4, 2014 Author Share Posted March 4, 2014 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 More sharing options...
birbal Posted March 4, 2014 Share Posted March 4, 2014 does it work? does it show any error? Link to comment Share on other sites More sharing options...
tanvirzafar Posted March 4, 2014 Author Share Posted March 4, 2014 does it work? does it show any error? no...it does't work.....please check it... Link to comment Share on other sites More sharing options...
justsomeguy Posted March 4, 2014 Share Posted March 4, 2014 $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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now