Dreamweaver recordset query help!
HI im building a search page on dreamweaver based on bars clubs and pubs. At the moment i have 3 checkboxes labelled Bar, Club and pub with list/menu. I want the checkboxes so that when 1 is clicked eg Club it will come up with all the clubs in the database. However at the moment when i click that it comes up with the right amount of records but with clubs, bars and pubs.
Also i want it so that if i select Clubs and Pubs in the checkboxes, or all 3 checkboxes selected, it will come up with all the Clubs and Pubs in the database and so forth.
This is the SQL query in the recordset i created to get the values from the search page. I think this is wherte its going wrong
SELECT *
FROM `places`
WHERE `Town` LIKE %area% AND `MusicGenre` LIKE %music% AND (`DisabledAcess` = 'Yes' OR da1 ='0' ) AND (`Club/Bar/Pub` = 'Club' OR club1 = '0') AND (`Club/Bar/Pub` = 'Pub' OR pub1 = '0') AND (`Club/Bar/Pub` = 'Bar' OR bar1 = '0')
ORDER BY `Name` ASC
Help Please!
Checkbox's won't exist on the submitted page unless they are ticked.
so i might do something like: ( untested )
SELECT
FROM `places`
WHERE
`Town` LIKE %area%
AND `MusicGenre` LIKE %music%
AND (`DisabledAcess` = 'Yes' OR da1 ='0' )
<cfif isdefined("form.club)" OR isdefined("form.pub)" OR isdefined("form.bar)">
AND
<cfif isdefined("form.club)">
`Club/Bar/Pub` = 'Club' OR
</CFIF>
<cfif isdefined("form.PUB)">
`Club/Bar/Pub` = 'pub' OR
</CFIF>
<cfif isdefined("form.BAR)">
`Club/Bar/Pub` = 'bar' OR
</CFIF>
1 = 2
</cfif>
ORDER BY
`Name` ASC
PS. Its a bad idea to name a database field something like `Club/Bar/Pub` ( but i assume that just an example, and not real)
Similar Messages
-
Syntax error when adding variables in recordset (query)
MySql,PHP,Dreamweaver,WindowsVista
Hi I am receiving a syntax error: invalid quantifier ++ $orderNum;s*?> when adding two variables in the recordset (query) dialog box. I get the error when clicking OK.
Here is what is entered:
name: fieldname
type: text
default: -1
runtime value: $_GET['Field']
name: searchvalue
type:text
default: -1
runtime value: $_GET['Search']
Can anyone help with this?That's a completely separate issue. The error message is telling you that you have not defined the testing server correctly in the Site Definition dialog box.
The Host directory field and URL prefix should both point to the same place, in other words, the root of your website. Host directory is the physical path, while URL prefix is the address you would put in a browser address bar.
Select Site > Manage Sites. Select the name of the site, and click the Edit button. In the Site Definition dialog box, select the Advanced tab, and then choose Testing server from the Category list on the left.
Depending on how your remote login works, Host directory should probably be public_html or just /. Use the same value as in the Remote server part of the Site Definition dialog box. The URL prefix should be http://gaylehansen.aisites.com/. -
Recordset(Query) Error Message
Hi
I'm a newbie, so I need your help. Whenever I try to add a
Recordset(Query) to a PHP page I get the following error:
" While executing addDynamicSource, the following JavaScript
errors occured:
At line 29 of file " C:\Program
Files\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Recordset.js":
JavaScript error while loading Recordset.htm
At line 1111 of file
"C:\ProgramFiles\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Recordset.js ":
theStr=theStr.replace(/(?>)*/gi,""); //remove close tags
SyntaxError: invalid quantifier? "
Or this error (the same as in the Philgreg's post): "The
Recordset script does not define the applyServerBehavior function"
I'm using PHP5, MySQL with IIS as a testing server, and DW8
(updated). Connection to database is OK.
PLEASE HELP!
Thanks in advance.
link
to the post
link[/L]Have you tried reinstalling DW?
"dedurus" <[email protected]> wrote in
message
news:e6pm9v$hci$[email protected]..
> Hi
> I'm a newbie, so I need your help. Whenever I try to add
a
> recordset(Query) to
> a page I get the following error:
> " While executing addDynamicSource, the following
JavaScript errors
> occured:
> At line 29 of file " C:\Program
>
Files\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Recordset.js":
> JavaScript error while loading Recordset.htm
>
>
> At line 1111 of file
>
"C:\ProgramFiles\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Rec
> ordset.js":
> theStr=theStr.replace(/(?>)*/gi,""); //remove close
tags
> SyntaxError: invalid quantifier? "
>
> I'm using PHP5, MySQL with IIS as a testing server, and
DW8. Connection to
> database is OK.
> PLEASE HELP!
> Thanks in advance.
> dedurus
> -
i get this error whenever i open pages created in CS4. ive tried deleting the cache file... deleting the entire configuration folder and letting DW re build it.. nothing... error still there. how can i turn it off? i also cant seem to find the "edit server behaviors" button.. double click? well DW freaks out with that aswell... yes i know i have some insanely hand edited code.. basically use DW as notepad replacement.. with extra features like having the option of "add recordset" then going and editing it to my liking.
the error
[quote]
The server behavior panel cannot determine whether "command" or "recordset (Query)" is applied to your page. Please select edit Server Behaviors and change one of the two behaviors to ensure that each is uniquely identifiable.
[/quote]
this is a total show stopper for me.. im going to have to go back to a previous version cant click "ok" every time i open a page.. and every time i follow a include file.
development ASP
Dreamweaver CS5
Question.. how to disable the error message from popping up? i'll take my chances with hand editing the recordset / command by hand if i need it changed.this is bleh... having to resort back to CS4..
is there any way to legaly go back to cs4 dreamweaver but still use the other cs5 applications? -
Suddenly getting this goofball message in DW5.5 on Win7:
"The Server Behavior panel cannot determine whether "Command" or "Recordset (Query)" is applied to your page. Please select Edit Server Behaviors and change one of the two behaviors to ensure that each is uniquely identifiable."
Crazy thing is, it only happens on my workstation.
DW5.5 on my laptop opens the same .asp pages without this crazy message popping up.
Anybody know what the issue is?I'd suggest that no answer means no answer yet. The person who can help may not have been on the forum the day the post was made.
That said, I'm starting to suspect that the cause must be an extension. Both boxes have the same version of DW and the same OS but both don't have the exact same extensions installed. Will play around and see what happens. -
I'm fairly new to DW and MySQL. I'm trying to develop what I
thought was a simple search and results app., but am apparently
having a program logic issue
I have a form with 2 radio buttons, code below:
<form name="card_search" id="card_search" method="post"
action="card_search_results.asp">
<p>
<label>
<input <%If
(CStr((rsCardCatBaseball.Fields.Item("catID").Value)) = CStr("1"))
Then Response.Write("CHECKED") : Response.Write("")%>
type="radio" name="RadioGroupCardCat" value="1" />
Baseball</label>
<br />
<label>
<input <%If
(CStr((rsCardCatBaseball.Fields.Item("catID").Value)) = CStr("2"))
Then Response.Write("CHECKED") : Response.Write("")%>
type="radio" name="RadioGroupCardCat" value="2" />
Football</label>
<br />
<input name="submit_card_cat" type="submit"
id="submit_card_cat" value="Submit" />
</p>
</form>
When testing using the GET URL param. I see that the var
RadioGroupCardCat=1 (baseball) or RadioGroupCardCat=2 (football)
are getting passed to the card_search_results.asp page. However, I
can't seem to figure out how to capture the RadioGroupCardCat
values (1 or 2) in my SQL queries. I currently have 2 recordset
queries (rsCardCatBaseball and rsCardCatFootball) below.
rsCardCatBaseball:
SELECT tblcard.cardyear, tblcardvend.vendname,
tblcard.cardnum
FROM tblcard, tblcardcat, tblcardvend
WHERE RadioGroupCardCat=1 AND
tblcardvend.vendid=tblcard.vendid AND
tblcardcat.catid=tblcard.catid
rsCardCatFootball:
SELECT tblcard.cardyear, tblcardvend.vendname,
tblcard.cardnum
FROM tblcard, tblcardcat, tblcardvend
WHERE RadioGroupCardCat=2 AND
tblcardvend.vendid=tblcard.vendid AND
tblcardcat.catid=tblcard.catid
'catid' is the MySQL table field with either a value of 1
(baseball) or 2 (football). I'm using ASP/VBScript, so below is how
the variable is declared in the RecordSet variables area of DW.
FOR rsCardCatBaseball:
NAME
RadioGroupCardCat
DEFAULT VALUE
1
RUNTIME VALUE
Request("catid")
For rsCardCatFootball:
NAME
RadioGroupCardCat
DEFAULT VALUE
2
RUNTIME VALUE
Request("catid")
The problem is that I get the same results for both queries.
The results for the rsCardCatFootball query are identicle to the
rsCardCatBaseball query. Aren't I supposed to have 2 seperate
recordsets in the results page so that one gets passed one value
and the other RS gets the other value? Any assistance much
appreciated. Thanks.A radio group is only supposed to pass one value from the
form depending
upon which option has been clicked, therefore on the results
page you should
only need one recordset providing that everything is going
against the same
table. Providing that a value of 1 or 2 relate to the same
field then you
will be able to use the recordset dialogue box to build the
SQL.
However if different tables or fields are involved then you
will need to
handwrite the SQL statement
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"obcbeatle" <[email protected]> wrote in
message
news:[email protected]...
> After reading my original post, I see that it is was not
worded very well.
> Basically the problem I am having is understanding how
to capture values
> that
> are sent from a form to results page using Dreamweaver
MX and MySQL.
> Specifically, creating a group of two radio buttons
where two values are
> sent
> to a results.asp page that contains a Recordset Query
(using MySQL syntax)
> that
> will display the query results based on the values being
sent from the
> form
> with the radio buttons. The radio button values being
sent are either a
> '1' or
> a '2', depending on which radio button is selected and
submitted. My
> current
> understanding is that I need to have two Recordset
queries, one to capture
> each
> value being submitted. Thus I have a Recordset with a
MySQL select
> statement
> designed to capture the value '1' and display the
results, and a Recordset
> with
> a MySQL statement to capture the value '2' and display
the results. At
> present
> when I Submit the radio button values, either a '1' or
'2', I always get
> the
> display results for the Recordset Query designed to
capture the value '1'.
> So,
> I believe that either I have NOT designed the program
logic correctly in
> Dreamweaver to capture two different values using two
Recordsets, or my
> MySQL
> statement is flawed. I guess my primary questions are:
>
> 1) Should I be using two Recordsets or one Recordset in
this case?
>
> 2) If I should be using one Recordset, can anyone point
me to a sample
> MySQL
> select statement that handles two vales being submitted
from a form?
>
> I have googled extensively looking for examples of how
to do this, and
> used a
> book I have that has some examples, but NOT MySQL
examples. Any
> comments/suggestions appreciated. Thank you.
> -
Query Help:
http://forum.java.sun.com/thread.jsp?forum=45&thread=471180&tstart=15&trange=15
It seems I have confused enough people with my improper presentation of query. Sorry guys. I will restate my question with different table names.
The above was my previous posting, which was not clear..so Iam restating my problem as follows....
I have the following tables
Customer(custID, Name, Address)
Order(custID, OrderID, orderDate)
CreditCard(custID, creditCard#, creditCardType)
Now if I have 3 records in Order with custID 100 and 2 records in CreditCard as
Order:
100,A001,11/22/03
100,A002,11/24/03
100,A003,12/02/03
CreditCard:
100,42323232..., VISA
100,5234234...., MASTER
Now how can I get
custID, Name, Address, OrderID, orderDate, creditCard#, creditCarType
data in minimum no. of records....
I think I have made my query clear..
now please help me guys...
thanks so much for your help.You are right.
But frankly the actual tables on my database are not customer,orders and creditcards..but I just tried to reproduce the problem with these tables, please ignore that user needs a refund etc situtaion. If the tables were actually order,creditcards etc..it would have been a problem to be considered.
Can you please help me with the query
if I have m rows in Order and n rows in CreditCard. I will get m*n records, I looking for max(m,n).
With the following fields in my query result,
custID, Name, Address, OrderID, orderDate, creditCard#, creditCarType
from Customer, Order, CreditCard tables
Thanks so much for your htlp -
SQL Query Help - Is this possible or impossible????
Hi guys,
I need help with an SQL query that I'm trying to develop. It's very easy to explain but when trying to implement it, I'm struggling to achieve the results that I want.....
For example,
I have 2 tables
The first table is:
1) COMPANY create table company (manufacturer varchar2(25),
date_established date,
location varchar2(25) );My sample test date is:
insert into company values ('Ford', 1902, 'USA');
insert into company values ('BMW', 1910, 'Germany');
insert into company values ('Tata', 1922, 'India');The second table is:
2) MODELS create table models (manufacturer varchar(25),
model varchar2(25),
price number(10),
year date,
current_production_status varchar2(1) ) ;My sample test data is:
insert into models values ('Ford', 'Mondeo', 10000, 2010, 0);
insert into models values ('Ford', 'Galaxy', 12000, 2008, 0);
insert into models values ('Ford', 'Escort', 10000, 1992, 1);
insert into models values ('BMW', '318', 17500, 2010, 0);
insert into models values ('BMW', '535d', 32000, 2006, 0);
insert into models values ('BMW', 'Z4', 10000, 1992, 0);
insert into models values ('Tata', 'Safari', 4000, 1999, 0);
insert into models values ('Tata', 'Sumo', 5500, 1996, 1);
insert into models values ('Tata', 'Maruti', 3500, 1998, 0);And this is my query:
SELECT
com.manufacturer,
com.date_established,
com.location,
DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.model),
DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.price),
DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.year),
mod.current_production_status
FROM
company com,
models mod
WHERE
mod.manufacturer = com.manufacturer
and com.manufacturer IN ('Ford', 'BMW', 'Tata')
and mod.current_production_status IN (1,0)
ORDER BY
mod.current_production_status DESCWhat I want the query to output is this:
com.manufacturer com.date_established com.location mod.model mod.price mod.year mod.current_production_status
Ford 1902 USA Escort 10000 1992 1
BMW 1910 Germany - - - 0
Tata 1922 India Sumo 5500 1998 1If current_production_status is 1 it means this particular model has been discontinued
If current_production_status is 0 it means the manufacturer does not have any discontinued models and all are in procuction.
The rule is only one record per manufacturer is allowed to have a current_production_status of 1 (so only one model from the selection the manufactuer offers is allowed to be discontinued).
So the query should output the one row where current_production_status is 1 for each manufacturer.
If for a given manufacturer there are no discontinued models and all have a current_production_status of 0 then ouput a SINGLE row that only includes the data from the COMPANY table (as above). The rest of the columns from the MODELS table should be populated with a '-' (hyphen).
My query as it is above will output all the records where current status is 1 or 0 like this
com.manufacturer com.date_established com.location mod.model mod.price mod.year mod.current_production_status
Ford 1902 USA Escort 10000 1992 1
Tata 1922 India Sumo 5500 1998 1
Ford 1902 USA - - - 0
Ford 1902 USA - - - 0
BMW 1910 Germany - - - 0
BMW 1910 Germany - - - 0
BMW 1910 Germany - - - 0
Tata 1922 India - - - 0
Tata 1922 India - - - 0However this is not what I want.
Any ideas how I can achieve the result I need?
Thanks!
P.S. Database version is '10.2.0.1.0'Hi Vishnu,
Karthiks query helped...
But this is the problem I am facing...
SELECT
com.manufacturer,
com.date_established,
com.location,
DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.model),
DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.price),
DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.year),
mod.current_production_status
FROM
company com,
models mod
WHERE
mod.manufacturer = com.manufacturer
and com.manufacturer = 'Ford'
and mod.current_production_status IN (1,0)
ORDER BY
mod.current_production_status DESCThe value of:
and com.manufacturer = 'Ford'will be dependent on front end user input....
When I run the query above I get all the rows where current_production_status is either 1 or 0.
I only require the rows where current_production_status is 1.
So if I amend it to look like this:
and mod.current_production_status = 1This works....
BUT if a user now passes in more than one manufacturer EG:
and com.manufacturer IN ('Ford', 'BMW')The query will only return the one row for Ford where current_production_status is 1. However because BMW has no models where current_production_status is 1 (all 3 are 0), I still want this to be output - as one row....
So like this:
com.manufacturer com.date_established com.location mod.model mod.price mod.year mod.current_production_status
Ford 1902 USA Escort 10000 1992 1
BMW 1910 Germany - - - 0So (hopefully you understand), I want both cases to be catered for.....whether a user enters one manufacturer or more than one...
Thanks you so much!
This is really driving me insane :-( -
Banner image will not display in Dreamweaver; can you help?
Banner image will not display in Dreamweaver; can you help?
If the banner image is not displaying, it is either not in an acceptable web file format (optimized for web as jpg, gif or png). Or it is corrupted. Or the path to the image file on server is broken.
It's impossible to say more without a link to your problem page.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/ -
Adobe Dreamweaver CC 2014 Helper has stopped working
When I try to import an Flash SWF file created with CC 2014 I get an error that says Adobe Dreamweaver CC 2014 Helper has stopped working. Then I get the option to check online for a solution and close the program or just a second option to just close the program.
Any suggestions to a fix?I insured that Flash 64 bit was installed on my computer.
This problem must have something to do with embedding a Flash file. I could not recreate the problem on other client's websites. I pulled all the Flash code and the problem went away. Of course I want to include a Flash file so it's still an issue for me.
CODE I PULLED:
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="250px" id="FlashID" title="animatedDog">
<param name="movie" value="dog.swf">
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="10.1.0.0">
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf">
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="dog.swf" width="100%" height="250px">
<!--<![endif]-->
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="10.1.0.0">
<param name="expressinstall" value="Scripts/expressInstall.swf">
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div><img src="/images/2014/noFlash.gif" alt="Missing Adobe Flash player" /></div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<br><img src="images/2014/sidePhotos/photo.jpg" alt=""><br> -
hii
i need a query help
i have two tables
the 1st table will look like this
associate id weekid no.of. hours
4000 810 40
4000 820 30
4000 830 60
4000 840 70
2nd table will look like this
associate id weekid no.of.hours
4000 810 40
4000 820 70
4000 830 130
4000 840 200
so when i subtract the last two records frm each other in the second table the value should be equal to the no.of.hours in the first table.. for example
the query shud consider the last record and one before the last record and the difference between two records shud be equal to the value in the 1st table
for example
consider week id 830 and 840
in second table 830=130
840=200
when u subtraced both values the difference shud be equal to value in the 1st table for tht week id
1 ---->>>> 840 - 830
=200 - 130
=70
in first table 840 has 70 hrs
like this it shud check with all records and it shud return only the records which are not equal
regards
srikanthThis..?
sql>select * from t1;
A_ID W_ID HRS
4000 810 40
4000 820 30
4000 830 60
4000 840 70
4000 850 80
sql>select * from t2;
A_ID W_ID HRS
4000 810 40
4000 820 70
4000 830 130
4000 840 200
4000 850 260
sql>
select a_id,w_id,hrs,sum_hrs
from(
select t1.a_id a_id,t1.w_id w_id,t1.hrs hrs,t2.hrs sum_hrs,
t2.hrs - nvl(lag(t2.hrs) over(order by t1.w_id),0) diff
from t1,t2
where t1.w_id = t2.w_id)
where diff != hrs;
A_ID W_ID HRS SUM_HRS
4000 850 80 260 -
Please help with RecordSet Query
Hello all. I am trying to build a contact management system
for different offices. Each person has a login they use to access
their office's respective page. What I am wanting to do is pull up
all the employees' information that work at the same location as
the person who logged in. For example: Person A, B, and C work at
Location 1 and Person X, Y, and Z work at location Z. If person A
logs in, I want the to be able to see the dynamic table with the
information for all of Location 1 (Person A, B, and C). I
understand using the session variable MM_Username to filter the
recordsets based off who logs in. Where I'm confused is in pulling
up the records for everyone that shares the same location as the
person who logs in. In other words, if I say filter Information
based off Session Variable MM_Username it only returns the
information for the person who logged in. I want it to say, in
layman terms, Person A logged in, now look at their location, and
return all Person's information who has a location equal to that of
Person A. I hope I explained my dilemma clearly enough. If I need
to elaborate or explain any more please let me know. Thanks in
advance for any and all help.Thank you for your help. Sorry for my ignorance, but I'm
still confused. I've made some changes to hopefully help. I have 1
SQL table (called "Employees") with TableID, Username, Password,
AccessLevel, and LocationID. I have another table (called
"Names"-for testing purposes) with just TableID, Name, and
LocationID. The query that I built, which doesn't work, is:
SELECT `Names`.`Names`
FROM Employees, `Names`
WHERE Employees.Store_Number = `Names`.Store_Number
I'm wanting it to simply display the names from the Names
table that share the same LocationID as in the Employees Table. I
realize that at this point it should just be a list of all the
employee names from the Names table, but what it's doing is
actually displaying 2 of every name. What do I need to do to set
this up to where the MM_Username Session Variable generated at
login grabs the LocationID from the Employee Table, then uses that
LocationID and displays all the names from the Names Table with
that same LocationID? I'm sorry for my lack of understanding, and I
really appreciated the help.
As a side note, why are there apostrophes around the Name
Table but not the Employees Table in the query window? Thank you
again. -
Need Help with RecordSet Query
I need some major help please. Gettin really frustrated here.
From my search page, if I do not fill out any fields and hit
SUBMIT, all records in the recordset are being displayed. Why? I
have a default value set to '.' There should be no matches. I just
don't understand. Can someone explain it to me?
Help me obi-wan!been hashing at this all eve and haven't figured out why it
is doing this so......
here is my form:
<body>
<form id="form1" method="GET" action="dresults.php"
target="results">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><div align="center"><img src="block1.gif"
alt="ball" width="13" height="13" /> <span
class="style1">Search</span> <img src="block1.gif"
alt="ball" width="13" height="13" /> </div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="style2"><span class="style2">Drawing
# : </span></td>
</tr>
<tr>
<td class="style2"><input name="sdn" type="text"
id="sdn" size="35%" /></td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="Submit" value="Submit" />
</div></td>
</tr>
</table>
</form>
</body>
and here is the code from the results page (I only included
the top half of the code as that is where the query infomation is.
Let me know if you want to see the remainder):
<?php require_once('Connections/Birchwood.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$rc=0;
$maxRows_DrawSearch = 5;
$pageNum_DrawSearch = 0;
if (isset($_GET['pageNum_DrawSearch'])) {
$pageNum_DrawSearch = $_GET['pageNum_DrawSearch'];
$startRow_DrawSearch = $pageNum_DrawSearch *
$maxRows_DrawSearch;
$colname2_DrawSearch = "~";
if (isset($_GET['ven'])) {
$colname2_DrawSearch = (get_magic_quotes_gpc()) ?
$_GET['ven'] : addslashes($_GET['ven']);
mysql_select_db($database_Birchwood, $Birchwood);
$query_DrawSearch = sprintf("SELECT bpfno, venno, rev, title,
location, keywords FROM drawings WHERE vendor LIKE '%%%s%%' ORDER
BY bpfno ASC", $colname2_DrawSearch);
$query_limit_DrawSearch = sprintf("%s LIMIT %d, %d",
$query_DrawSearch, $startRow_DrawSearch, $maxRows_DrawSearch);
$DrawSearch = mysql_query($query_limit_DrawSearch,
$Birchwood) or die(mysql_error());
$row_DrawSearch = mysql_fetch_assoc($DrawSearch);
if (isset($_GET['totalRows_DrawSearch'])) {
$totalRows_DrawSearch = $_GET['totalRows_DrawSearch'];
} else {
$all_DrawSearch = mysql_query($query_DrawSearch);
$totalRows_DrawSearch = mysql_num_rows($all_DrawSearch);
$totalPages_DrawSearch =
ceil($totalRows_DrawSearch/$maxRows_DrawSearch)-1;
$queryString_DrawSearch = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_DrawSearch") == false
stristr($param, "totalRows_DrawSearch") == false) {
array_push($newParams, $param);
if (count($newParams) != 0) {
$queryString_DrawSearch = "&" .
htmlentities(implode("&", $newParams));
$queryString_DrawSearch =
sprintf("&totalRows_DrawSearch=%d%s", $totalRows_DrawSearch,
$queryString_DrawSearch);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title> -
Building recordset query dynamically based on form parameter availability
Hi,
I have a real estate property table that I'd like to query.
The form itself let's the user search by state, county, zip code
etc. The user need not enter all the information. For eg: If the
user just selects a state and searches, I should list all
properties that belong to that state. But if the user also selects
a county along with state then I should filter the results by state
AND county. This situation applies for a lot of the form
parameters.
Now, in Dreamweaver when I try to create a recordset, I want
to append
AND county = $_REQUEST['county']
to the end of my record set query if and only if the user
selected a county. If the user didn't select the county, I do not
want to have that as part of my query.
Is there an easy way to do this in DW? I understand that
variables let you define a default var. I donot even want to
specify a default value.
Any help is greatly appreciated.
Thanks!!You'll have to write the code yourself but something like
this...
sqlString = "SELECT .... "
if user selects county (probably a drop down list) then
sqlString = sqlString + " AND county = " + $_REQUEST
then just send the sqlString to the server.
"flash0777" <[email protected]> wrote in
message
news:e40b1o$bok$[email protected]..
> Hi,
>
> I have a real estate property table that I'd like to
query. The form
> itself
> let's the user search by state, county, zip code etc.
The user need not
> enter
> all the information. For eg: If the user just selects a
state and
> searches, I
> should list all properties that belong to that state.
But if the user also
> selects a county along with state then I should filter
the results by
> state AND
> county. This situation applies for a lot of the form
parameters.
>
> Now, in Dreamweaver when I try to create a recordset, I
want to append
> AND county = $_REQUEST
> to the end of my record set query if and only if the
user selected a
> county.
> If the user didn't select the county, I do not want to
have that as part
> of my
> query.
>
> Is there an easy way to do this in DW? I understand that
variables let you
> define a default var. I donot even want to specify a
default value.
>
> Any help is greatly appreciated.
>
> Thanks!!
> -
How do I create a guestbook in Dreamweaver CS3, Plz Help....
Hi I want to create a guestbook in dreamweaver cs3 my website is www.freewebzs.com
Also it would be brilliant if you guys could help me and recommend me background colours, is there a free website I can get background colours from?
And also what fonts and colours are most popular for websites.
Im new to dreamweaver as ive just started using it so any advice would be great, thanksI have to agree with David, if you are new to DW, then creating a guest book will be difficult for you. However, you don't have to re-invent the wheel, there are many guestbook scripts available to save you the time and certainly the headaches :-)
Take a look here for a selection: http://php.resourceindex.com/Complete_Scripts/Guestbooks/
As for colours kuler is good, but you can also look at;
These palettes may help:
http://www.colourlovers.com/palettes/search?hsv=&sortType=rank&sortBy=asc&query= spring&hex=&lover=&hueOption0=&hueOption1=&hueOption2=&publishedBeginDate=12%2F2 7%2F2004&publishedEndDate=04%2F12%2F2009&x=26&y=17
More colour schemes here:
http://www.colorschemer.com/schemes/
For fonts, you are better staying with web-safe fonts that will ensure cross browser compatibility:
http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html
Nadia
Adobe® Community Expert : Dreamweaver
Unique CSS Templates |Tutorials |SEO Articles
http://www.DreamweaverResources.com
Book: Ultimate CSS Reference
http://www.sitepoint.com/launch/005dfd4/3/133
http://twitter.com/nadiap
Maybe you are looking for
-
Hello i am in a high school programming class and i need help. I have to make an application that draws a basic face, and then i put in different scrollbars, drop menus and checkboxes to control how the face works. I have gotten most of what i need t
-
Keep image size unchanged when fullscreen the swf movie
Hi, i am including a image on SWF file (using Flash CS4) i want images to keep its original dimension whether user fullscreen the SWF movie or play it on windows. currently i do not have any action script or coding on my .fla file. when i publish the
-
How can i create validation Checks in Online Adobe Form
Hi Gurus i am trying to create Online Adobe form.how can i do the validation checks while the user enter the values in Adobe form (For Ex: lets take personnel Number if the end user enter the personnel number it must go and check the Data base table
-
How do I change about this Mac to reflect my new iMac info and not my old G4 info?
After loading Lion and finding out that none of my software is compatible with it, I reloaded Snow Leopard from the Mac OS X Install DVD. I then migrated my software and files from my old G4 Power PC. When I go to About this Mac, it is showing the pr
-
Downgrade rights expired?
Hi all, I'm thinking of buying the ThinkPad SL500 but it says on http://www-307.ibm.com/pc/support/site.wss/VSTA-DWNGRD.html that the offer expired on July 31?? What should I do? I absolutely need XP for school for systems programming courses and so