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.
×
×
  • 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.