Jump to content

ericjw316

Members
  • Posts

    23
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ericjw316's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey i have tried to do the code and i am not getting a return of data. here is the form and mysql. Can you let me know what i am doing wrong or just point me in the right direction. <form name="form1" method="post" action=""> <?php $con=mysqli_connect("localhost","username","password","database"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $water_purveyor = $_POST['water_purveyor']; $meter_num = $_POST['meter_num']; $permit_num = $_POST['permit_num']; $manufacturer = $_POST['manufacturer']; $meter_size = $_POST['meter_size']; $model_num = $_POST['model_num']; $serial_num = $_POST['serial_num']; $mc_name = $_POST['mc_name']; $mc_contact = $_POST['mc_contact']; $mc_phone_num = $_POST['mc_phone_num']; $mc_address = $_POST['mc_address']; $mc_city = $_POST['mc_city']; $mc_state = $_POST['mc_state']; $mc_zip = $_POST['mc_zip']; $oi_name = $_POST['oi_name']; $oi_contact = $_POST['oi_contact']; $oi_phone = $_POST['oi_phone']; $oi_address = $_POST['oi_address']; $oi_city = $_POST['oi_city']; $oi_state = $_POST['oi_state']; $oi_zip = $_POST['oi_zip']; $bf_assembly_address = $_POST['bf_assembly_address']; $primary_business = $_POST['primary_business']; $onsite_location = $_POST['onsite_location']; $new_serial_num = $_POST['new_serial_num']; $toa_other_text = $_POST['toa_other_text']; $line_pressuer = $_POST['line_pressuer']; $svb_aioa_psid = $_POST['svb_aioa_psid']; $cv1_psid = $_POST['cv1_psid']; $cv2_psid = $_POST['cv2_psid']; $dprv_psid = $_POST['dprv_psid']; $svb_cvha_psid = $_POST['svb_cvha_psid']; $shut_off_valve = $_POST['shut_off_valve']; $ft_cv1_psid = $_POST['ft_cv1_psid']; $ft_cv2_psid = $_POST['ft_cv2_psid']; $ft_dprv_psid = $_POST['ft_dprv_psid']; $ft_ai_psid = $_POST['ft_ai_psid']; $ft_cv_psid = $_POST['ft_cv_psid']; $itb = $_POST['itb']; $certified_tester_num = $_POST['certified_tester_num']; $date_failed = $_POST['date_failed']; $tk_serial_num = $_POST['tk_serial_num']; $repaired_by = $_POST['repaired_by']; $cert_num = $_POST['cert_num']; $repair_date = $_POST['repair_date']; $ftb = $_POST['ftb']; $ftb_certified_tester_num = $_POST['ftb_certified_tester_num']; $date_passed = $_POST['date_passed']; $ftb_tk_serial_num = $_POST['ftb_tk_serial_num']; $comments = $_POST['comments']; $table = "table"; $sql = "SELECT * FROM $table WHERE id = :id"; ?> <table width="1100" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1100" height="1550" style="background-image:url(../test%20report%20page/images/city%20of%20phx%20Test%20report%20large.jpg); background-repeat:no-repeat; width:1100px; height:1550px;" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="62" height="204"> </td> <td width="961"> </td> <td width="77"> </td> </tr> <tr> <td height="37"> </td> <td valign="bottom"><table width="100%" height="40" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="335" height="40" align="right"><div style="padding_left:110px; padding_bottom:5px;"><?php echo $water_purveyor ?></div></td> <td width="295" align="right"><div style="padding_bottom:5px;"><?php echo $meter_num ?></div></td> <td width="249" align="right"><div style="padding_bottom:5px;"><?php echo $permit_num ?></div></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="37"> </td> <td valign="bottom"><table width="100%" height="34" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="38%" height="34" align="right"><?php echo $manufacturer ?></td> <td width="17%" align="right"><?php echo $meter_size ?></td> <td width="17%" align="right"><?php echo $model_num ?></td> <td width="28%" align="right"><?php echo $serial_num ?></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="43"> </td> <td valign="bottom"><table width="100%" height="33" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="56%"><?php echo $mc_name ?></td> <td width="28%"><?php echo $mc_contact ?></td> <td width="16%"><?php echo $mc_phone_num ?></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="41"> </td> <td valign="bottom"><table width="100%" height="33" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="68%"><?php echo $mc_address ?></td> <td width="13%"><?php echo $mc_city ?></td> <td width="7%"><?php echo $mc_state ?></td> <td width="12%"><?php echo $mc_zip ?></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="43"> </td> <td valign="bottom"><table width="100%" height="33" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="56%"><?php echo $oi_name ?></td> <td width="28%"><?php echo $oi_contact ?></td> <td width="16%"><?php echo $oi_phone ?></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="37"> </td> <td><table width="100%" height="33" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="68%" align="right"><div style="padding_right:15px;"><?php echo $oi_address ?></div></td> <td width="12%" valign="bottom"> <?php echo $oi_city ?></td> <td width="7%" valign="bottom"><?php echo $oi_state ?></td> <td width="13%" valign="bottom"><?php echo $oi_zip ?></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="40"> </td> <td valign="bottom"><table width="100%" height="33" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="68%" align="right"> <div style="padding_right:15px;"><?php echo $bf_assembly_address ?></div></td> <td width="32%" valign="bottom"><?php echo $primary_business ?></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="56"> </td> <td valign="bottom"><table width="100%" height="59" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="64%" height="59" align="right"><div style="padding_right:10px;"><?php echo $onsite_location ?></div></td> <td width="36%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"> </td> <td width="16%" valign="top"><input type="checkbox" name="new_assembly_yes" id="new_assembly_yes" /></td> <td width="18%"><input type="checkbox" name="new_assembly_no" id="new_assembly_no" /></td> </tr> <tr> <td colspan="2"> </td> <td valign="top"><input type="checkbox" name="replacement_assembly_yes" id="replacement_assembly_yes" /></td> <td><input type="checkbox" name="replacement_assembly_no" id="replacement_assembly_no" /></td> </tr> <tr> <td width="37%"> </td> <td colspan="3"><?php echo $new_serial_num ?></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="48"> </td> <td valign="top"><table width="100%" height="42" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="51%" height="33"><table width="100%" height="32" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="19%"> </td> <td width="40%"><input type="checkbox" name="poa_secondary" id="poa_secondary" /></td> <td width="41%"><input type="checkbox" name="poa_primary" id="poa_primary" /></td> </tr> </table></td> <td width="49%"><table width="100%" height="30" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="8%"> </td> <td width="25%"><input type="checkbox" name="poa_fire_system" id="poa_fire_system" /></td> <td width="23%"><input type="checkbox" name="poa_landscape" id="poa_landscape" /></td> <td width="44%"><input type="checkbox" name="poa_portable" id="poa_portable" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="53"> </td> <td><table width="100%" height="49" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="62%"><table width="100%" height="48" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6%"> </td> <td width="23%"> </td> <td width="12%"><input type="checkbox" name="svb" id="svb" /></td> <td width="11%"><input type="checkbox" name="pvb" id="pvb" /></td> <td width="11%"><input type="checkbox" name="dc" id="dc" /></td> <td width="37%"><input type="checkbox" name="rp" id="rp" /></td> </tr> <tr> <td> </td> <td valign="bottom"><input type="checkbox" name="toa_other" id="toa_other" /></td> <td colspan="4"><?php echo $toa_other_text ?></td> </tr> </table></td> <td width="14%"><div style="padding_left:15px; padding_top:15px;"><?php echo $line_pressure ?></div></td> <td width="24%" valign="top"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="50%"> </td> <td width="26%"><input type="checkbox" name="bp_yes" id="bp_yes" /></td> <td width="24%"><input type="checkbox" name="bp_no" id="bp_no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="66"> </td> <td valign="bottom"><table width="100%" height="50" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="79%"> </td> <td width="21%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" align="center"><?php echo $svb_aioa_psid ?></td> <td width="24%"> </td> </tr> <tr> <td width="25%"> </td> <td width="22%"> </td> <td width="29%"><input type="checkbox" name="svb_leaked_yes" id="svb_leaked_yes" /></td> <td><input type="checkbox" name="svb_leaked_no" id="svb_leaked_no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="67"> </td> <td valign="bottom"><table width="100%" height="65" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="10%"> </td> <td width="24%"><table width="100%" height="65" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20%"> </td> <td width="14%"> </td> <td width="24%"> </td> <td width="13%"><input type="checkbox" name="cv1_ct_yes" id="cv1_ct_yes" /></td> <td width="10%"> </td> <td width="19%"><input type="checkbox" name="cv1_ct_no" id="cv1_ct_no" /></td> </tr> <tr> <td> </td> <td colspan="3" align="center"><?php echo $cv1_psid ?></td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td><input type="checkbox" name="cv1_leaked_yes" id="cv1_leaked_yes" /></td> <td> </td> <td><input type="checkbox" name="cv1_leaked_no" id="cv1_leaked_no" /></td> </tr> </table></td> <td width="24%"><table width="100%" height="65" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="16%"> </td> <td width="16%"> </td> <td width="24%"> </td> <td width="13%"><input type="checkbox" name="cv2_ct_yes" id="cv2_ct_yes" /></td> <td width="10%"> </td> <td width="21%"><input type="checkbox" name="cv2_ct_no" id="cv2_ct_no" /></td> </tr> <tr> <td> </td> <td colspan="3" align="center"><?php echo $cv2_psid ?></td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td><input type="checkbox" name="cv2_leaked_yes" id="cv2_leaked_yes" /></td> <td> </td> <td><input type="checkbox" name="cv2_leaked_no" id="cv2_leaked_no" /></td> </tr> </table></td> <td width="21%"><table width="100%" height="54" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="17%" height="34"> </td> <td colspan="2" valign="bottom" align="center"><?php echo $dprv_psid ?></td> <td width="6%"> </td> <td width="20%"> </td> </tr> <tr> <td> </td> <td width="38%"> </td> <td width="19%"><input type="checkbox" name="dprv_dno_yes" id="dprv_dno_yes" /></td> <td> </td> <td><input type="checkbox" name="dprv_dno_no" id="dprv_dno_no" /></td> </tr> </table></td> <td width="21%" valign="bottom"><table width="100%" height="55" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" align="center"><div style="padding_top:5px;"><?php echo $svb_cvha_psid ?></div></td> <td width="23%"> </td> </tr> <tr> <td width="25%"> </td> <td width="25%"> </td> <td width="27%"><input type="checkbox" name="svb_cvha_leaked_yes" id="svb_cvha_leaked_yes" /></td> <td><input type="checkbox" name="svb_cvha_leaked_no" id="svb_cvha_leaked_no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="135"> </td> <td valign="bottom"><table width="100%" height="135" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="10%"> </td> <td width="24%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="58%"> </td> <td width="23%"><input type="checkbox" name="cv1_cleaned_yes" id="cv1_cleaned_yes" /></td> <td width="19%"><input type="checkbox" name="cv1_cleaned_no" id="cv1_cleaned_no" /></td> </tr> <tr> <td> </td> <td valign="top"><input type="checkbox" name="cv1_replaced_yes" id="cv1_replaced_yes" /></td> <td valign="top"><input type="checkbox" name="cv1_replaced_no" id="cv1_replaced_no" /></td> </tr> <tr> <td height="30"> </td> <td valign="bottom"><input type="checkbox" name="cv1_rkd_yes" id="cv1_rkd_yes" /></td> <td valign="bottom"><input type="checkbox" name="cv1_rkd_no" id="cv1_rkd_no" /></td> </tr> <tr> <td height="10"> </td> <td><input type="checkbox" name="cv1_springs_yes" id="cv1_springs_yes" /></td> <td><input type="checkbox" name="cv1_springs_no" id="cv1_springs_no" /></td> </tr> <tr> <td height="10"> </td> <td><input type="checkbox" name="cv1_guide_yes" id="cv1_guide_yes" /></td> <td><input type="checkbox" name="cv1_guide_no" id="cv1_guide_no" /></td> </tr> <tr> <td height="10"> </td> <td valign="top"><input type="checkbox" name="cv1_other_yes" id="cv1_other_yes" /></td> <td valign="top"><input type="checkbox" name="cv1_other_no" id="cv1_other_no" /></td> </tr> </table></td> <td width="24%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="55%"> </td> <td width="25%"><input type="checkbox" name="cv2_cleaned_yes" id="cv2_cleaned_yes" /></td> <td width="20%"><input type="checkbox" name="cv2_cleaned_no" id="cv2_cleaned_no" /></td> </tr> <tr> <td height="10"> </td> <td><input type="checkbox" name="cv2_replaced_yes" id="cv2_replaced_yes" /></td> <td><input type="checkbox" name="cv2_replaced_no" id="cv2_replaced_no" /></td> </tr> <tr> <td height="30"> </td> <td valign="bottom"><input type="checkbox" name="cv2_rkd_yes" id="cv2_rkd_yes" /></td> <td valign="bottom"><input type="checkbox" name="cv2_rkd_no" id="cv2_rkd_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv2_springs_yes" id="cv2_springs_yes" /></td> <td><input type="checkbox" name="cv2_springs_no" id="cv2_springs_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv2_guide_yes" id="cv2_guide_yes" /></td> <td><input type="checkbox" name="cv2_guide_no" id="cv2_guide_no" /></td> </tr> <tr> <td height="10"> </td> <td valign="top"><input type="checkbox" name="cv2_other_yes" id="cv2_other_yes" /></td> <td valign="top"><input type="checkbox" name="cv2_other_no" id="cv2_other_no" /></td> </tr> </table></td> <td width="21%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="54%"> </td> <td width="27%"><input type="checkbox" name="dprv_cleaned_yes" id="dprv_cleaned_yes" /></td> <td width="19%"><input type="checkbox" name="dprv_cleaned_no" id="dprv_cleaned_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="dprv_replaced_yes" id="dprv_replaced_yes" /></td> <td><input type="checkbox" name="dprv_replaced_no" id="dprv_replaced_no" /></td> </tr> <tr> <td height="30"> </td> <td valign="bottom"><input type="checkbox" name="dprv_rkd_yes" id="dprv_rkd_yes" /></td> <td valign="bottom"><input type="checkbox" name="dprv_rkd_no" id="dprv_rkd_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="dprv_springs_yes" id="dprv_springs_yes" /></td> <td><input type="checkbox" name="dprv_springs_no" id="dprv_springs_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="dprv_guide_yes" id="dprv_guide_yes" /></td> <td><input type="checkbox" name="dprv_guide_no" id="dprv_guide_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="dprv_other_yes" id="dprv_other_yes" /></td> <td><input type="checkbox" name="dprv_other_no" id="dprv_other_no" /></td> </tr> </table></td> <td width="21%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%"> </td> <td width="27%"><input type="checkbox" name="pvb_cleaned_yes" id="pvb_cleaned_yes" /></td> <td width="23%"><input type="checkbox" name="pvb_cleaned_no" id="pvb_cleaned_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="pvb_replaced_yes" id="pvb_replaced_yes" /></td> <td><input type="checkbox" name="pvb_replaced_no" id="pvb_replaced_no" /></td> </tr> <tr> <td height="30"> </td> <td valign="bottom"><input type="checkbox" name="pvb_rkd_yes" id="pvb_rkd_yes" /></td> <td valign="bottom"><input type="checkbox" name="pvb_rkd_no" id="pvb_rkd_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="pvb_springs_yes" id="pvb_springs_yes" /></td> <td><input type="checkbox" name="pvb_springs_no" id="pvb_springs_no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="pvb_guide_yes" id="pvb_guide_yes" /></td> <td><input type="checkbox" name="pvb_guide_no" id="pvb_guide_no" /></td> </tr> <tr> <td> </td> <td valign="top"><input type="checkbox" name="pvb_other_yes" id="pvb_other_yes" /></td> <td valign="top"><input type="checkbox" name="pvb_other_no" id="pvb_other_no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="35"> </td> <td><table width="100%" height="30" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="11%"> </td> <td width="89%" valign="top"><table width="100%" height="25" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="35%"> </td> <td width="10%" valign="top"> <?php echo $shut_off_valve ?></td> <td width="13%"><input type="checkbox" name="repaired" id="repaired" /></td> <td width="13%"><input type="checkbox" name="replaced" id="replaced" /></td> <td width="29%"><input type="checkbox" name="both_ok" id="both_ok" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="64"> </td> <td><table width="100%" height="63" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="10%"> </td> <td width="24%"><table width="100%" height="63" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20%" height="20" headers="14"> </td> <td width="38%"> </td> <td width="14%" valign="top"><input type="checkbox" name="ft_cv1_ct_yes" id="ft_cv1_ct_yes" /></td> <td width="9%"> </td> <td width="19%" valign="top"><input type="checkbox" name="ft_cv1_ct_no" id="ft_cv1_ct_no" /></td> </tr> <tr> <td height="40"> </td> <td colspan="2" align="center" valign="top"><?php echo $ft_cv1_psid ?></td> <td> </td> <td> </td> </tr> </table></td> <td width="24%"><table width="100%" height="63" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20%" height="20" headers="14"> </td> <td width="36%"> </td> <td width="14%" valign="top"><input type="checkbox" name="ft_cv2_ct_yes2" id="ft_cv2_ct_yes2" /></td> <td width="10%"> </td> <td width="20%" valign="top"><input type="checkbox" name="ft_cv_ct_no" id="ft_cv2_ct_no" /></td> </tr> <tr> <td height="40"> </td> <td colspan="2" align="center" valign="top"><?php echo $ft_cv2_psid ?></td> <td> </td> <td><input type="checkbox" name="ft_cv2_ct_yes" id="ft_cv2_ct_yes" /></td> </tr> </table></td> <td width="21%" align="center"><?php echo $ft_dprv_psid ?></td> <td width="21%" valign="top"><table width="100%" height="57" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="42%" height="25"> </td> <td colspan="2"><?php echo $ft_ai_psid ?></td> <td width="17%"> </td> </tr> <tr> <td> </td> <td width="15%"> </td> <td width="26%"><?php echo $ft_cv_psid ?></td> <td> </td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="48"> </td> <td> </td> <td> </td> </tr> <tr> <td height="43"> </td> <td valign="bottom"><table width="100%" height="42" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%"><div style="padding_top:8px;"><?php echo $itb ?></div></td> <td width="22%"><div style="padding_top:8px;"><?php echo $certified_tester_num ?></div></td> <td width="13%"><div style="padding_top:8px;"><?php echo $date_failed ?></div></td> <td width="15%"><div style="padding_top:8px;"><?php echo $tk_serial_num ?></div></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="36"> </td> <td valign="bottom"><table width="100%" height="31" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" valign="bottom"><?php echo $repaired_by ?></td> <td width="35%" valign="bottom"><?php echo $cert_num ?></td> <td width="15%" valign="bottom"><?php echo $repair_date ?></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="45"> </td> <td valign="bottom"><table width="100%" height="36" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%"><div style="padding_top:8px;"><?php echo $ftb ?></div></td> <td width="22%"><div style="padding_top:8px;"><?php echo $ftb_certified_tester_num ?></div></td> <td width="14%"><div style="padding_top:8px;"><?php echo $date_passed ?></div></td> <td width="14%"><div style="padding_top:8px;"><?php echo $ftb_tk_serial_num ?></div></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="156"> </td> <td valign="bottom"><?php echo $comments ?></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"></td> </tr> </table> <?php if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con) ?> </form>
  2. Thank you all for your help. I will be testing these out tomorrow and i will update you if they work. If the do work i will put the working code up in case someone has the same question. E
  3. To answer your question the form i showed was my get area. The posting of the form is working just fine. If i can use post i can change that. What i need to know is the echo for the text boxes and for the check boxes to display the data in the form. I have the posting done to where i have the data in the database done. So if the check box is set to 1 or 0 like this in my sending info to the database $v1-na = isset($_POST['v1-na']) ? 1 : 0; If the isset is used how can i set it to have the check box check or unchecked? 1 is checked 0 is unchecked.
  4. I would like to thank everyone helping me on my previous question. This is the last question i have. Currently i have my program running but i just need to figure out how to use the get function on check boxes and text boxes. Here is the code i am using for the php mysql part of it. <?php $con=mysqli_connect("localhost","username","password","dbase"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql="SELECT * from table where id = '".$_GET["id"]."' "; $rs=mysql_query($sql,$conn) or die(mysql_error()); ?> I know this is working by echoing what i needed to display. But i am in a situation where the form is extremely large and i need to display it in the what it is setup currently. Here is an example of the form <form name="standard" method="post" action="submit.php"> <table width="100%" height="1295" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" background="../test report page/images/test form standard large2.jpg" ><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="35" height="122"> </td> <td width="920"> </td> <td width="45"> </td> </tr> <tr> <td height="49"> </td> <td valign="top"><table width="100%" height="44" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="25%" valign="bottom"> <input name="water-purveyor" type="text" id="water-purveyor" size="25" height="25" value="<?php echo'.$result["water-purveyor"].' ?>" /></td> <td width="20%" valign="bottom"> <input type="text" name="facility-contact" id="facility-contact" height="25" value="<?php echo'.$result["facility-contact"].' ?>" /></td> <td width="55%" valign="bottom"><input type="text" name="facility-address" id="facility-address" size="50" height="25" value="<?php echo'.$result["facility-address"].' ?>" /></td> </tr> </table></td> <td> </td> </tr> <tr> <td width="28%" height="85" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" rowspan="2"> </td> <td width="15%" height="33"><input type="checkbox" name="v1-na" id="v1-na" value="<?php echo'.$result["v1-na"].' ?>" /></td> <td width="14%"><input type="checkbox" name="v1-good" id="v1-good" value="<?php echo'.$result["v1-good"].' ?>" /></td> <td width="15%"><input type="checkbox" name="v1-poor" id="v1-poor" value="<?php echo'.$result["v1-poor"].' ?>" /></td> <td width="15%"><input type="checkbox" name="v1-fail" id="v1-fail" value="<?php echo'.$result["v1-fail"].' ?>" /></td> </tr> <tr> <td height="35" valign="top" style="padding-top:4px;"><input type="checkbox" name="v2-na" id="v2-na" value="<?php echo'.$result["v2-na"].' ?>" /></td> <td valign="top" style="padding-top:4px;"><input type="checkbox" name="v2-good" id="v2-good" value="<?php echo'.$result["v2-good"].' ?>" /></td> <td valign="top" style="padding-top:4px;"><input type="checkbox" name="v2-poor" id="v2-poor" value="<?php echo'.$result["v2-poor"].' ?>" /></td> <td valign="top" style="padding-top:4px;"><input type="checkbox" name="v2-fail" id="v2-fail" value="<?php echo'.$result["v2-fail"].' ?>" /></td> </tr> </table> </form> Can you tell me if this will work or can you give me some helpful ways to make this work. Again thank you for all your help. E
  5. What i need to do is show the check box and text box as it is a document i want to print out later. If there is another way to show everything i would be happy to have that shown to me. I am doing this for a potential client.
  6. What i am trying to do is something like this: <input type='checkbox' name='chkbox1' id='chkbox1' value='<?php echo $_GET["chkbox1"]; ?>' > the select statement would be: select * from table where id = :id
  7. Thank you everyone for your help. I have got my insert into working. Now i was just wondering how to display the checkbox on a get. Can you possible help me out with any of that code. Thank you.
  8. Here is what i need. I have a form with a bunch of text boxes and check box's that i need to submit to mysql database. I know how to submit the text boxes just fine with the insert statment. I have not used check boxes and i need some help on how to insert them into the database. I need them to be enterened in as a 0 or 1. Here is the form <form action="submit.php" method="post"> <table width="1000" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="1400" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6%" height="168"> </td> <td width="87%"> </td> <td width="7%"> </td> </tr> <tr> <td height="37"> </td> <td><table width="100%" height="37" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="32%" valign="bottom"><input name="water-purveyor" type="text" id="water-purveyor" size="35" /></td> <td width="29%" valign="bottom"><input name="meter-num" type="text" id="meter-num" size="10" /></td> <td width="39%" valign="bottom"><input type="text" name="permit-num" id="permit-num" /></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="42"> </td> <td><table width="100%" height="37" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="32%" valign="bottom"> <input name="manufacturer" type="text" id="manufacturer" size="20" /></td> <td width="15%" valign="bottom"><input name="meter-size" type="text" id="meter-size" size="10" /></td> <td width="15%" valign="bottom"><input name="model-num" type="text" id="model-num" size="10" /></td> <td width="38%" valign="bottom"><input name="serial-num" type="text" id="serial-num" size="18" /></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="62"> </td> <td valign="bottom"><table width="100%" height="56" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="61%" valign="bottom"><textarea name="mgmt-info" cols="50" rows="1" id="mgmt-info"></textarea></td> <td width="39%" valign="bottom"><textarea name="mgmt-phone-contact" cols="30" rows="1" id="mgmt-phone-contact"></textarea></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="63"> </td> <td><table width="100%" height="57" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="61%" valign="bottom"><textarea name="owner-info" cols="50" rows="1" id="owner-info"></textarea></td> <td width="39%" valign="bottom"><textarea name="owner-phone-contact" cols="30" rows="1" id="owner-phone-contact"></textarea></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="37"> </td> <td><table width="100%" height="37" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="32%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="3%"> </td> <td width="21%"><input type="checkbox" name="sab-owner" id="sab-owner" /></td> <td width="44%"><input type="checkbox" name="sab-management" id="sab-management" /></td> <td width="32%"><input type="checkbox" name="sab-other" id="sab-other" /></td> </tr> </table></td> <td width="29%" valign="bottom"><input name="auth-contact" type="text" id="auth-contact" size="20" /></td> <td width="39%" valign="bottom"><input name="auth-phone" type="text" id="auth-phone" size="15" /></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="65"> </td> <td><table width="100%" height="56" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="32%" valign="bottom"><textarea name="bf-assembly-address" cols="30" rows="1" id="bf-assembly-address"></textarea></td> <td width="29%" valign="bottom"><textarea name="onsite-location" cols="20" rows="1" id="onsite-location"></textarea></td> <td width="39%" valign="bottom"><textarea name="primary-business" cols="20" rows="1" id="primary-business"></textarea></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="63"> </td> <td><table width="100%" height="56" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="32%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="62" height="8"> </td> <td width="214" height="8"><input type="checkbox" name="new-assembly-yes" id="new-assembly-yes" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="new-assembly-no" id="new-assembly-no" /></td> </tr> </table></td> <td width="29%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="24%" height="8"> </td> <td width="76%" height="8"><input type="checkbox" name="replacement-assembly-yes" id="replacement-assembly-yes" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="replacement-assembly-no" id="replacement-assembly-no" /></td> </tr> </table></td> <td width="39%"><input type="text" name="new-serial-num" id="new-serial-num" /></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="42"> </td> <td><table width="100%" height="42" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="7%"> </td> <td width="24%"><div style="padding-top:8px; padding-left:4px;"><input type="checkbox" name="poa-secondary" id="poa-secondary" /></div></td> <td width="21%"><div style="padding-top:8px"><input type="checkbox" name="poa-primary" id="poa-primary" /></div></td> <td width="14%"><div style="padding-top:8px"><input type="checkbox" name="poa-fire-system" id="poa-fire-system" /></div></td> <td width="14%"><div style="padding-top:8px; padding-left:4px;"><input type="checkbox" name="poa-landscape" id="poa-landscape" /></div></td> <td width="20%"><div style="padding-top:8px; padding-left:4px;"><input type="checkbox" name="poa-portable" id="poa-portable" /></div></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="64"> </td> <td><table width="100%" height="58" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="33%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6%"> </td> <td width="3%"> </td> <td width="26%"><input type="checkbox" name="svb" id="svb" /></td> <td width="23%"><input type="checkbox" name="pvb" id="pvb" /></td> <td width="21%"><input type="checkbox" name="dc" id="dc" /></td> <td width="21%"><input type="checkbox" name="rp" id="rp" /></td> </tr> <tr> <td> </td> <td valign="bottom"> </td> <td colspan="4"><div style="padding-left:20px;"><input name="toa-other-text" type="text" id="toa-other-text" size="30" /></div></td> </tr> </table></td> <td width="35%"> <input type="text" name="line-pressure" id="line-pressure" /></td> <td width="32%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="19%"> </td> <td width="34%"><input type="checkbox" name="bp-yes" id="bp-yes" /></td> <td width="47%"><input type="checkbox" name="bp-no" id="bp-no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="64"> </td> <td><table width="100%" height="63" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="83%"> </td> <td width="17%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="32" colspan="5" valign="bottom" align="center"><input name="pvb-aioa-psid" type="text" id="pvb-aioa-psid" size="8" /></td> </tr> <tr> <td width="18%" height="25"> </td> <td width="28%"> </td> <td width="26%"><input type="checkbox" name="pvb-leaked-yes" id="pvb-leaked-yes" /></td> <td width="28%" colspan="2"><input type="checkbox" name="pvb-leaked-no" id="pvb-leaked-no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="56"> </td> <td><table width="100%" height="56" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="18%"> </td> <td width="22%" valign="top"><table width="100%" height="54" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5%" height="6"> </td> <td width="49%"> </td> <td width="18%"><input type="checkbox" name="cv1-ct-yes" id="cv1-ct-yes" /></td> <td width="28%"><input type="checkbox" name="cv1-ct-no" id="cv1-ct-no" /></td> </tr> <tr> <td height="6"> </td> <td colspan="2" align="center"><input type="text" name="cv1-psid" id="cv1-psid" size="6" /></td> <td> </td> </tr> <tr> <td height="6"> </td> <td> </td> <td valign="top"><input type="checkbox" name="cv1-leaked-yes" id="cv1-leaked-yes" /></td> <td valign="top"><input type="checkbox" name="cv1-leaked-no" id="cv1-leaked-no" /></td> </tr> </table></td> <td width="22%"><table width="100%" height="54" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5%" height="6"> </td> <td width="49%"> </td> <td width="19%"><input type="checkbox" name="cv2-ct-yes" id="cv2-ct-yes" style="background-color:transparent;" /></td> <td width="27%"><input type="checkbox" name="cv2-ct-no" id="cv2-ct-no" /></td> </tr> <tr> <td height="6"> </td> <td colspan="2" align="center"><input type="text" name="cv2-psid" id="cv2-psid" size="6" /></td> <td> </td> </tr> <tr> <td height="6"> </td> <td> </td> <td valign="top"><input type="checkbox" name="cv2-leaked-yes" id="cv2-leaked-yes" /></td> <td valign="top"><input type="checkbox" name="cv2-leaked-no" id="cv2-leaked-no" /></td> </tr> </table></td> <td width="20%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" colspan="2" align="center"><input type="text" name="dprv-psid" id="dprv-psid" size="8" /></td> <td width="6%"> </td> <td width="21%"> </td> </tr> <tr> <td width="54%"> </td> <td width="19%"><input type="checkbox" name="dprv-dno-yes" id="dprv-dno-yes" /></td> <td> </td> <td><input type="checkbox" name="dprv-dno-No" id="dprv-dno-No" /></td> </tr> </table></td> <td width="18%" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="32" colspan="5" valign="bottom" align="center"><input name="pvb-cvha-psid" type="text" id="pvb-cvha-psid" size="8" /></td> </tr> <tr> <td width="20%" height="25"> </td> <td width="20%"> </td> <td width="9%"> </td> <td width="24%"><input type="checkbox" name="pvb-cvha-leaked-yes" id="pvb-cvha-leaked-yes" /></td> <td width="27%"><input type="checkbox" name="pvb-cvha-leaked-no" id="pvb-cvha-leaked-no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="145"> </td> <td><table width="100%" height="143" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="18%" height="129"> </td> <td width="22%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="54%"> </td> <td width="18%"><input type="checkbox" name="cv1-cleaned-yes" id="cv1-cleaned-yes" /></td> <td width="28%"><input type="checkbox" name="cv1-cleaned-no" id="cv1-cleaned-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv1-replaced-yes" id="cv1-replaced-yes" /></td> <td><input type="checkbox" name="cv1-replaced-no" id="cv1-replaced-no" /></td> </tr> <tr> <td height="40"> </td> <td valign="bottom"><input type="checkbox" name="cv1-rkd-yes" id="cv1-rkd-yes" /></td> <td valign="bottom"><input type="checkbox" name="cv1-rkd-no" id="cv1-rkd-no" /></td> </tr> <tr> <td height="22"> </td> <td><input type="checkbox" name="cv1-springs-yes" id="cv1-springs-yes" /></td> <td><input type="checkbox" name="cv1-springs-no" id="cv1-springs-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv1-guide-yes" id="cv1-guide-yes" /></td> <td><input type="checkbox" name="cv1-guide-no" id="cv1-guide-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv1-other-yes" id="cv1-other-yes" /></td> <td><input type="checkbox" name="cv1-other-no" id="cv1-other-no" /></td> </tr> </table></td> <td width="22%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="51%" height="22"> </td> <td width="21%"><input type="checkbox" name="cv2-cleaned-yes" id="cv2-cleaned-yes" /></td> <td width="28%"><input type="checkbox" name="cv2-cleaned-no" id="cv2-cleaned-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv2-replaced-yes" id="cv2-replaced-yes" /></td> <td><input type="checkbox" name="cv2-replaced-no" id="cv2-replaced-no" /></td> </tr> <tr> <td height="40"> </td> <td valign="bottom"><input type="checkbox" name="cv2-rkd-yes" id="cv2-rkd-yes" /></td> <td valign="bottom"><input type="checkbox" name="cv2-rkd-no" id="cv2-rkd-no" /></td> </tr> <tr> <td height="22"> </td> <td><input type="checkbox" name="cv2-springs-yes" id="cv2-springs-yes" /></td> <td><input type="checkbox" name="cv2-springs-no" id="cv2-springs-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv2-guide-yes" id="cv2-guide-yes" /></td> <td><input type="checkbox" name="cv2-guide-no" id="cv2-guide-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="cv2-other-yes" id="cv2-other-yes" /></td> <td><input type="checkbox" name="cv2-other-no" id="cv2-other-no" /></td> </tr> </table></td> <td width="20%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="56%" height="22"> </td> <td width="22%"><input type="checkbox" name="dprv-cleaned-yes" id="dprv-cleaned-yes" /></td> <td width="22%"><input type="checkbox" name="dprv-cleaned-no" id="dprv-cleaned-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="dprv-replaced-yes" id="dprv-replaced-yes" /></td> <td><input type="checkbox" name="dprv-replaced-no" id="dprv-replaced-no" /></td> </tr> <tr> <td height="40"> </td> <td valign="bottom"><input type="checkbox" name="dprv-rkd-yes" id="dprv-rkd-yes" /></td> <td valign="bottom"><input type="checkbox" name="dprv-rkd-no" id="dprv-rkd-no" /></td> </tr> <tr> <td height="22"> </td> <td><input type="checkbox" name="dprv-springs-yes" id="dprv-springs-yes" /></td> <td><input type="checkbox" name="dprv-springs-no" id="dprv-springs-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="dprv-guide-yes" id="dprv-guide-yes" /></td> <td><input type="checkbox" name="dprv-guide-no" id="dprv-guide-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="dprv-other-yes" id="dprv-other-yes" /></td> <td><input type="checkbox" name="dprv-other-no" id="dprv-other-no" /></td> </tr> </table></td> <td width="18%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="48%" height="22"> </td> <td width="28%"><input type="checkbox" name="pvb-cleaned-yes" id="pvb-cleaned-yes" /></td> <td width="24%"><input type="checkbox" name="pvb-cleaned-no" id="pvb-cleaned-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="pvb-replaced-yes" id="pvb-replaced-yes" /></td> <td><input type="checkbox" name="pvb-replaced-no" id="pvb-replaced-no" /></td> </tr> <tr> <td height="40"> </td> <td valign="bottom"><input type="checkbox" name="pvb-rkd-yes" id="pvb-rkd-yes" /></td> <td valign="bottom"><input type="checkbox" name="pvb-rkd-no" id="pvb-rkd-no" /></td> </tr> <tr> <td height="22"> </td> <td><input type="checkbox" name="pvb-springs-yes" id="pvb-springs-yes" /></td> <td><input type="checkbox" name="pvb-springs-no" id="pvb-springs-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="pvb-guide-yes" id="pvb-guide-yes" /></td> <td><input type="checkbox" name="pvb-guide-no" id="pvb-guide-no" /></td> </tr> <tr> <td> </td> <td><input type="checkbox" name="pvb-other-yes" id="pvb-other-yes" /></td> <td><input type="checkbox" name="pvb-other-no" id="pvb-other-no" /></td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="29"> </td> <td><table width="100%" height="29" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="18%"> </td> <td width="82%"><table width="100%" height="29" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="29%"> </td> <td width="19%" valign="top"><input name="valve-num" type="text" id="valve-num" size="12" style="height:14px;" /></td> <td width="14%"> <input type="checkbox" name="repaired" id="repaired" /> </td> <td width="15%"> <input type="checkbox" name="replaced" id="replaced" /> </td> <td width="23%"> <input type="checkbox" name="both-ok" id="both-ok" /> </td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="62"> </td> <td><table width="100%" height="60" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="18%"> </td> <td width="22%" valign="top"><table width="100%" height="41" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="25%" height="19"> </td> <td width="29%"> </td> <td width="20%"><input type="checkbox" name="ft-cv1-ct-yes" id="ft-cv1-ct-yes" /></td> <td width="26%"><input type="checkbox" name="ft-cv1-ct-no" id="ft-cv1-ct-no" /></td> </tr> <tr> <td colspan="3" align="center"><input name="ft-cv1-psid" type="text" id="ft-cv1-psid" size="8" /></td> <td> </td> </tr> </table></td> <td width="22%" valign="top"><table width="100%" height="41" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="25%" height="19"> </td> <td width="25%"> </td> <td width="24%" valign="top"><div style="padding-left:4px;"><input type="checkbox" name="ft-cv2-ct-yes" id="ft-cv2-ct-yes" /></div></td> <td width="26%"><input type="checkbox" name="ft-cv-ct-no" id="ft-cv2-ct-no" /></td> </tr> <tr> <td colspan="3" align="center"><input type="text" name="ft-cv2-psid" id="ft-cv2-psid" size="8" /></td> <td> </td> </tr> </table></td> <td width="20%" align="center"><input name="ft-dprv-psid" type="text" id="ft-dprv-psid" size="8" /></td> <td width="18%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="36%" height="22"> </td> <td colspan="2" align="center"><input name="ft-ai-psid" type="text" id="ft-ai-psid" size="4" /></td> <td width="3%"> </td> <td width="20%"> </td> </tr> <tr> <td height="25"> </td> <td width="14%"> </td> <td colspan="2" align="center"><input name="ft-cv-psid" type="text" id="ft-cv-psid" size="3" /></td> <td> </td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td colspan="3" height="32"></td> </tr> <tr> <td height="54"> </td> <td valign="bottom"><table width="100%" height="" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="49%" rowspan="2" valign="bottom"><textarea name="tc-info" cols="45" rows="1" id="tc-info"></textarea></td> <td width="51%" rowspan="2" valign="bottom"><textarea name="tc-info2" cols="40" rows="1" id="tc-info2"></textarea></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="37"> </td> <td valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-bottom:4px;"> <tr> <td width="23%"><input name="itb" type="text" id="itb" size="20" /></td> <td width="26%"><input name="certified-tester-num2" type="text" id="certified-tester-num2" size="15" /></td> <td width="26%"><input name="date-failed" type="text" id="date-failed" size="15" /></td> <td width="25%"><input name="tk-serial-num" type="text" id="tk-serial-num" size="20" /></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="39"> </td> <td valign="bottom"><table width="100%" height="33" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="23%"> </td> <td width="52%"> </td> <td width="25%"> </td> </tr> </table></td> <td> </td> </tr> <tr> <td height="38"> </td> <td valign="bottom"><table width="100%" height="32" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="23%"><input name="ftb" type="text" id="ftb" size="20" /></td> <td width="26%"><input name="ftb-certified-tester-num" type="text" id="ftb-certified-tester-num" size="20" /></td> <td width="26%"><input name="date-passed" type="text" id="date-passed" size="15" /></td> <td width="25%"><input name="ftb-tk-serial-num" type="text" id="ftb-tk-serial-num" size="20" /></td> </tr> </table></td> <td> </td> </tr> <tr> <td height="123"> </td> <td><textarea name="comments" id="comments" cols="105" rows="3"></textarea></td> <td> </td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> </form> Here is just a sample of the insert code that i have: <?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB"; $table = "sysform"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $water-purveyor = $_POST['water-purveyor']; $meter-num = $_POST['meter-num']; $permit-num = $_POST['permit-num']; $svb = $_POST['svb']; $pvb = $_POST['pvb']; $dc = $_POST['dc']; $rp = $_POST['rp']; $sql = "INSERT INTO $table ('water-purveyor', 'meter-num', 'permit-num','...', 'svb', 'pvb', 'dc', 'rp') VALUES ('$water-purveyor', '$meter-num', '$permit-num','$...', '$svb', '$pvb', '$dc', '$rp')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?> Can anyone help me on how to under stand how to sumbit the check box's to where i have a 1 or 0. Also i need to use the get function to pull the data back to the form. Here is the statment i have for that just as an example: <?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "myDB"; $table = "sysform"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $water-purveyor = $_POST['water-purveyor']; $meter-num = $_POST['meter-num']; $permit-num = $_POST['permit-num']; $svb = $_POST['svb']; $pvb = $_POST['pvb']; $dc = $_POST['dc']; $rp = $_POST['rp']; $sql="SELECT * from $table where sequence = '".$_GET["sequence"]."' "; $rs=mysql_query($sql,$conn) or die(mysql_error()); $result=mysql_fetch_array($rs); ?> <form action="" method="get"> <table width="1000" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="1400" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6%" height="168"> </td> <td width="87%"> </td> <td width="7%"> </td> </tr> <tr> <td height="37"> </td> <td><table width="100%" height="37" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="32%" valign="bottom"><input name="water-purveyor" type="text" id="water-purveyor" size="35" value="<?php echo '$water-purveyor'?>" /></td> <td width="29%" valign="bottom"><input name="meter-num" type="text" id="meter-num" size="10" value="<?php echo '$meter-num'?>" /></td> <td width="39%" valign="bottom"><input type="text" name="permit-num" id="permit-num" value="<?php echo '$permit-num'?>" /></td> </tr> </table> </form>
  9. Here is what i am trying to do. I have a dropdown (and or excel type look) that i need to pull data from the database. When i have an item selected i need to pass the info to the next page via a session. I have the drop down pulling from the database but i need to list Name and address in the dropdown. If this is not possible i can do a list of items from a search but i will need to make the id a link to pass the id to the next page where i need to build a report. If you can give me some info on this i would appreciate it. E here is what i have for code on the dropdown <?php // declare database connection variables. $host = "localhost"; $username = "root"; $password = ""; $db_name = "sample"; $tbl_name = "tbl_report"; // connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql = "SELECT id, name, address FROM $tbl_name"; $result = mysql_query($sql) or die(mysql_error()); $dropdown = "<form action='report.php' method='post'>"; $dropdown .= "<select name='items' class='select'>"; while ($row = mysql_fetch_assoc($result)) { $dropdown .= "\r\n<option value='{$row['type']}'>{$row['type']}</option>"; } $dropdown .= "\r\n</select>"; $dropdown .= "<input type='submit' name='submit' value='Submit'>"; $dropdown .= "</form>"; //closing the form tag echo $dropdown; ?> What i need to do is pass both the name and address to the drop down and in the value show the id. I need to pass the id to the next page which is report.php and there will be another sql that will run and get the info for the id and then pass to all the fields that i have on that page. I dont know how to set up the session for the id to follow. This is where i am getting confused.
  10. After doing some more research i think what i need is a session to pass the ID to the next page and put that into the sql code. If you know of a way to do that i am hoping someone can either direct me to an example or give me the code to pass that on. So what i need is the session to pass what is selected from a drop down and than to be put into the sql get to display the proper info on the form. I need this as i will have thousands of enterys into the table but need to select 1 to display on the form.
  11. Here is what i am trying to do. I have a client that wants to submit a form but he may need to go back and change one of the forms enterys. I set up the sql to pull the items that will view in a drop down. What i need to figure out is how to pass the id to another page and add that to the sql select * from table where id = (item selected in previous page) Then i need to display the the data into a form with text boxes and check boxes. If you can help me out with this i would appricate it. If you would like to see the demo of what i have done let me know and i can give you the url link to view everything and give some of the code. Thank you to anyone that can help me.
  12. I have tried the script at the top of the page and still the same thing. The page reloads and the same email address are shown. It doesn't mark them as "Y" it leaves them as "N".
  13. After reading some stuff online. I just wanted to clarify: $res2 = "update email_list set demo = 'Y' WHERE custid = '$id' LIMIT $limit"; The line of code above is supposed to update the selected items that will show on the page to be printed. Those items should be marked with a "Y". The first time i run the code it works but when i try to run the same code a second time with the same client which does happen as we have to do these reports at least 2 times a month for each client. The code doesn't do anything at all. This is my dilemma.
  14. The code looked promising but it didn't work. Here is what i am trying to do. I start off by marking leads with a client id. I put in some specif info and than i select the client id. I than print out the results on the screen with only so many selected. After the number is selected they should be marked with a Y for used to where they will not be used any longer. The only item i am trying to get to work is the emails i select to be marked as used so i can not use them again. Also the ID is an auto increment field so it is never empty or null. Here is the full code: <?php global $email_cnt ; $email_cnt=$_POST["email_cnt"]; global $campaign ; $campaign=$_POST["campaign"]; $file = 'export'; //`email_cnt` = '$email_cnt' //$sql="UPDATE comm_report SET `date` = '$date', `product` = '$product', `client_name` = '$client_name', `comm_check` = '$comm_check', `resid_check` = '$resid_check', `check_num_comm` = '$check_num_comm', `check_num_resid` = '$check_num_resid', `client_id` = '$client_id', `website_name` = '$website_name' //WHERE `crid` = '$crid'"; ?> <?php $con = mysql_connect("localhost","glennn_admin","olno5893"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("glennn_eric", $con); $id = (!empty($_POST['id'])) ? (int)$_POST['id'] : NULL; //$id = $_POST['id']; //$demo = $_POST['demo']; $demo = (!empty($_POST['demo']) && $_POST['demo'] == 'N') ? 'N' : 'Y'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php $result = mysql_query("SELECT campaign FROM campaign WHERE campaign='$id'"); while ($row = mysql_fetch_array($result)) { $title = $row['campaign']; } ?> <title><?php echo $title; ?></title> <link rel="stylesheet" href="print.css" type="text/css" media="print" /> <style type="text/css"> <!-- #font { font-family:Lucida Console; font-size:12px; } #center { float:left; width:500px; text-align:right; font-family:Lucida Console; font-size:12px; } #left { float:left; margin-left:0px; text-align:left; padding-right:0px; font-family:Lucida Console; font-size:12px; } #left2 { clear:left; width:250px; margin-left:0px; text-align:left; padding-right:0px; font-family:Lucida Console; font-size:12px; } #left3 { float:left; margin-left:0px; text-align:left; padding-right:0px; font-family:Lucida Console; font-size:12px; } #right { float:left; width:150px; text-align:left; font-family:Lucida Console; font-size:12px; } #clr { clear:both; height:15px; } --> </style> </head> <body> <div align="right"><form><input type="button" value=" Print this page " onclick="window.print();return false;" /></form> </div> <div id="main" class="print"> <!--<div align="right"><a href="javascript:windows.print()">Print</a></div>--> <!-- <input name="id" type="hidden" value="<?php echo $id ?>" /> --> </div> </div> <div id="clr" style="clear:both; height:15px;" class="print"></div> <div id="left" class="print"> General Statistics</div> <?php $result = mysql_query("SELECT * FROM campaign WHERE campaign='$id'"); while ($row = mysql_fetch_array($result)) { ?><br /> <br /> <div id="left" class="print"> Campaign Name: </div> <div id="left2" class="print"> <span class="font"><?php echo $row["campaign"]; ?></span></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Campaign Link: </div> <div id="left2" class="print"> Link to newsletter that was sent</div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Email Subject: </div> <div id="left2" class="print"> Slash Business Expenses!</div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Campaign sent by admin user: </div> <div id="left2" class="print"> admin </div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Email List sent to: </div> <div id="right" class="print"><?php echo $row["email_list"]; ?></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Start Time: <?php echo $row["tstart"]; ?></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Finish Time: <?php echo $row["tfinish"]; ?></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Campaign ID: <?php echo $row["campaign_id"]; ?></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">The Total Recipients: <?php echo $row["total"]; ?> download information to file</div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">The total who should receive this email if sending is successful: <?php echo $row["total"]; ?></div> <div id="clr" class="print"></div> <div id="left" class="print">The total rejected recipients: 0Download information to file/Download with server messages/Send</div> <div id="clr" class="print"></div> <div id="left" class="print">Percent who received mailing: 99%</div> <div id="clr" class="print"></div> <div id="left" class="print">Forward to a friend clicked: 0</div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print"> Read Ratio Statistics (HTML emails only)</div> <div id="clr" class="print"></div> <div id="left" class="print">Unique recipients who read email: <br /><?php echo $row["unique_recp"]; ?></div> <div id="clr" class="print"></div> <br /> <div id="left" class="print">Read Ratio Percentage: <?php $result = mysql_query("SELECT * FROM campaign where campaign='$id'"); while($ejw = mysql_fetch_array($result)) { $a = $row['unique_recp'] / $row['total']; echo round($a, 3) ."%"; } ?> </div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Number of times email was opened: <?php echo $row["emails_opened"]; ?></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Un-Subscribes: <?php echo $row["unsubscribes"]; ?></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print">Bounces: <?php echo $row["bounces"]; ?></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print"> Link Statistics (Click column to sort field)</div> <br /> <div id="left" class="print"> Domain name Clicks from this mailing Total clicks from this campaign Download/Send Subscribers <br /> Download/Send:Total clicks:2:2:</p> </div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print"> Most read recipients Top <?php echo $row["unique_recp"]; ?> (HTML Emails Only)</div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div class="print" id="font"> <?php $limit = 1; //set a default for limit, so that it will not EVER be empty. $limit = $row["unique_recp"]; //limit is not even required in this script, unless email_list has more than 1 email per user id. } if(empty($id)) { //exit the script if ID isn't set. exit('There is no ID to query'); } $res = mysql_query("SELECT emails FROM email_list WHERE custid = '$id' and demo = 'N' LIMIT $limit"); while ($row = mysql_fetch_array($res)) { echo "<div id=\"left\">".$row['emails']."</div><div id=\"clr\"></div>"; } //mysql_query($res); //You already performed this query, you cannot query a resource. $res2 = "update email_list set demo = 'Y' WHERE custid = '$id' LIMIT $limit"; //not sure you want to limit an update. mysql_query($res2); /*$res2 = "update email_list set 'demo' = 'Y' WHERE custid = '$id' LIMIT ".$limit.""; mysql_query($res2); //$upd2 = mysql_query("UPDATE email_list SET demo = 'Y' WHERE custid = '$id' LIMIT ".$limit." "); //mysql_query($upd2); /* // AND campaign.used != '1' LIMIT ".$limit." Joe $emails = array(); while ($row = mysql_fetch_assoc($res)) { $emails[] = $row['emails']; } foreach ($emails as $email) { // fwrite your $email } */ //$upd = "UPDATE email_list SET used = '1' WHERE used = '0' LIMIT ".$limit; /*$EJW ="UPDATE email_list SET demo = 'Y' WHERE custid = '$id' LIMIT ".$limit; mysql_error(); mysql_query($EJW); /*mysql_query("UPDATE Persons SET Age = '36' WHERE FirstName = 'Peter' AND LastName = 'Griffin'");*/ /* $fileName = $id.".txt"; $fileHandle = fopen($fileName, 'w') or die("can't open file"); $string = "Campaign Name:\n"; $string .= $campaign."\n\n\n"; $string .= "Campaign Link:\n"; $string .= "Link to newsletter that was sent\n\n\n"; $string .= "Email Subject:\n"; $string .= "Slash Business Expenses!\n\n\n"; $string .= "Campaign sent by admin user:\n"; $string .= "admin\n\n\n"; $string .= "Email List sent to:\n"; $string .= $email_list."\n\n\n"; $string .= "Start Time:\n"; $string .= $tstart."\n\n\n"; $string .= "Finish Time:\n"; $string .= $tfinish."\n\n\n"; $string .= "Campaign ID:\n"; $string .= $campaign_id."\n\n\n"; $string .= "The Total Recipients:\n"; $string .= $total."\n\n\n"; $string .= "The total who should receive this email if \n sending is successful:\n"; $string .= $total."\n\n\n"; $string .= "The total rejected recipients: 0 Download information \n to file/Download with server messages/Send\n\n\n"; $string .= "Percent who received mailing: 100%\n\n\n"; $string .= "Forward to a friend clicked: 0\n\n\n"; $string .= "Read Ratio Statistics (HTML emails only)\n\n\n"; $string .= "Unique recipients who read email:\n"; $string .= $unique_recp."\n\n\n"; $string .= "Read Ratio Percentage:\n"; $string .= $read_emails."\n\n\n"; $string .= "Number of times email was opened:\n"; $string .= $emails_opened."\n\n\n"; $string .= "un-subscribes:\n"; $string .= $unsubscribes."\n\n\n"; fwrite($fileHandle, $string); fclose($fileHandle); */ mysql_close($con); ?> </div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left" class="print"> Download all subscribers who read this email</div> <div id="clr" class="print"></div> <div id="left3" class="print">Send email to all subscribers who read this email</div> <div id="clr" class="print"></div> <div id="clr" class="print"></div> <div id="left3" class="print">Download all subscribers who did NOT read this email</div> <div id="clr" class="print"></div> <div id="left3" class="print">Send email to all subscribers who did NOT read this email</div> </div> <br /> <br /> <br /> </body> </html>
  15. At this time i am building an email generation report program. I have everything working for the first and second report. But when i try to update and get the 3 run of emails it doesnt update the previous one. below you will find the code that i have been working on and i have everything working except for the update to run every single time. $con = mysql_connect("test","test","test"); // $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); // mysql_select_db("test", $con); $id = $_POST['id']; $demo = $_POST['demo']; $limit = $row["unique_recp"]; } $res = mysql_query("SELECT emails FROM email_list WHERE custid = '$id' and demo = 'N' LIMIT ".$limit." "); while ($row = mysql_fetch_array($res)) { echo "<div id=\"left\">".$row['emails']."</div><div id=\"clr\"></div>"; } mysql_query($res); $res2 = "update email_list set demo = 'Y' WHERE custid = '$id' LIMIT ".$limit.""; mysql_query($res2); mysql_close($con); I have put in test for the actual data. Let me know if you can figure out what is going on? If you need to see the enter code i can send it.
×
×
  • 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.