[SOLVED] Comparing 2 DB and displaying results
Posted: Wed May 21, 2008 9:18 am
Hi there, me again
I have written a tool where users can be created from templates and so on. I have added a section where you can search user by template but the query doesn't display the correct users or has no output what so ever here is the code, excuse the "dirty coding"
I have a drop down box using similar code as below to populate the template number and it is posted but the code below is suppose to fetch the posted template number:
the above output is sent to to a HTML Table that is suppose to display the detail from the select query called "$srcquery" but some templates aren't displayed. I've tried specifying all the columns but still have the same result.
I don't know how to fix this, I've tried everything that I could think of but my knowledge is quite limited.
I have written a tool where users can be created from templates and so on. I have added a section where you can search user by template but the query doesn't display the correct users or has no output what so ever here is the code, excuse the "dirty coding"
I have a drop down box using similar code as below to populate the template number and it is posted but the code below is suppose to fetch the posted template number:
Code: Select all
$query="select * from templates.bw_templates where user_number='$template'";
$tempres=mysql_query($query) or die ("Cannot Extract Template". mysql_error());
while ($temprow=mysql_fetch_array($tempres)) {
$ops1= $temprow['user_phm'];
$ops2= $temprow['user_deb'];
$ops3= $temprow['user_cre'];
$ops4= $temprow['user_stk'];
$ops5= $temprow['user_inv'];
$ops6= $temprow['user_pur'];
$ops7= $temprow['user_csh'];
$ops8= $temprow['user_res'];
$ops9= $temprow['user_hot'];
$ops10= $temprow['user_pos'];
$ops11= $temprow['user_sal'];
$ops12= $temprow['user_del'];
$ops13= $temprow['user_loy'];
$ops14= $temprow['user_level'];
$ops15= $temprow['user_entry_menu'];
$ops16= $temprow['user_prt_no'];
$ops17= $temprow['user_pass_change'];
$ops18= $temprow['user_utility_only'];
$ops19= $temprow['user_logon'];
$ops20= $temprow['user_pos_qty'];
$ops21= $temprow['user_accept'];
$ops22= $temprow['user_help'];
$ops23= $temprow['user_screen_save'];
$ops24= $temprow['user_training'];
$ops25= $temprow['user_pass_date'];
$ops26= $temprow['user_upper_case'];
$ops27= $temprow['user_log_out'];
$ops28= $temprow['user_sms'];
$ops29= $temprow['user_mail'];
$ops30= $temprow['user_sms_cnt'];
$ops31= $temprow['user_scan_id'];
$ops32= $temprow['user_manager_yn'];
$ops33= $temprow['user_superv_yn'];
$ops34= $temprow['user_cashier_yn'];
$ops35= $temprow['user_deb_clerk_yn'];
$ops36= $temprow['user_cre_clerk_yn'];
$ops37= $temprow['user_stk_clerk_yn'];
$ops38= $temprow['user_ord_clerk_yn'];
$ops39= $temprow['user_rep_yn'];
$ops40= $temprow['user_waiter_yn'];
$ops41= $temprow['user_rest_cashier_yn'];
$ops42= $temprow['user_driver_yn'];
$ops43= $temprow['user_pharmacist_yn'];
$ops44= $temprow['user_assistant_yn'];
$ops45= $temprow['user_op1'];
$ops46= $temprow['user_op2'];
$ops47= $temprow['user_op3'];
$ops48= $temprow['user_op4'];
$ops49= $temprow['user_op5'];
$ops50= $temprow['user_op6'];
$ops51= $temprow['user_op7'];
$ops52= $temprow['user_op8'];
$ops53= $temprow['user_op9'];
$ops54= $temprow['user_op10'];
$ops55= $temprow['user_op11'];
$ops56= $temprow['user_op12'];
$ops57= $temprow['user_op13'];
$ops58= $temprow['user_op14'];
$ops59= $temprow['user_op15'];
$ops60= $temprow['user_op16'];
$ops61= $temprow['user_op17'];
$ops62= $temprow['user_op18'];
$ops63= $temprow['user_op19'];
$ops64= $temprow['user_op20'];
$ops65= $temprow['user_op21'];
$ops66= $temprow['user_op22'];
$ops67= $temprow['user_op23'];
$ops68= $temprow['user_op24'];
$ops69= $temprow['user_op25'];
$ops70= $temprow['user_op26'];
$ops71= $temprow['user_cashier_no'];
$ops72= $temprow['user_manager'];
$ops73= $temprow['user_fixed_prn'];
$ops74= $temprow['user_pharm_name'];
}
$srctmp = $_POST['template_no']; //from the form page
if ($srctmp !== NULL) {
$srcquery="select user_number, user_name, user_level, user_entry_menu from uni_bw_usr where user_deb='$ops2' AND user_stk='$ops4' AND user_inv='$ops5' AND user_del='$ops12' AND user_level='$ops14' AND user_entry_menu='$ops15' AND user_pass_change='$ops17' AND user_accept='$ops21' AND user_help='$ops22' AND user_manager='$ops32' AND user_superv_yn='$ops33' AND user_cashier_yn='$ops34' AND user_stk_clerk_yn='$ops37' AND user_rep_yn='$ops39' AND user_op1='$ops45' AND user_op2='$ops46' AND user_op5='$ops49' AND user_op6='$ops50' AND user_op7='$ops51' AND user_op11='$ops55' AND user_op14='$ops58' AND user_op15='$ops59' AND user_op16='$ops60' AND user_op18='$ops62' AND user_op24='$ops68' AND user_op25='$ops69' order by user_branch_cd";
mysql_query($srcquery) or die (mysql_error());I don't know how to fix this, I've tried everything that I could think of but my knowledge is quite limited.