<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: mysql Search</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: mysql Search</description>
<language>en</language>
<pubDate>Mon, 01 Jun 2026 19:43:10 +0000</pubDate>

<item>
<title>redityo on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3081</link>
<pubDate>Wed, 24 Sep 2008 11:40:08 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">3081@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;You can try this code, For date element you don't have to mention child number like &#34;element_1_1&#34; in there, but you can use &#34;element_1&#34; only&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($key == &#38;#39;element_1&#38;#39; &#38;#38;&#38;#38; $form_id == &#38;#39;1&#38;#39;) {
	$_SESSION[&#38;#39;date_time&#38;#39;] = $value;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If you do not want to save the data to database, you can comment the code between line 1015 ~ 1020 in &#34;includes/post-functions.php&#34;  file&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/*
if(empty($form_review)){
	$query = &#38;quot;INSERT INTO &#38;lt;code&#38;gt;ap_form_{$form_id}&#38;lt;/code&#38;gt; ($field_list)
 VALUES ($field_values);&#38;quot;;
}else{ //insert to temporary table, if form review is enabled
	$query = &#38;quot;INSERT INTO &#38;lt;code&#38;gt;ap_form_{$form_id}_review&#38;lt;/code&#38;gt; ($field_list)
 VALUES ($field_values);&#38;quot;;
}
*/&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>bhogsett on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3077</link>
<pubDate>Wed, 24 Sep 2008 09:55:47 +0000</pubDate>
<dc:creator>bhogsett</dc:creator>
<guid isPermaLink="false">3077@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;OK, I now have my album, artist and track search working, but date is not working.&#60;/p&#62;
&#60;p&#62;Here is what I have added to post-functions.php&#60;/p&#62;
&#60;p&#62;// Get the data to my search script&#60;br /&#62;
		if ($key == 'element_1_1' &#38;#38;&#38;#38; $form_id == '1') {&#60;/p&#62;
&#60;p&#62;				$_SESSION['month'] = $value;&#60;br /&#62;
		}&#60;br /&#62;
		if ($key == 'element_1_2' &#38;#38;&#38;#38; $form_id == '1') {&#60;/p&#62;
&#60;p&#62;				$_SESSION['day'] = $value;&#60;br /&#62;
		}&#60;br /&#62;
		if ($key == 'element_1_3' &#38;#38;&#38;#38; $form_id == '1') {&#60;/p&#62;
&#60;p&#62;				$_SESSION['year'] = $value;&#60;br /&#62;
		}&#60;/p&#62;
&#60;p&#62;		if ($key == 'element_1' &#38;#38;&#38;#38; $form_id == '2') {&#60;/p&#62;
&#60;p&#62;		$_SESSION['artist'] = $value;&#60;br /&#62;
		}&#60;br /&#62;
		if ($key == 'element_1' &#38;#38;&#38;#38; $form_id == '3') {&#60;/p&#62;
&#60;p&#62;		$_SESSION['album'] = $value;&#60;br /&#62;
		}&#60;br /&#62;
		if ($key == 'element_1' &#38;#38;&#38;#38; $form_id == '4') {&#60;/p&#62;
&#60;p&#62;The information for the date search form is apparently not being inserted into the $_SESSION variable while the other search forms all insert the data.  The date is three elements and I suspect that is the problem.&#60;/p&#62;
&#60;p&#62;Any suggestions?  Is the element for date an array that needs walked?&#60;/p&#62;
&#60;p&#62;Thanks.&#60;/p&#62;
&#60;p&#62;Bill
&#60;/p&#62;</description>
</item>
<item>
<title>bhogsett on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3066</link>
<pubDate>Tue, 23 Sep 2008 19:14:04 +0000</pubDate>
<dc:creator>bhogsett</dc:creator>
<guid isPermaLink="false">3066@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks that works fine.  I didn't realize I needed:&#60;/p&#62;
&#60;p&#62;if ($key == 'element_1' &#38;#38;&#38;#38; $form_id == '1') {&#60;br /&#62;
	$_SESSION['artist'] = $value;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Any suggestion how to generalize the insertion into the SESSION array?  I will have maybe 4 forms each with one element (likely to be album, artist, track, date).  I can do a series of ifs or switches, but is there a more elegant way?&#60;/p&#62;
&#60;p&#62;Final question for now.  I don't need or particular want the form data to be inserted into my database.  I thought I saw once directions as to which lines to comment out to avoid the insertion, but I can't find it now.&#60;/p&#62;
&#60;p&#62;Thanks again!&#60;/p&#62;
&#60;p&#62;Bill
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3065</link>
<pubDate>Tue, 23 Sep 2008 16:04:34 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">3065@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi ..&#60;/p&#62;
&#60;p&#62;I think it's better to use SESSION instead of POST variable and I think you've done the correct way.&#60;br /&#62;
In this case I assume you want to parse &#34;element_1&#34; on form 1 to search.php, so you need to do the following steps.&#60;/p&#62;
&#60;p&#62;1. Edit &#34;includes/post-functions.php&#34; on line 943&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($key == &#38;#39;element_1&#38;#39; &#38;#38;&#38;#38; $form_id == &#38;#39;1&#38;#39;) {
	$_SESSION[&#38;#39;artist&#38;#39;] = $value;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;2. in your search.php file add this code to get session variable&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
   session_start();
?&#38;gt;
&#38;lt;html&#38;gt;
&#38;lt;head&#38;gt;
&#38;lt;title&#38;gt;My Variables PHP Script&#38;lt;/title&#38;gt;
&#38;lt;/head&#38;gt;

&#38;lt;body&#38;gt;
 The artist is: &#38;lt;? echo $_SESSION[&#38;#39;artist&#38;#39;] ?&#38;gt;

&#38;lt;/body&#38;gt;
&#38;lt;/html&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>bhogsett on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3060</link>
<pubDate>Tue, 23 Sep 2008 10:45:18 +0000</pubDate>
<dc:creator>bhogsett</dc:creator>
<guid isPermaLink="false">3060@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I still need some help.  After reading many of the forum messages, it appears I intend to use the forms differently than they were intended.  While I have a working mysql database on the server (bhogsett.com in music) I do not need to use the Machform form to insert data into the database.&#60;/p&#62;
&#60;p&#62;I bought Machforms for the look of the form and the ease of creating the forms.&#60;/p&#62;
&#60;p&#62;What I want to do is get the data from the form into my own php search script that will search my database and display the results in my page.&#60;/p&#62;
&#60;p&#62;I found a post here that suggested inserting:&#60;/p&#62;
&#60;p&#62;//retrieve the data from element  WFH added&#60;br /&#62;
if ($key == 'element_1' &#38;#38;&#38;#38; $form_id == '1') {&#60;br /&#62;
$_SESSION['Artist'] = $value;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;to line 948 of the post_functions include file.  I added the 'Artist'.&#60;/p&#62;
&#60;p&#62;My redirect test page (variable.php) is:&#60;/p&#62;
&#60;p&#62;&#38;lt;html&#38;gt;&#60;br /&#62;
&#38;lt;head&#38;gt;&#60;br /&#62;
&#38;lt;title&#38;gt;My Variables PHP Script&#38;lt;/title&#38;gt;&#60;br /&#62;
&#38;lt;/head&#38;gt;&#60;br /&#62;
&#38;lt;body&#38;gt;&#60;br /&#62;
&#38;lt;p&#38;gt;The artist is: &#38;lt;? echo $_SESSION['element_1'] ?&#38;gt;&#38;lt;/p&#38;gt;&#60;br /&#62;
&#38;lt;/body&#38;gt;&#60;br /&#62;
&#38;lt;/html&#38;gt;&#60;/p&#62;
&#60;p&#62;I do not think I understand how to pass the $_SESSION to the redirect page.&#60;/p&#62;
&#60;p&#62;At the end of the day, I will settle for just adding an action=variables.php and give up all of the Machform validation and database entry.  But maybe there is a better solution.&#60;/p&#62;
&#60;p&#62;Thanks.&#60;/p&#62;
&#60;p&#62;Bill
&#60;/p&#62;</description>
</item>
<item>
<title>bhogsett on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3051</link>
<pubDate>Mon, 22 Sep 2008 17:26:24 +0000</pubDate>
<dc:creator>bhogsett</dc:creator>
<guid isPermaLink="false">3051@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Yes, I want to pass the POST values to search.php so that search.php can construct the mysql query and then display the results.&#60;/p&#62;
&#60;p&#62;Bill
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3050</link>
<pubDate>Mon, 22 Sep 2008 12:28:57 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">3050@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Bill,&#60;/p&#62;
&#60;p&#62;So you would like your form to redirect to search.php after form submission and pass some search query parameters?&#60;/p&#62;
&#60;p&#62;If so, what are the parameters needed by search.php ?
&#60;/p&#62;</description>
</item>
<item>
<title>bhogsett on "mysql Search"</title>
<link>https://www.machform.com/forums/topic/mysql-search#post-3041</link>
<pubDate>Sun, 21 Sep 2008 18:20:36 +0000</pubDate>
<dc:creator>bhogsett</dc:creator>
<guid isPermaLink="false">3041@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I have just purchased and installed MachForm.  Installation was as fast and easy as advertised.&#60;/p&#62;
&#60;p&#62;I want to use the form to launch a search.php script rather than insert information into the database.&#60;/p&#62;
&#60;p&#62;Do I have to manually change the form code?  I looked in the data directory and the files subdirectory, but the files are not appearing.&#60;/p&#62;
&#60;p&#62;Help please.&#60;/p&#62;
&#60;p&#62;Bill Hogsett
&#60;/p&#62;</description>
</item>

</channel>
</rss>
