Jump to content

jvrothjr

Members
  • Posts

    299
  • Joined

  • Last visited

Everything posted by jvrothjr

  1. It could be just the format of the fields sense they are date time
  2. [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]$querystring = \"select * from venues\"; if ($VN != \"\" AND $AC == \"\" AND $AG == \"\") {$querystring = $querystring + \" where (venuename like \'%$VN%\')\";}[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
  3. $querystring .= " WHERE venuename LIKE '%$VT%'"; This will find any field the contains this value
  4. [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] $VN = $_POST[venuename]; $AC = $_POST[areacode]; $AG = $_POST[agegroup]; //-----HOW DO I ADD THESE TO VARIBLES TO THE QUERY FROM MY SEARCH FORM--------- $VT = $_POST[venuetype]; $MT = $_POST[musictype]; [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Are your values passing. have you checked that???????????????????????????????? if the query returns no records found. Echo the variables to the screen just to see it the values are right to what you think they should be. And no it is not hard if things are passed right.
  5. Clause for each type of match needs to be added and spacing in the right place in the case (Below) the space will be added at the addition of the second part of the string [ Where......] [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] [span style=\"color:#0000BB\"]<?php $VN [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$_POST[/span][span style=\"color:#007700\"][[/span][span style=\"color:#0000BB\"]venuename[/span][span style=\"color:#007700\"]]; [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$_POST[/span][span style=\"color:#007700\"][[/span][span style=\"color:#0000BB\"]areacode[/span][span style=\"color:#007700\"]]; [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$_POST[/span][span style=\"color:#007700\"][[/span][span style=\"color:#0000BB\"]agegroup[/span][span style=\"color:#007700\"]]; [/span][span style=\"color:#FF8000\"]//-----HOW DO I ADD THESE TO VARIBLES TO THE QUERY FROM MY SEARCH FORM--------- [/span][span style=\"color:#0000BB\"]$VT [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$_POST[/span][span style=\"color:#007700\"][[/span][span style=\"color:#0000BB\"]venuetype[/span][span style=\"color:#007700\"]]; [/span][span style=\"color:#0000BB\"]$MT [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$_POST[/span][span style=\"color:#007700\"][[/span][span style=\"color:#0000BB\"]musictype[/span][span style=\"color:#007700\"]]; [/span][span style=\"color:#FF8000\"]//----------------------------------------------------- [/span][span style=\"color:#0000BB\"]$mysql_mylink [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]mysql_pconnect[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"localhost\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"nightsp\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"babystuff\"[/span][span style=\"color:#007700\"]) or die([/span][span style=\"color:#0000BB\"]mysql_error[/span][span style=\"color:#007700\"]()); [/span][span style=\"color:#0000BB\"]mysql_select_db [/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]nightsp_nightspotz[/span][span style=\"color:#007700\"]) or die([/span][span style=\"color:#0000BB\"]mysql_error[/span][span style=\"color:#007700\"]()); echo [/span][span style=\"color:#DD0000\"]\"<TABLE class=\'sortable\' id=\'Identify\' BORDER=1 align=center>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"<TD>VENUENAME</TD><TD>AREACODE</TD><TD>AGE GROUP</TD><TD>CITY</TD><TD>STATE</TD>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]$querystring [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#DD0000\"]\"select * from venues\"[/span][span style=\"color:#007700\"]; if ([/span][span style=\"color:#0000BB\"]$VN [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"]) {[/span][span style=\"color:#0000BB\"]$querystring [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$guerystring [/span][span style=\"color:#007700\"]+ [/span][span style=\"color:#DD0000\"]\" where (venuename like \'%$VN%\')\"[/span][span style=\"color:#007700\"];} if ([/span][span style=\"color:#0000BB\"]$VN [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"]) {[/span][span style=\"color:#0000BB\"]$querystring [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$guerystring [/span][span style=\"color:#007700\"]+ [/span][span style=\"color:#DD0000\"]\" where (venuename like \'%$VN%\') AND (areacode like \'%$AC%\')\"[/span][span style=\"color:#007700\"];} if ([/span][span style=\"color:#0000BB\"]$VN [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"]) {[/span][span style=\"color:#0000BB\"]$querystring [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$guerystring [/span][span style=\"color:#007700\"]+ [/span][span style=\"color:#DD0000\"]\" where (venuename like \'%$VN%\') AND (agegroup like \'%$AG%\')\"[/span][span style=\"color:#007700\"];} if ([/span][span style=\"color:#0000BB\"]$VN [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"]) {[/span][span style=\"color:#0000BB\"]$querystring [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$guerystring [/span][span style=\"color:#007700\"]+ [/span][span style=\"color:#DD0000\"]\" where (areacode like \'%$AC%\')\"[/span][span style=\"color:#007700\"];} if ([/span][span style=\"color:#0000BB\"]$VN [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"]) {[/span][span style=\"color:#0000BB\"]$querystring [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$guerystring [/span][span style=\"color:#007700\"]+ [/span][span style=\"color:#DD0000\"]\" where (areacode like \'%$AC%\') AND (agegroup like \'%$AG%\')\"[/span][span style=\"color:#007700\"];} if ([/span][span style=\"color:#0000BB\"]$VN [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]!= [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"]) {[/span][span style=\"color:#0000BB\"]$querystring [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$guerystring [/span][span style=\"color:#007700\"]+ [/span][span style=\"color:#DD0000\"]\" where (agegroup like \'%$AG%\')\"[/span][span style=\"color:#007700\"];} if ([/span][span style=\"color:#0000BB\"]$VN [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AC [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\" [/span][span style=\"color:#007700\"]AND [/span][span style=\"color:#0000BB\"]$AG [/span][span style=\"color:#007700\"]== [/span][span style=\"color:#DD0000\"]\"\"[/span][span style=\"color:#007700\"]) {} [/span][span style=\"color:#0000BB\"]$SearchMatch [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]mysql_query [/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$querystring[/span][span style=\"color:#007700\"], [/span][span style=\"color:#0000BB\"]$mysql_mylink[/span][span style=\"color:#007700\"]) or die([/span][span style=\"color:#0000BB\"]mysql_error[/span][span style=\"color:#007700\"]()); if ([/span][span style=\"color:#0000BB\"]$MatchRecordRow [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]mysql_fetch_array[/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$SearchMatch[/span][span style=\"color:#007700\"])) { [/span][span style=\"color:#0000BB\"] do[/span][span style=\"color:#007700\"]{ [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<TR><td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$MatchRecordRow[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'venuename\'[/span][span style=\"color:#007700\"]].[/span][span style=\"color:#DD0000\"]\"</TD>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$MatchRecordRow[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'areacode\'[/span][span style=\"color:#007700\"]].[/span][span style=\"color:#DD0000\"]\"</TD><td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$MatchRecordRow[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'agegroup\'[/span][span style=\"color:#007700\"]].[/span][span style=\"color:#DD0000\"]\"</TD>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$MatchRecordRow[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'city\'[/span][span style=\"color:#007700\"]].[/span][span style=\"color:#DD0000\"]\"</TD><td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$MatchRecordRow[/span][span style=\"color:#007700\"][[/span][span style=\"color:#DD0000\"]\'state\'[/span][span style=\"color:#007700\"]].[/span][span style=\"color:#DD0000\"]\"</TD>\"[/span][span style=\"color:#007700\"]; } while([/span][span style=\"color:#0000BB\"]$MatchRecordRow [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]mysql_fetch_array[/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$SearchMatch[/span][span style=\"color:#007700\"])); } else {echo [/span][span style=\"color:#DD0000\"]\"<center>Sorry, No Records Were Found!</center>\"[/span][span style=\"color:#007700\"];} echo [/span][span style=\"color:#DD0000\"]\"</table>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]mysql_free_result[/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$SearchMatch[/span][span style=\"color:#007700\"]); [/span][span style=\"color:#0000BB\"]?>[/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] 265132[/snapback]
  6. Ok I see one thing where in the query string you would need a space built in string [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]$querystring = \"select * from venues\"; if ($VN != \"\" && $AC != \"\" && $AG != \"\") {$querystring = $guerystring + \"where (venuename like \'%$VN%\') and (areacode like \'%$AC%\') and (agegroup like \'%$AG%\')\";} if ($VN != \"\" && $AC != \"\" && $AG == \"\") {$querystring = $guerystring + \"where (venuename like \'%$VN%\') and (areacode like \'%$AC%\')\";} if ($VN != \"\" && $AC == \"\" && $AG == \"\") {$querystring = $guerystring + \"where (venuename like \'%$VN%\')\";} if ($VN != \"\" && $AC == \"\" && $AG != \"\") {$querystring = $guerystring + \"where (venuename like \'%$VN%\') and (agegroup like \'%$AG%\')\";} [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Like this [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]$querystring = \"select * from venues\"; $querystring = $guerystring +\" where (venuename like \'%$VN%\')\";}[/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Otherwise your string will look like this on add select * from venueswhere (venuename like '%$VN%')
  7. It does not matter you still have to set the Name on the list box. The only difference is the root code on the input page Text Box for user input [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]echo \"<form action=query.php method=post>\"; echo \"Originator: <INPUT maxLength=50 name=Originator>\"; echo \"<input type=submit name=cmd value=\'Search Records\'>\"; echo \"</FORM>\";[/span][!--PHP-Foot--][/div][!--PHP-EFoot--] List Box feed from database for user select [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]$querystring = \"select User_Name,Submitter from tbluser Order by Submitter ASC\"; $SearchMatch = mysql_query ($querystring); echo \"<form action=query.php method=post>\"; echo \"<select name=Originator>\"; echo \"<option></option>\"; if ($MatchRecordRow = mysql_fetch_array($SearchMatch)) { do{ echo \"<option value=\'\".$MatchRecordRow[\'Submitter\'].\"\'>\".$MatchRecordRow[\'Submitter\'].\"</option>\"; } while($MatchRecordRow = mysql_fetch_array($SearchMatch)); } echo \"</select>\"; echo \"<input type=submit name=cmd value=\'Search Records\'>\"; echo \"</FORM>\";[/span][!--PHP-Foot--][/div][!--PHP-EFoot--] They are both named Originator either one can be used to get the data.
  8. Sorry Try this one I could not test link from inside my firewall at home
  9. Multi_Seach Document Ok Try this Baisc But I have tried to explame it.
  10. page2.php Part 2 [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] if ($ArresterCreep != \"\" && $ArresterMcov != \"\" && $ArresterRating != \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Mcov between $MinArrMcov and $MaxArrMcov) and (Rating between $MinArrRating and $MaxArrRating) and (Creep between $MinArrCrp and $MaxArrCrp) and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} if ($ArresterCreep != \"\" && $ArresterMcov != \"\" && $ArresterRating == \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Mcov between $MinArrMcov and $MaxArrMcov) and (Creep between $MinArrCrp and $MaxArrCrp) and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} if ($ArresterCreep != \"\" && $ArresterMcov == \"\" && $ArresterRating == \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Creep between $MinArrCrp and $MaxArrCrp) and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} if ($ArresterCreep != \"\" && $ArresterMcov == \"\" && $ArresterRating != \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Rating between $MinArrRating and $MaxArrRating) and (Creep between $MinArrCrp and $MaxArrCrp) and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} if ($ArresterCreep == \"\" && $ArresterMcov != \"\" && $ArresterRating != \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Mcov between $MinArrMcov and $MaxArrMcov) and (Rating between $MinArrRating and $MaxArrRating) and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} if ($ArresterCreep == \"\" && $ArresterMcov != \"\" && $ArresterRating == \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Mcov between $MinArrMcov and $MaxArrMcov) and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} if ($ArresterCreep == \"\" && $ArresterMcov == \"\" && $ArresterRating != \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Rating between $MinArrRating and $MaxArrRating) and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} if ($ArresterCreep == \"\" && $ArresterMcov == \"\" && $ArresterRating == \"\") {$querystring = \"select * from all_arr where (Type like \'$ArresterType%\') and (Description like\'%$ArresterDescription%\') and (MultiRated like \'$ArresterMultiRated\') order by Creep,CatalogNumber\";} $ArresterSearchMatch = mysql_query ($querystring); if ($MatchRecordRow = mysql_fetch_array($ArresterSearchMatch)) { do{ echo \"<TR><td>\".$MatchRecordRow[\'CatalogNumber\'].\"</TD>\"; echo \"<td>\".$MatchRecordRow[\'Type\'].\"</TD><td>\".$MatchRecordRow[\'Mcov\'].\"</TD>\"; echo \"<td>\".$MatchRecordRow[\'Rating\'].\"</TD><td>\".$MatchRecordRow[\'Creep\'].\"</TD>\"; $Description = \'.\';if ($MatchRecordRow[\'Description\'] <> \'\') {$Description = $MatchRecordRow[\'Description\'];}echo \"<td>\".$Description.\"</TD>\"; $Customer = \'.\';if ($MatchRecordRow[\'Customer\'] <> \'\') {$Customer = $MatchRecordRow[\'Customer\'];}echo \"<td>\".$Customer.\"</TD>\"; $Stat = \'.\';if ($MatchRecordRow[\'Stat\'] <> \'\') {$Stat = $MatchRecordRow[\'Stat\'];}echo \"<td>\".$Stat.\"</TD>\"; $ArresterMultiRated = \'.\';if ($MatchRecordRow[\'MultiRated\'] == \'TRUE\') {$ArresterMultiRated = \'YES\';}echo \"<td>\".$ArresterMultiRated.\"</TD>\"; $FirstUnit = \'.\';$SecondUnit = \'.\';$ThirdUnit = \'.\';$ForthUnit = \'.\'; if ($ArresterMultiRated == \'YES\') { if ($MatchRecordRow[\'FirstMcov\'] <> \'0\') {$FirstUnit = $MatchRecordRow[\'FirstMcov\'];} if ($MatchRecordRow[\'SecondMcov\'] <> \'0\') {$SecondUnit = $MatchRecordRow[\'SecondMcov\'];} if ($MatchRecordRow[\'ThirdMcov\'] <> \'0\') {$ThirdUnit = $MatchRecordRow[\'ThirdMcov\'];} if ($MatchRecordRow[\'Forth\'] <> \'0\') {$ForthUnit = $MatchRecordRow[\'Forth\'];} } echo \"<td>\".$FirstUnit.\"</TD><td>\".$SecondUnit.\"</TD>\";echo \"<td>\".$ThirdUnit.\"</TD><td>\".$ForthUnit.\"</TD>\"; $ArresterColor = \'.\';if ($MatchRecordRow[\'Color\'] <> \'\') {$ArresterColor = $MatchRecordRow[\'Color\'];}echo \"<td>\".$ArresterColor.\"</TD></TR>\";} while($MatchRecordRow = mysql_fetch_array($ArresterSearchMatch));} else {echo \"<center>Sorry, No Records Were Found!</center>\";} echo \"</table>\"; echo \"<P><font size=\'8\' color=\'#000000\'><H2 align=center>Search Completed</H2></font>\"; } Else {echo \"<center><H1>Please Select MultiRated <font size=\'8\' color=\'red\'>[True]</font> or <font size=\'8\' color=\'red\'>[False]</font></h1></center>\";DataEntryForm();} mysql_free_result($ArresterSearchMatch); } switch($_REQUEST[\'cmd\']){ default; SearchRecordReturnMatch($_POST[\'ArresterType\'],$_POST[\'ArresterMcov\'],$_POST[\'ArresterRating\'],$_POST[\'ArresterCreep\'],$_POST[\'ArresterDescription\'],$_POST[\'ArresterMultiRated\']); break; } ?> [/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
  11. page2.php Part 1 [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<?php session_start[/span][span style=\"color:#007700\"](); [/span][span style=\"color:#0000BB\"]session_register[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"mysql_mylink\"[/span][span style=\"color:#007700\"]); require([/span][span style=\"color:#DD0000\"]\"pagelook.inc\"[/span][span style=\"color:#007700\"]); echo [/span][span style=\"color:#DD0000\"]\"<font size=\'8\' color=\'#000000\'><H1 align=center>Arrester Search Request</H1></font>\"[/span][span style=\"color:#007700\"]; function [/span][span style=\"color:#0000BB\"]SearchRecordReturnMatch[/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$ArresterType[/span][span style=\"color:#007700\"],[/span][span style=\"color:#0000BB\"]$ArresterMcov[/span][span style=\"color:#007700\"],[/span][span style=\"color:#0000BB\"]$ArresterRating[/span][span style=\"color:#007700\"],[/span][span style=\"color:#0000BB\"]$ArresterCreep[/span][span style=\"color:#007700\"],[/span][span style=\"color:#0000BB\"]$ArresterDescription[/span][span style=\"color:#007700\"],[/span][span style=\"color:#0000BB\"]$ArresterMultiRated[/span][span style=\"color:#007700\"]){ [/span][span style=\"color:#0000BB\"]$strcnta1 [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]strlen[/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$ArresterMultiRated[/span][span style=\"color:#007700\"]); if ([/span][span style=\"color:#0000BB\"]$strcnta1 [/span][span style=\"color:#007700\"]> [/span][span style=\"color:#0000BB\"]1[/span][span style=\"color:#007700\"]) { echo [/span][span style=\"color:#DD0000\"]\"<TABLE BORDER=1 align=center>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"<TD>Type</TD><TD>Mcov</TD><TD>Rated</TD><TD>Creep</TD><TD>Description</TD><TD>Multi Rated</TD><TR>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"<td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$ArresterType[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\"</td><td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$ArresterMcov[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\"</td><td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$ArresterRating[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\"</td>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"<td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$ArresterCreep[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\"</td><td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$ArresterDescription[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\"</td><td>\"[/span][span style=\"color:#007700\"].[/span][span style=\"color:#0000BB\"]$ArresterMultiRated[/span][span style=\"color:#007700\"].[/span][span style=\"color:#DD0000\"]\"</td>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"</TR></table><p>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]mysql_select_db [/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"all_arr\"[/span][span style=\"color:#007700\"]); echo [/span][span style=\"color:#DD0000\"]\"<TABLE class=\'sortable\' id=\'allarr1\' BORDER=1 align=center>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"<TD>Catalog Number</TD><TD>Type</TD><TD>Mcov</TD><TD>Rated</TD><TD>Creep</TD><TD>Description</TD>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"<TD>Customer</TD><TD>Stat</TD><TD>Multi Rated</TD><TD>First Mcov</TD><TD>Second Mcov</TD>\"[/span][span style=\"color:#007700\"]; echo [/span][span style=\"color:#DD0000\"]\"<TD>Third Mcov</TD><TD>Fourth Mcov</TD><TD>Color</TD>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]$MinArrCrp [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$ArresterCreep [/span][span style=\"color:#007700\"]* [/span][span style=\"color:#0000BB\"]0.90[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]$MinArrMcov [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$ArresterMcov [/span][span style=\"color:#007700\"]* [/span][span style=\"color:#0000BB\"]0.90[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]$MinArrRating [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$ArresterRating [/span][span style=\"color:#007700\"]* [/span][span style=\"color:#0000BB\"]0.90[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]$MaxArrCrp [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$ArresterCreep [/span][span style=\"color:#007700\"]* [/span][span style=\"color:#0000BB\"]1.10[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]$MaxArrMcov [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$ArresterMcov [/span][span style=\"color:#007700\"]* [/span][span style=\"color:#0000BB\"]1.10[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]$MaxArrRating [/span][span style=\"color:#007700\"]= [/span][span style=\"color:#0000BB\"]$ArresterRating [/span][span style=\"color:#007700\"]* [/span][span style=\"color:#0000BB\"]1.10[/span][span style=\"color:#007700\"]; [/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
  12. I dont have a tutorial for this but here is a page I have that does want your asking for. Have to do this in three posts lol page1.php [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] [span style=\"color:#0000BB\"]<?php [/span][span style=\"color:#FF8000\"]//Function Sets Session Connect Variable [/span][span style=\"color:#0000BB\"]session_start[/span][span style=\"color:#007700\"](); [/span][span style=\"color:#0000BB\"]session_register[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"mysql_mylink\"[/span][span style=\"color:#007700\"]); require([/span][span style=\"color:#DD0000\"]\"pagelook.inc\"[/span][span style=\"color:#007700\"]); echo [/span][span style=\"color:#DD0000\"]\"<font size=\'8\' color=\'#000000\'><H1 align=center>Arrester Search Request</H1></font>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<center><form action=page2.php method=post>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] [/span][span style=\"color:#007700\"]echo [/span][span style=\"color:#DD0000\"]\"<TABLE BORDER=1 align=center>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>*Type:</td><td><INPUT maxLength=50 name=ArresterType size=30></td></tr>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>Mcov:</td><td><INPUT maxLength=50 name=ArresterMcov size=30></td></tr>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>Rating:</td><td><INPUT maxLength=50 name=ArresterRating size=30></td></tr>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>Creep:</td><td><INPUT maxLength=50 name=ArresterCreep size=30></td></tr>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>Description:</td><td><INPUT maxLength=50 name=ArresterDescription size=30</td></tr>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<td>*MultiRated :</td><td><select name=ArresterMultiRated>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<option value=\'TRUE\'>TRUE</option>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<option value=\'FALSE\'>FALSE</option>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"</select></td></tr></table>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"<p><input type=submit name=cmd value=\'Search Records\'>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"] echo [/span][span style=\"color:#DD0000\"]\"</FORM>* - Required Fields</center>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]?>[/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
  13. if you have a field in a table your are going to compair the 'VALUE' of whats in that field. The 'VALUE' is the query is what your searching for. If the field options are 'YES' or 'NO' then the value with be what your looking for to count. If you have a checkbox field in general the values with be 0 or 1
  14. Where are two ways I have used to count records $result1 = mysql_query ("Select fldnm from tblnm where fldnm = '$Value' "); $num1 = mysql_num_rows($result1); $result=mysql_query("select count(*) from tblnm where fldnm = '$value'"); $total=mysql_result($result,0,"count(*)"); Hope this helps a little.
  15. $result = mysql_query ("select * from TABLE where FIELDNAME like '%$txtsearch%' order by FIELDNAME"); ($row = mysql_fetch_array($result)) The [*] pulls all fields from that table. If you wished to see only one field replace then [*] with [FIELDNAME] Multi fields [FIELDNAME1, FIELDNAME2] then to pull the field data print ("<TD>"); print $row["FIELDNAME"]; print ("</TD>");
  16. Thanks that was it. Was driving me crazy.......... changed it step 1 pasted now others thanks... pasted another topic for the other one. join multi tables from multi databases but all on one machine.... That is my next hump to get over .............
  17. We will try this in this forum. I have a database named [grouplog] with 2 tables {role & group} I can query the role and get data back and printed to the screen but can not get data back from group. Here is the simple code I am using if any one can help please? <table border=2 align=center><TD>Role</TD> <?php mysql_select_db (\"grouplog\"); $result = mysql_query (\"select role from role\"); while ($row=mysql_fetch_array($result)) { Print (\"<tr>\");print (\"<td>\");print $row[role];print (\"</td>\");print (\"</tr>\"); }?> </table> <table border=2 align=center><TD>Group</TD> <?php mysql_select_db (\"grouplog\"); $result = mysql_query (\"select group from group\"); while ($row=mysql_fetch_array($result)) { Print (\"<tr>\");print (\"<td>\");print $row[group];print (\"</td>\");print (\"</tr>\"); }?> </table> Here is the error msg I get Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:Program FilesAbyss Web Serverhtdocstestingtestgrp.php
×
×
  • 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.