girlzz Posted July 31, 2008 Share Posted July 31, 2008 hello sir... i have one question... how can i get one field from table in my database so when i search by s_code, the s_title from another table can be same value as the s_code?? here is my coding.. mysql_select_db($database_mas, $mas); $query_Recordset1 = sprintf("SELECT medic_registered_course.matric_no, medic_registered_course.s_code FROM medic_registered_course WHERE medic_registered_course.s_code LIKE '%%%s%%' ORDER BY `id` DESC" , $colname_Recordset1); $Recordset1 = mysql_query($query_Recordset1, $mas) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); mysql_select_db($database_mas, $mas); $query_Recordset2 = "SELECT medic_subject_offered.s_title,medic_registered_course.s_code FROM medic_registered_course,medic_subject_offered WHERE medic_registered_course.s_code=medic_subject_offered.s_code"; $Recordset2 = mysql_query($query_Recordset2, $mas) or die(mysql_error()); $row_Recordset2 = mysql_fetch_assoc($Recordset2); $totalRows_Recordset2 = mysql_num_rows($Recordset2); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.