Jump to content


Photo

Search Box


  • Please log in to reply
6 replies to this topic

#1 pbaker

pbaker
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 20 November 2005 - 02:26 PM

I want to create a search box in dreamweaver where it querys the database buy say ID field an dthen displays the results below how do i do this.

#2 ShiVer

ShiVer
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationJoMo

Posted 01 December 2005 - 02:52 PM

There are tutorials all over the place for searching databases... just look around.

#3 olliee

olliee
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationNewcastle

Posted 02 December 2005 - 09:38 PM

Ok first you need to create search form. It will need a text box and submit button in the form section.

Then you will need to set these properties.

text box: textfield
button: submit
form name: test

(The object names can be be anything you want them to be, I'm just using what i've used in my code)

So the code will look like this now.
<form  name="test" method="post" action="search_result.php">
  <label>
  <input name="textfield" type="text" id="textfield"  />
  </label>
  <label>
  <input type="submit" name="Submit" value="Submit" />
  </label>
</form>

Now click on the form properties. Now set those properties.

Method: post
Action: search_results.php (This name should be whatever the name of your search results page is)

This page is now done.


For the next page

You need to create a recordset. Select the appropriate table and database.

then you need to set these values.

Filter: first (The field name in the database your searching in)

Now change 'URL Parameter' to 'Form Variable' - then with the adjacent combo-box change it to the name of the textfield in the search page. In this cases its 'textfield'

Now you can add your dynamictext recordset (if you want a repeat region

<table width="400" border="1">
  <?php do { ?>
  <tr>
    
    <td><?php echo $row_Recordset1['first']; ?></td>
    <td><?php echo $row_Recordset1['last']; ?></td>
    <td><?php echo $row_Recordset1['pay']; ?></td>
   </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>

The rest of the code will be generated by dreamweaver.


Is this what you wanted?






#4 philgreg

philgreg
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 30 April 2006 - 07:31 PM

nice reply there, thanks for taking the time...there arent many decent tutorials out there actually!

I need to create a more advanced search box....can you help me out on this.

I want to search surnames and towns...

So, for example my users might search for "Thompson" in the Town of "Buxton"

How do I set up the variables and the run -time values?

#5 moberemk

moberemk
  • Members
  • PipPipPip
  • Advanced Member
  • 695 posts

Posted 30 April 2006 - 08:06 PM

You'll need a more complex SQL query for something like that. Unless you want to learn SQL, then I'd go with [a href=\"http://www.interaktonline.com/Products/Dreamweaver-Extensions/MXSiteSearch/Overview/\" target=\"_blank\"]InterAKT[/a]'s site search extension.
Disclaimer: No matter how harsh I may be, I'm always IMO only.

#6 philgreg

philgreg
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 April 2007 - 09:01 AM

Can anybody help me with this?

#7 philgreg

philgreg
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 03 April 2007 - 09:49 AM

?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users