JTapp
Members-
Posts
251 -
Joined
-
Last visited
Everything posted by JTapp
-
I think you got the table names right - it should be: a = tblLodges b = tblDistricts c = DistrictOfficers I plugged it in and I'm getting the same result as before - no error messages but no data either.. I also just triple checked the spelling on my table names and fields....
-
I removed the dual query, but I'm still getting a blank page with no error messages...
-
Well, now I'm not getting any error message at all.. I'm just getting a blank page. You asked for it... here is my (beginner's) attempt at my LEFT JOIN - <?php $username = "username"; $password = "password"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("db",$dbhandle) or die("Could not select db"); $query = mysql_query("SELECT a.strLodgeName, a.intLodgeNumber, a.intDistrictID, a.strLodgeMailingCity, a.strLodgeMailingPostCode, b.strOfficerTitle, b.strDistrictName, b.strDistrictWebSite, c.strOfficerTitle, c.strFirstName, c.strLastName FROM tblLodges intDistrictID LEFT JOIN tblDistricts intDistrictID ON tblDistricts.intDistrictID = DistrictOfficers.lngLodgeID WHERE DistrictOfficers.intDistrictID=$id GROUP BY a.strLodgeName LIMIT 50"); $result = mysql_query($query) or die(mysql_error()); while ($row = @mysql_fetch_array($query)){ { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["strOfficerTitle"]; echo "</center></td><td><center>"; echo $row["strDistrictName"]; echo "</center></td><td><center>"; echo $row["strDistrictWebSite"]; echo "</center></td><td><center>"; echo $row["strOfficerTitle"]; echo "</center></td><td><center>"; echo $row["strFirstName"]; echo "</center></td><td><center>"; echo $row["strLastName"]; } { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='5view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0'); }?>
-
I don't know.. maybe it's not even a LEFT JOIN that I need to do... Can somebody take a look ? I currently have a working form that successfully returns the results I want from one table in my DB. However, I now have to add another chart to my results page and its data has to come from two different DB tables based on the same primary field name (all three tables have the same primary field - which is intDistrictID). I keep getting crazy error messages from MySql telling me to check and see if my version accepts the code. I thought it would be simple.. tblDistricts - has two fields I need added to my results page called "strDistrictName" and "strDistrictWebsite" DistrictOfficers - has three fields I need returned on the same page called "strOfficerTitle", "strFirstName" and "strLastName" Below is my cleaned up (at least I tried) form code: <form name="form1" method ="post" action="results.php" target="_blank"> <p class="style1"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="#000000"> <p> </p> <p align="center"> <input type="hidden" name="metode" value="tblLodges.intDistrictID"/> </select> <p> </p> <span class="style9">Enter District Number:</span> <input name="search" type="text" class="form" size="5"> </p> <input type="submit" value="Click Here To View District Details" name="Go"> </p> <p align="center"> </p></td> </tr> </table> </form> Below is my cleaned up results.php code (you will probably disagree about it being clean): $query = mysql_query("SELECT strLodgeName, intLodgeNumber, intDistrictID, strLodgeMailingCity, strLodgeMailingPostCode FROM tblLodges WHERE TRIM(LEADING '0' FROM $metode) = '$search' GROUP BY strLodgeName LIMIT 50"); while ($row = @mysql_fetch_array($query)) { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='5view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0'); }?> //query details table begins $query = mysql_query("SELECT tblDistricts.intDistrictID, tblDistricts.strDistrictWebsite, tblDistricts.strDistrictName, DistrictOfficers.intDistrictID, DistrictOfficers.strOfficerTitle, DistrictOfficers.strFirstName, DistrictOfficers.strLastName, DistrictOfficers.OfficePhone, DistrictOfficers.Email FROM tblDistricts LEFT JOIN DistrictOfficers ON tbleDistricts.intDistrictID = DistrictOfficers.intDistrictID WHERE tblDistricts.strDistrictName=$id")or die(mysql_error()); echo "<center>\n"; echo "<H2>Roster of District Officers</H2>\n"; echo "<table border='1'> <tr> <th>District Number</th> <th>Officer Title</th> <th>Officer First</th> <th>Officer Last</th> <th>Officer Email</th> <th>Officer Phone</th> </tr>"; if (mysql_num_rows($query)) { while ($row = mysql_fetch_array($query)) { $variable1=$row["intDistrictID"]; $variable2=$row["strOfficerTitle"]; $variable3=$row["strFirstName"]; $variable4=$row["strLastName"]; $variable5=$row["Email"]; $variable6=$row["OfficePhone"]; //table layout for results print("<tr>"); echo "<tr align=\"center\" bgcolor=\"#EFEFEF\">\n"; echo "<td class=\"td_id\">$variable1</td>\n"; echo "<td class=\"td_id\">$variable2</td>\n"; echo "<td class=\"td_id\">$variable3</td>\n"; echo "<td class=\"td_id\">$variable4</td>\n"; echo "<td class=\"td_id\">$variable5</td>\n"; echo "<td class=\"td_id\">$variable6</td>\n"; print("</tr>"); } } ?> <p> </p> </center> <center> <hr> <br /> <br /> <table border="1" cellpadding="4" cellspacing="0" width="56%"> <tbody> <tr> <td colspan="5" bgcolor="FFFF99" height="18"><center> <strong>District Lodges </strong> </center></td> </tr> <tr> <td width="18%" height="18" align="center" bgcolor="FFFF99"> <div align="center">Lodge ID Number </div></td> <td width="16%" height="18" align="center" bgcolor="FFFF99"> <div align="center">Lodge Name </div></td> <td width="26%" align="center" bgcolor="FFFF99"> <div align="center">Click Button To View Lodge Details </div></td> <td width="21%" height="18" align="center" bgcolor="FFFF99"> <div align="center">City </div></td> <td width="19%" height="18" align="center" bgcolor="FFFF99"> <div align="center">District Number </div></td> </tr> <?php $query = mysql_query("SELECT strLodgeName, intLodgeNumber, intDistrictID, strLodgeMailingCity, strLodgeMailingPostCode FROM tblLodges WHERE TRIM(LEADING '0' FROM $metode) = '$search' GROUP BY strLodgeName LIMIT 50"); while ($row = @mysql_fetch_array($query)) { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='5view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0'); }?>
-
[SOLVED] Two forms on one page.. any tips or tricks?
JTapp replied to JTapp's topic in PHP Coding Help
search2 was the problem... Thank you very much!!! -
[SOLVED] Two forms on one page.. any tips or tricks?
JTapp replied to JTapp's topic in PHP Coding Help
Here is my online testing page: http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/5search.php The second form - closer to the bottom (District Details), works fine - use "6" if you want to try it out. The first form (Lodge Locater) DOES NOT WORK - parameters to try are: "Tuscan" for 'Name of Lodge' or "6" for 'District Lodge is In'. The first form is pointed to 3results.php and I posted the code earlier, but here it is: The code works fine when it is the only form on the page.... <?php $username = "username"; $password = "password"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("database",$dbhandle) or die("Could not select database"); $query = mysql_query("SELECT strLodgeName, intLodgeNumber, intDistrictID, strLodgeMailingCity, strLodgeMailingPostCode FROM tblLodges WHERE TRIM(LEADING '0' FROM $metode) = '$search' GROUP BY strLodgeName LIMIT 50"); while ($row = @mysql_fetch_array($query)) { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='3view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0'); }?> Thanks for your time! -
[SOLVED] Two forms on one page.. any tips or tricks?
JTapp replied to JTapp's topic in PHP Coding Help
Hitman - I use Dreamweaver and cleaned it up via their "clean up html" option. 13 corrections were made. In addition, I tried your edits, but no go.... -
[SOLVED] Two forms on one page.. any tips or tricks?
JTapp replied to JTapp's topic in PHP Coding Help
doni49 - I tried your suggestion.. but no go.. thanks though. -
[SOLVED] Two forms on one page.. any tips or tricks?
JTapp replied to JTapp's topic in PHP Coding Help
Here is the PHP code - again, I'm new.. be gentle with me on my sloppy code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td width="100%"><p align="center"><span class="style2"> Grand Lodge of Florida Lodge Locator</span><br /> </p></td> </tr> </tbody> </table> <center> </center> <center> <br /> <br /> <table border="1" cellpadding="4" cellspacing="0" width="86%"> <tbody> <tr> <td colspan="5" bgcolor="FFFF99" height="18"><center> <strong>Results Of Your Search </strong> </center></td> </tr> <tr> <td width="13%" height="18" align="center" bgcolor="FFFF99"><center> Lodge ID Number </center></td> <td width="19%" height="18" align="center" bgcolor="FFFF99"><center> Lodge Name </center></td> <td width="20%" align="center" bgcolor="FFFF99"> Click Button To View <strong>Lodge Details </strong></td> <td width="18%" height="18" align="center" bgcolor="FFFF99"><center> City </center></td> <td width="10%" height="18" align="center" bgcolor="FFFF99"><center> District Number </center></td> </tr> <?php $username = "username"; $password = "password"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("database",$dbhandle) or die("Could not select database"); $query = mysql_query("SELECT strLodgeName, intLodgeNumber, intDistrictID, strLodgeMailingCity, strLodgeMailingPostCode FROM tblLodges WHERE TRIM(LEADING '0' FROM $metode) = '$search' GROUP BY strLodgeName LIMIT 50"); while ($row = @mysql_fetch_array($query)) { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='3view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0'); }?> </tbody> </table> <br /> </center> </body> </html> -
[SOLVED] Two forms on one page.. any tips or tricks?
JTapp replied to JTapp's topic in PHP Coding Help
Well, here is the code (it's immature because I'm new at this). The second form works, but the first form - with the methode list returns nothing - regardless of what search parameters I put. <form method="post" action="http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/3results.php"; target="_blank"> <p class="style1"> </p> <p class="style1"><img src="ldgePhotos/lodgelocator.gif" alt="LodgeLocator" width="370" height="53"></p> <p class="style1"> </p> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="544" height="183"> <p align="center"> <select name="metode" size="6"> <option value="tblLodges.strLodgeName" selected>Name of Lodge</option> <option value="tblLodges.intLodgeNumber">Lodge Number</option> <option value="tblLodges.intDistrictID">District Lodge Is In</option> <option value="tblLodges.strLodgeMailingCity">City Lodge Is Located In</option> <option value="tblLodges.strLodgeMailingPostCode">Zip Code of Lodge Location</option> <option value="tblLodges.strLodgeCounty">Lodge Parish</option> </select> <span class="style9">Search Value:</span> <input name="search2" type="text" class="form" size="25"> </p> <p align="center"> </p> <div align="center"> <input type="submit" value="Click Here To Search Our Lodge Locator!!" name="GOTWO"> </p> </div></td> </tr> </table> <hr> </form></td> <p> </p> <table class="auto" width="811"> <tr> <td width="803" height="510" class="row2"> <table width="79%" height="58%"> <tr> <td height="245" bgcolor="#E9E7D8" valign="top"> <table cellpadding="0" cellspacing="0" border="2" style=" height:25%;" height="57%" width="102%"> <tr valign="top" bgcolor="#E9E7D8"> <td height="194" align="center" valign="middle" bordercolor="#666633"> <form method="post" action="http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/5results.php"; target="_blank"> <p class="style1"><img src="ldgePhotos/districtdetails.gif" alt="distdetails" width="370" height="53"></p> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="#000000"> <p> </p> <p align="center"> <input type="hidden" name="metode" value="tblLodges.intDistrictID"/> </select> <p> </p> <p align="center"<span class="style9">Enter District Number:</span> <input name="search" type="text" class="form" size="5"> </p> <div align="center"> <input type="submit" value="Click Here To View District Details" name="Go"> </p> <p align="center"> </p></td> </tr> </table> </form></td> -
I'm trying to make two forms work on one page. They are both comprehensive search forms - one returns results from two tables, the other returns results from three other tables. Does anybody have any suggestions or links for me.. I can only get one form to work. Thanks!
-
Very simple change from drop down box/multiple options to one option
JTapp replied to JTapp's topic in PHP Coding Help
OK - Test Data is located at: http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/5search.php The bottom form is the only one that is currently working. To see it working -- use "District" 6. Here is the code for 5search.php: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <!-- DW6 --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Grand Lodge of Florida </title> <link href="../style.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style2 {color: #E0DEBF} body { background-color: #E1E3C0; } .style9 { font-size: 16px; font-weight: bold; } --> </style> </head> <body id="page1"> <table width="128%" style="height:672px;" height="505"> <tr> <td height="1161"> <table id="main" align="center" width="817" height="909"> <tr bgcolor="#FFFF99"> <td width="809" height="147" bgcolor="#FFFF99"><img src="../Images/header2.png" width="766" height="128"> <!--Valid flash version 8.0--> </td> </tr> <tr> <td id="content" height="754"> <!--|**START IMENUS**|imenus0,inline--><div id="dreamweaver_design_view_show" style="display:none;width:762px;height:23px;">Infinite Menus Place Holder (Dreamweaver Design View)</div><div id="dreamweaver_design_view_hide"> <!-- ****** Infinite Menus Core CSS [Do Not Modify!] ****** --> <style type="text/css">.imcm ul,.imcm li,.imcm div,.imcm span,.imcm a{text-align:left;vertical-align:top;padding:0px;margin:0;list-style:none outside none;border-style:none;background-image:none;clear:none;float:none;display:block;position:static;overflow:visible;line-height:normal;}.imcm li a img{display:inline;border-width:0px;}.imcm span{display:inline;}.imcm .imclear,.imclear{clear:both;height:0px;visibility:hidden;line-height:0px;font-size:1px;}.imcm .imsc{position:relative;}.imcm .imsubc{position:absolute;visibility:hidden;}.imcm ul ul{position:relative;}.imcm li{list-style:none;font-size:1px;float:left;}.imcm ul ul li{width:100%;float:none !important;}.imcm a{display:block;position:relative;}.imcm ul .imsc,.imcm ul .imsubc {z-index:10;}.imcm ul ul .imsc,.imcm ul ul .imsubc{z-index:20;}.imcm ul ul ul .imsc,.imcm ul ul ul .imsubc{z-index:30;}.imde ul li:hover .imsubc{visibility:visible;}.imde ul ul li:hover .imsubc{visibility:visible;}.imde ul ul ul li:hover .imsubc{visibility:visible;}.imde li:hover ul .imsubc{visibility:hidden;}.imde li:hover ul ul .imsubc{visibility:hidden;}.imde li:hover ul ul ul .imsubc{visibility:hidden;}.imcm .imea{display:block;position:relative;left:0px;font-size:1px;line-height:1px;height:0px;width:1px;float:right;}.imcm .imea span{display:block;position:relative;font-size:1px;line-height:0px;}.dvs,.dvm{border-width:0px}/*\*//*/.imcm .imea{visibility:hidden;}/**/</style><!--[if IE]><style type="text/css">.imcm .imea span{position:absolute;}.imcm .imclear,.imclear{display:none;}.imcm{zoom:1;} .imcm li{curosr:hand;} .imcm ul{zoom:1}.imcm a{zoom:1;}</style><![endif]--><!--[if gte IE 7]><style type="text/css">.imcm .imsubc{background-image:url(ie_css_fix);}</style><![endif]--> <style type="text/css"> /* --[[ Main Expand Icons ]]-- */ #imenus0 .imeam span,#imenus0 .imeamj span {background-image:url(../Images/sample1_main_arrow.gif); width:15px; height:14px; left:-15px; top:0px; background-repeat:no-repeat;background-position:top left;} #imenus0 li:hover .imeam span,#imenus0 li a.iactive .imeamj span {background-image:url(../Images/sample1_main_arrow.gif); background-repeat:no-repeat;background-position:top left;} /* --[[ Sub Expand Icons ]]-- */ #imenus0 ul .imeas span,#imenus0 ul .imeasj span {background-image:url(../Images/sample1_sub_arrow.gif); width:14px; height:14px; left:-14px; top:0px; background-repeat:no-repeat;background-position:top left;} #imenus0 ul li:hover .imeas span,#imenus0 ul li a.iactive .imeasj span {background-image:url(../Images/sample1_sub_arrow.gif); background-repeat:no-repeat;background-position:top left;} /* --[[ Main Container ]]-- */ #imouter0 {background-color:#e6ede7; border-style:solid; border-color:#518145; border-width:1px; padding:0px; } /* --[[ Sub Container ]]-- */ #imenus0 li ul {background-color:#e6ede7; border-style:solid; border-color:#546642; border-width:6px; padding:5px; } /* --[[ Main Items ]]-- */ #imenus0 li a, #imenus0 .imctitle {color:#333333; text-align:center; font-family:MicrosoftSansSerif; font-size:14px; font-weight:bold; font-style:normal; text-decoration:none; border-style:none; border-color:#000000; border-width:0px; padding:2px 5px; } /* [hover] - These settings must be duplicated for IE compatibility.*/ #imenus0 li:hover>a {background-color:#546642; color:#cfcfcf; } #imenus0 li a.ihover, .imde imenus0 a:hover {background-color:#546642; color:#cfcfcf; } /* [active] */ #imenus0 li a.iactive {} /* --[[ Sub Items ]]-- */ #imenus0 ul a, #imenus0 .imsubc li .imctitle {color:#111111; text-align:left; font-family:MSSansSerif; font-size:14px; font-weight:bold; font-style:normal; text-decoration:none; border-style:none; border-color:#000000; border-width:1px; padding:2px 5px; } /* [hover] - These settings must be duplicated for IE comptatibility.*/ #imenus0 ul li:hover>a {background-color:#546642; color:#cfcfcf; } #imenus0 ul li a.ihover {background-color:#546642; color:#cfcfcf; } /* [active] */ #imenus0 ul li a.iactive {text-decoration:underline; } </style> <!-- ****** Infinite Menus Structure & Links ***** --> <div class="imrcmain0 imgl" style="width:762px;z-index:999999;position:relative;"><div class="imcm imde" id="imouter0"><ul id="imenus0"> <li class="imatm" style="width:105px;"><a href="#">Home</a></li> <li class="imatm" style="width:191px;"><a class="" href="#"><span class="imea imeam"><span></span></span>Grand Lodge</a> <div class="imsc"><div class="imsubc" style="width:213px;top:0px;left:1px;"><ul style=""> <li><a href="#"><span class="imea imeas"><span></span></span>Awards and Programs</a> <div class="imsc"><div class="imsubc" style="width:174px;top:-21px;left:184px;"><ul style=""> <li><a href="#">Achievement Award</a></li> <li><a href="#">Child ID Program</a></li> <li><a href="#">FA-100 Program</a></li> <li><a href="#">MH - 100 Program</a></li> <li><a href="#">Perpetual Membership</a></li> <li><a href="#">Scholarship Essay</a></li> </ul></div></div></li> <li><a class="" href="#"><span class="imea imeas"><span></span></span>Charities</a> <div class="imsc"><div class="imsubc" style="width:146px;top:-21px;left:185px;"><ul style=""> <li><a href="#">Masonic Research Laboratory</a></li> <li><a href="#">Planned Giving</a></li> </ul></div></div></li> <li><a href="#">City of Jacksonville</a></li> <li><a href="#"><span class="imea imeas"><span></span></span>Contact Information</a> <div class="imsc"><div class="imsubc" style="width:135px;top:-21px;left:190px;"><ul style=""> <li><a href="#">Contact Us</a></li> <li><a href="#">Districts</a></li> <li><a href="#">Information Request Form</a></li> <li><a href="#">Office Personnel</a></li> </ul></div></div></li> <li><a href="#"><span class="imea imeas"><span></span></span>Ever Consider Joining?</a> <div class="imsc"><div class="imsubc" style="width:258px;top:-21px;left:186px;"><ul style=""> <li><a href="#">Considering Becoming A Mason?</a></li> <li><a href="#">Famous Masons</a></li> <li><a href="#">What is Freemasonry?</a></li> <li><a href="#">When is a Man a Mason?</a></li> <li><a href="#">Why I Joined</a></li> </ul></div></div></li> <li><a href="#"><span class="imea imeas"><span></span></span>Florida Mason Magazine</a> <div class="imsc"><div class="imsubc" style="width:171px;top:-21px;left:183px;"><ul style=""> <li><a href="#">About the Magazine</a></li> <li><a href="#">Suggestions for Masonic Articles</a></li> <li><a href="#">Writing Guidelines</a></li> </ul></div></div></li> <li><a href="#">Florida Masonic Home</a></li> <li><a href="#"><span class="imea imeas"><span></span></span>Grand Lodge Officers</a> <div class="imsc"><div class="imsubc" style="width:227px;top:-21px;left:191px;"><ul style=""> <li><a href="#">Lodge Officers</a></li> <li><a href="#">Letter from Our Grand Master</a></li> <li><a href="#">Calendars</a></li> <li><a href="#">Grand Communication</a></li> </ul></div></div></li> <li><a href="#">Guest Book</a></li> <li><a href="#"><span class="imea imeas"><span></span></span>History</a> <div class="imsc"><div class="imsubc" style="width:169px;top:-21px;left:188px;"><ul style=""> <li><a href="#">Historical Overview</a></li> <li><a href="#">Past Officers</a></li> </ul></div></div></li> <li><a href="#"><span class="imea imeas"><span></span></span>Other Links</a> <div class="imsc"><div class="imsubc" style="width:191px;top:-21px;left:191px;"><ul style=""> <li><a href="#">Shrine</a></li> <li><a href="#">York Rite</a></li> </ul></div></div></li> <li><a href="#">Photo Gallery</a></li> </ul></div></div></li> <li class="imatm" style="width:124px;"><a href="#">Lodge Locator</a></li> <li class="imatm" style="width:168px;"><a href="#"><span class="imea imeam"><span></span></span>Grand Secretary</a> <div class="imsc"><div class="imsubc" style="width:168px;top:0px;left:0px;"><ul style=""> <li><a href="#">Overview</a></li> <li><a href="#"><span class="imea imeas"><span></span></span>Book Store</a> <div class="imsc"><div class="imsubc" style="width:143px;top:-21px;left:146px;"><ul style=""> <li><a href="#">Registration for Supplies</a></li> <li><a href="#">No-Cost Supplies Order Form</a></li> </ul></div></div></li> <li><a href="#">Florida Annual Directory</a></li> <li><a href="#">Reporting Forms</a></li> </ul></div></div></li> <li class="imatm" style="width:172px;"><a href="#"><span class="imea imeam"><span></span></span>Masonic Education </a> <div class="imsc"><div class="imsubc" style="width:173px;top:;left:;"><ul style=""> <li><a href="#">John the Baptist</a></li> <li><a href="#">John the Evangelist</a></li> <li><a href="#">Masonic Glossary</a></li> <li><a href="#"><span class="imea imeas"><span></span></span>Masonic Education</a> <div class="imsc"><div class="imsubc" style="width:159px;top:-21px;left:140px;"><ul style=""> <li><a href="#">Master Mason Quiz</a></li> <li><a href="#">Lodge Officers Training Course</a></li> <li><a href="#">Comment Form</a></li> </ul></div></div></li> </ul></div></div></li> </ul><div class="imclear"> </div></div></div> <!--[imcode]*** Infinite Menus Settings / Code - This script reference must appear last. *** *Note: This script is required for scripted add on support and IE 6 sub menu functionality. *Note: This menu will fully function in all CSS2 browsers with the script removed.--> <script language="JavaScript" src="../ocscript.js" type="text/javascript"></script> </div><!--|**END IMENUS**|--> <table class="auto" width="811"> <tr> <td width="803" height="510" class="row2"> <table width="79%" height="58%"> <tr> <td height="345" bgcolor="#E9E7D8" valign="top"> <table cellpadding="0" cellspacing="0" border="5" style=" height:25%;" height="105%" width="102%"> <tr valign="top" bordercolor="#660000" bgcolor="#E9E7D8"> <td height="234" align="center" valign="middle" bordercolor="#666633"> <form method="post" action="http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/3results.php"; target="_blank"> <p class="style1"> </p> <p class="style1"><img src="ldgePhotos/lodgelocator.gif" alt="LodgeLocator" width="370" height="53"></p> <p class="style1"> </p> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="544" height="183"> <p align="center"> <select name="metode" size="6"> <option value="tblLodges.strLodgeName" selected>Name of Lodge</option> <option value="tblLodges.intLodgeNumber">Lodge Number</option> <option value="tblLodges.intDistrictID">District Lodge Is In</option> <option value="tblLodges.strLodgeMailingCity">City Lodge Is Located In</option> <option value="tblLodges.strLodgeMailingPostCode">Zip Code of Lodge Location</option> <option value="tblLodges.strLodgeCounty">Lodge Parish</option> </select> <span class="style9">Search Value:</span> <input name="search2" type="text" class="form" size="25"> </p> <p align="center"> </p> <div align="center"> <input type="submit" value="Click Here To Search Our Lodge Locator!!" name="GOTWO"> </p> </div></td> </tr> </table> <hr> </form></td> <p> </p> <table class="auto" width="811"> <tr> <td width="803" height="510" class="row2"> <table width="79%" height="58%"> <tr> <td height="245" bgcolor="#E9E7D8" valign="top"> <table cellpadding="0" cellspacing="0" border="2" style=" height:25%;" height="57%" width="102%"> <tr valign="top" bgcolor="#E9E7D8"> <td height="194" align="center" valign="middle" bordercolor="#666633"> <form method="post" action="http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/5results.php"; target="_blank"> <p class="style1"><img src="ldgePhotos/districtdetails.gif" alt="distdetails" width="370" height="53"></p> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="#000000"> <p> </p> <p align="center"> <input type="hidden" name="metode" value="tblLodges.intDistrictID"/> </select> <p> </p> <p align="center"<span class="style9">Enter District Number:</span> <input name="search" type="text" class="form" size="5"> </p> <div align="center"> <input type="submit" value="Click Here To View District Details" name="Go"> </p> <p align="center"> </p></td> </tr> </table> </form></td> <p> </p> <p> </p> <p> </p> <p> </p> </tr> <tr bordercolor="#660000" border="5"> <td height="24" valign="top" bgcolor="#FFFF99"> </td> </tr> <tr bordercolor="#660000" border="5"> <td height="64" valign="top" bgcolor="#546642"> <div align="center"><span class="style2"><b><br> <font color="#CCCCCC">Copyright © Grand Lodge of Florida, 2008, All Rights Reserved<br> <br> </font></b><font color="#CCCCCC"> 220 North Ocean Street * Jacksonville, FL 32202 · <font color="#CCCCCC">Phone: 318-443-5610 · Fax: 318-443-5759</font><a href="mailto:info@la-mason.com"><br> </a></font></span><a href="mailto:info@glflamason.org">Email the Grand Lodge</a> <span class="style2"> | Disclaimer of Liability | Site Map<font color="#CCCCCC"> | How To... <br> </font></span></div></td> </tr> </table></td> </tr> </table></td> </tr> </table></tr> </table> </td> </tr> </table> </body> </html> Here is the code for 5results.php <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td width="100%"><p align="center"><span class="style2"> Grand Lodge of Florida Lodge Locator</span><br /> </p></td> </tr> </tbody> </table> <center> </center> <center> <br /> <br /> <table border="1" cellpadding="4" cellspacing="0" width="86%"> <tbody> <tr> <td colspan="5" bgcolor="FFFF99" height="18"><center> <strong>Results Of Your Search </strong> </center></td> </tr> <tr> <td width="13%" height="18" align="center" bgcolor="FFFF99"><center> Lodge ID Number </center></td> <td width="19%" height="18" align="center" bgcolor="FFFF99"><center> Lodge Name </center></td> <td width="20%" align="center" bgcolor="FFFF99"> Click Button To View Lodge Details </td> <td width="18%" height="18" align="center" bgcolor="FFFF99"><center> City </center></td> <td width="10%" height="18" align="center" bgcolor="FFFF99"><center> District Number </center></td> </tr> <?php $username = "username"; $password = "password"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("database",$dbhandle) or die("Could not select database"); $query = mysql_query("SELECT strLodgeName, intLodgeNumber, intDistrictID, strLodgeMailingCity, strLodgeMailingPostCode FROM tblLodges WHERE TRIM(LEADING '0' FROM $metode) = '$search' GROUP BY strLodgeName LIMIT 50"); while ($row = @mysql_fetch_array($query)) { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='5view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0'); }?> </tbody> </table> <br /> </center> </body> </html> Here is the code for 3results.php (note the 3results.php and the 5results.php pages look alike because I haven't finished what I'm doing): <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td width="100%"><p align="center"><span class="style2"> Grand Lodge of Florida Lodge Locator</span><br /> </p></td> </tr> </tbody> </table> <center> </center> <center> <br /> <br /> <table border="1" cellpadding="4" cellspacing="0" width="86%"> <tbody> <tr> <td colspan="5" bgcolor="FFFF99" height="18"><center> <strong>Results Of Your Search </strong> </center></td> </tr> <tr> <td width="13%" height="18" align="center" bgcolor="FFFF99"><center> Lodge ID Number </center></td> <td width="19%" height="18" align="center" bgcolor="FFFF99"><center> Lodge Name </center></td> <td width="20%" align="center" bgcolor="FFFF99"> Click Button To View <strong>Lodge Details </strong></td> <td width="18%" height="18" align="center" bgcolor="FFFF99"><center> City </center></td> <td width="10%" height="18" align="center" bgcolor="FFFF99"><center> District Number </center></td> </tr> <?php $username = "username"; $password = "password"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("database",$dbhandle) or die("Could not select database"); $query = mysql_query("SELECT strLodgeName, intLodgeNumber, intDistrictID, strLodgeMailingCity, strLodgeMailingPostCode FROM tblLodges WHERE TRIM(LEADING '0' FROM $metode) = '$search' GROUP BY strLodgeName LIMIT 50"); while ($row = @mysql_fetch_array($query)) { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='3view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0'); }?> </tbody> </table> <br /> </center> </body> </html> -
Very simple change from drop down box/multiple options to one option
JTapp replied to JTapp's topic in PHP Coding Help
I tried removing the "select", but both forms still won't work....only the bottom one will... -
Very simple change from drop down box/multiple options to one option
JTapp replied to JTapp's topic in PHP Coding Help
It worked but I have a new problem... I'm thinking there is no way that change created the problem but I thought I would ask. I swear last night I had both forms working!!! Basically, the code below (as immature as it may be- given I'm a beginner) has two search forms. This morning the first form - pointing to 3results.php just stopped working... any thoughts? <form method="post" action="http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/3results.php"; target="_blank"> <p class="style1"> </p> <p class="style1"><img src="ldgePhotos/lodgelocator.gif" alt="LodgeLocator" width="370" height="53"></p> <p class="style1"> </p> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="544" height="183"> <p align="center"> <select name="metode" size="6"> <option value="tblLodges.strLodgeName" selected>Name of Lodge</option> <option value="tblLodges.intLodgeNumber">Lodge Number</option> <option value="tblLodges.intDistrictID">District Lodge Is In</option> <option value="tblLodges.strLodgeMailingCity">City Lodge Is Located In</option> <option value="tblLodges.strLodgeMailingPostCode">Zip Code of Lodge Location</option> <option value="tblLodges.strLodgeCounty">Lodge Parish</option> </select> <span class="style9">Search Value:</span> <input name="search2" type="text" class="form" size="25"> </p> <p align="center"> </p> <div align="center"> <input type="submit" value="Click Here To Search Our Lodge Locator!!" name="GOTWO"> </p> </div></td> </tr> </table> <hr> </form></td> <p> </p> <table class="auto" width="811"> <tr> <td width="803" height="510" class="row2"> <table width="79%" height="58%"> <tr> <td height="245" bgcolor="#E9E7D8" valign="top"> <table cellpadding="0" cellspacing="0" border="2" style=" height:25%;" height="57%" width="102%"> <tr valign="top" bgcolor="#E9E7D8"> <td height="194" align="center" valign="middle" bordercolor="#666633"> <form method="post" action="http://www.glflamason.org/NEWSITE/NEW2/lodgelocator/5results.php"; target="_blank"> <p class="style1"><img src="ldgePhotos/districtdetails.gif" alt="distdetails" width="370" height="53"></p> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="#000000"> <p> </p> <p align="center"> <input type="hidden" name="metode" value="tblLodges.intDistrictID"/> </select> <p> </p> <p align="center"<span class="style9">Enter District Number:</span> <input name="search" type="text" class="form" size="5"> </p> <div align="center"> <input type="submit" value="Click Here To View District Details" name="Go"> </p> <p align="center"> </p></td> </tr> </table> </form></td> -
Or so it would seem.. I'm just too new to know... I have to change my search form that has a multiple option metode drop down box to - no drop down/no need to select the item/one option only search field where the user types in the value.. can you recommend how to change my code? It seems I have to rename "option value"...? <select name="metode" size="5"> <option value="TableName.FieldName">Client City</option> </select>
-
I have the same problem but can't find the reference to Jpmaster 77.. can you post a link?
-
themistral - can you further elaborate or send me a link to an example of what you are talking about? Thanks
-
I don't know- maybe I'm just exhausted looking and testing this script... but I can't get it right. I simply need to add another submit button to this script based on field name "intDistrictID" and pointed to 4view.php Is there some reason why I wouldn't be able to do it? $query = mysql_query("SELECT strLodgeName, intLodgeNumber, intDistrictID, strLodgeMailingCity, strLodgeMailingPostCode FROM tblLodges WHERE TRIM(LEADING '0' FROM $metode) = '$search' GROUP BY strLodgeName LIMIT 50"); while ($row = @mysql_fetch_array($query)) { echo "<tr bgcolor=\"#dddddd\"><td><center>"; echo $row["intLodgeNumber"]; echo "</center></td><td><center>"; echo $row["strLodgeName"]; echo "</center></td><td><center><span class=\"style2\">"; echo "<input name=\"submit\" type=\"button\" value=\"Lodge Details\" onclick=\"javascript:window.location='3view.php?id="; echo $row["intLodgeNumber"]; echo "'\" /></center></td>"; echo "</center></td><td><center>"; echo $row["strLodgeMailingCity"]; echo "</center></td><td><center>"; echo ltrim($row["intDistrictID"], '0');
-
Newbie here. Can anybody tell me if there is another login script that I can try instead of the following? I am able to connect when I use: <?php $link = mysql_connect('localhost', 'root', 'mypassword'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ?> However - I can't connect with the following: <?php $username = "myusername"; $password = "mypassword"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("mydatabasename",$dbhandle) or die("Could not select mydatabasename");
-
I'm having to change host providers and I've got a database that was created by an ex-employee. The entire company uses back-end online forms in this database for administrative purposes. As it stands I can somewhat figure out what was created and how it works. However, I'm wondering if anybody can offer some advice or words of caution as I embark on changing host providers and moving all of my files over. I guess I have to do everything in MyPhpAdmin from scratch? There is no simple xfer process, correct?
-
Can I simplify my methode code or do I have to start from scratch?
JTapp replied to JTapp's topic in PHP Coding Help
I figured it out. -
I’m new at php and I’m wondering if what I have to start from scratch on my current search code or if I can just edit what I have... Can somebody help me? I currently have a ‘search.html’ page that has a methode form searching for ‘DropDownItem1’= userinput, ‘DropDownItem2’= userinput, and ‘DropDownItem3’=userinput. It is forwarded to a results.php webpage. I now need to remove the form and user input function and make a stand alone button that specifically searches for DropDownItem1 = myspecificvariable. So the user doesn’t have an input option… they just click “go”. Can I keep my search.html page? I basically want a return of field "tblDpt.Number" to be all values of "4". Here is my current code on my search.html page: <form method="post" action=" results.php"; target="_blank"> <div align="center"> <p class="style1">Department Locator </p> <p> </p> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="#000000"> <p align="center"> <select name="metode" size="1"> <option value="tblDpt.Name">Name</option> <option value="tblDpt.Number">Number</option> <option value="tblDpt.City">City </option> <option value="tblDpt. County">County</option> </select> <input type="text" name="search" size="25"></p> <p align="center"> <strong>Search Now:</strong> <input type="submit" value="Go!!" name="Go"> </p></td> </tr> </table> </div> </form>
-
can I sort records in a table when the sort requested is not alphabetical?
JTapp replied to JTapp's topic in PHP Coding Help
SOLVED. Gosh.. sorry you wrote all that new code. I added a "Group BY" and the Title ID field and we're good to go. Thank you sooo much. My head hurts- I don't know how you Gurus do it! -
can I sort records in a table when the sort requested is not alphabetical?
JTapp replied to JTapp's topic in PHP Coding Help
OK - scratch that last post. I now have a column called "titleID" For every "president" there is a value of 1 For every "VP" there is a value of 2... etc. Now I have to try to figure out how to make the 'title' field return sorted data, based on the hidden 'titleID' field. Does that make sense?