Filter Recordset
Using MS SQL and ASP VBScript. I have a table called
PRODUCTS, in this table there is a field called CATEGORIES. now the
CATEGORIES field contains comma separated values representing each
category it belongs to ie: 2,5,10,12. So in this example there are
4 categories this product belongs to. Now I need to filter a
recordset by category based on a single variable.
So if I click my link: mypage.asp?CatID=2, it should return
all the records that have 2 in the CATEGORIES field.
I tried using the % wildcard but it would return 2, 12, 20,
basically anything with a 2 in it which is not what I am looking
for.
SELECT *
FROM PRODUCTS
WHERE CategoryID .......This is where I can't get it working.
any suggestions?
bump
Similar Messages
-
Filter recordset with session variable
This has never happened to me before, but for some reason, my
recordset that drives a dynamic table won't filter results based on
a session variable. I know session variables are working because I
have the session variable echo on the page (dragged-n-dropped my
session variable from the Bindings panel to my page), and that
works fine. So why can't I filter my recordset with the same
session variable??? What's going on?
PS: I've attached my result page's code to this
message.Gabe the Animator wrote:
> <?php require_once('Connections/sales.php'); ?>
> <?php
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType,
$theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $theValue = get_magic_quotes_gpc() ?
stripslashes($theValue) : $theValue;
>
> $theValue = function_exists("mysql_real_escape_string")
> mysql_real_escape_string($theValue) :
mysql_escape_string($theValue);
>
> switch ($theType) {
> case "text":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
> break;
> case "long":
> case "int":
> $theValue = ($theValue != "") ? intval($theValue) :
"NULL";
> break;
> case "double":
> $theValue = ($theValue != "") ? "'" .
doubleval($theValue) . "'" :
> "NULL";
> break;
> case "date":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
> break;
> case "defined":
> $theValue = ($theValue != "") ? $theDefinedValue :
$theNotDefinedValue;
> break;
> }
> return $theValue;
> }
> }
>
> $colname_rsSales = "-1";
> if (isset($_SESSION['state'])) {
> $colname_rsSales = $_SESSION['state'];
> }
> mysql_select_db($database_sales, $sales);
> $query_rsSales = sprintf("SELECT * FROM sales WHERE city
= %s",
> GetSQLValueString($colname_rsSales, "text"));
> $rsSales = mysql_query($query_rsSales, $sales) or
die(mysql_error());
> $row_rsSales = mysql_fetch_assoc($rsSales);
> $totalRows_rsSales = mysql_num_rows($rsSales);
>
> session_start(); ?>
The issue is that PHP doesn't "work" with session values
until the session has started, and that must be done on each page,
and must be done in the code *above* any reference to a session
variable. The code you posted has the session_start() after it
tries to use the session value ito filter the recordset. So move
this last line of code ( session_start(); ) above $colnam_rsSales =
"-1". Better yet, use:
if(!session_id()){
session_start();
To prevent some versions of PHP from generating a
warning/notice if you've called session_start() on the page already
and you call it again.
Danilo Celic
| Extending Knowledge Daily :
http://CommunityMX.com/
| Adobe Community Expert -
I am having the same problem as user "Gabe the animator" in a post sent in 2007.
"my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
here is the code:
<?php require_once('Connections/mockconn.php'); ?>
<?php
session_start();
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
if(!session_id()){
session_start();
$colname_info = "-1";
if (isset($_SESSION['email'])) {
$colname_info = $_SESSION['email'];
mysql_select_db($database_mockconn, $mockconn);
$query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
$info = mysql_query($query_info, $mockconn) or die(mysql_error());
$row_info = mysql_fetch_assoc($info);
$totalRows_info = mysql_num_rows($info);
?>
<!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=utf-8" />
<title>home</title>
</head>
<body>
<div id="info">hello <?php echo $row_info['']; ?></div>
<?php
if (isset($_SESSION['email'])) {
echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
?>
</body>
</html>
PLEASE PLEASE HELP.... I have been at this for day's...
how do I get the record set to filter based on the value of the session variableSorry I forgot to mension the error I am getting?
( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
Call Stack
Time
Memory
Function
Location
1
0.0093
389024
{main}( )
..\home.php:0
Why is this error coming up? -
Filter Recordset by a Variable - HELP!!
I'm using ASP/VBSCRIPT with an Access database.
I have a variable that contains multiple email address, for
example
Dim Var1
Var1 = [email protected], [email protected],
[email protected]
How do I filter a recordset using that variable. How do I
retrive the records on the database that contain those email
address.
Any one has an asnwer?
Please advise. Thanks!Will you always know how many variables there are, or will
the number be
dependent on user action?
I'm thinking you should probably have an array, and work
through it to get a
list of variables, the present those to your SQL statement in
an
IF Email == Var1 OR Email = Var2 OR
But I'm not sure how you'll do it if you have a number of
variables you
don't know?
I'll check back in a bit if no solutions have been offered.
"FLEQUE" <[email protected]> wrote in
message
news:eeu92f$8r2$[email protected]..
> I'm using ASP/VBSCRIPT with an Access database.
>
> I have a variable that contains multiple email address,
for example
>
> Dim Var1
> Var1 = [email protected], [email protected],
[email protected]
>
> How do I filter a recordset using that variable. How do
I retrive the
> records
> on the database that contain those email address.
>
> Please advise. Thanks!
> -
Filter recordset with results of another?
Can you filter a recordset with the results of a field from a
proceeding recordset in PHP?Manually setup a variable in between your recordsets in your
head.
$var = $row_firstRecordset['Fieldname'];
Second recordset, just use your $var name to filter.
HTH,
Jon
"tccdover" <[email protected]> wrote in
message
news:eaoha0$pcb$[email protected]..
> Can you filter a recordset with the results of a field
from a proceeding
> recordset in PHP? -
Filter recordset between dates
Hi all...
I'm trying to filter a recordset on two dates using 'between' in my sql
I'm getting nowhere with it.
I'm using Dreamweaver 8.2 and access database.
Here is my code:
<%
Dim RSReport1__param1
RSReport1__param1 = "01-01-2000"
If (Request("reportfrom") <> "") Then
RSReport1__param1 = Request("reportfrom")
End If
%>
<%
Dim RSReport1__param2
RSReport1__param2 = "01-01-2000"
If (Request("reportto") <> "") Then
RSReport1__param2 = Request("reportto")
End If
%>
<%
Dim RSReport1
Dim RSReport1_cmd
Dim RSReport1_numRows
Set RSReport1_cmd = Server.CreateObject ("ADODB.Command")
RSReport1_cmd.ActiveConnection = MM_myconn_STRING
RSReport1_cmd.CommandText = "SELECT Count(Actions.ActionID) AS CountOfActionID, Actions.Department, ActionSource.SourceOfAction FROM ActionSource INNER JOIN (Actions INNER JOIN Department ON Actions.Department = Department.Department) ON ActionSource.SourceOfAction = Actions.SourceOfAction WHERE (((Actions.Date_Raised) Between #?# And #?#)) GROUP BY Actions.Department, ActionSource.SourceOfAction ORDER BY Actions.Department;"
RSReport1_cmd.Prepared = true
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param1", 135, 1, -1, RSReport1__param1) ' adDBTimeStamp
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param2", 135, 1, -1, RSReport1__param2) ' adDBTimeStamp
Set RSReport1 = RSReport1_cmd.Execute
RSReport1_numRows = 0
%>
No matter what i do, i just can't get the recordset to work.
Any ideas before i pull my teeth out???
I've also tried
<%
Dim RSReport1__param1
RSReport1__param1 = "01-01-2000"
If (Request("reportfrom") <> "") Then
RSReport1__param1 = Request("reportfrom")
End If
%>
<%
Dim RSReport1__param2
RSReport1__param2 = "01-01-2000"
If (Request("reportto") <> "") Then
RSReport1__param2 = Request("reportto")
End If
%>
<%
Dim RSReport1
Dim RSReport1_cmd
Dim RSReport1_numRows
Set RSReport1_cmd = Server.CreateObject ("ADODB.Command")
RSReport1_cmd.ActiveConnection = MM_myconn_STRING
RSReport1_cmd.CommandText = "SELECT Count(Actions.ActionID) AS CountOfActionID, Actions.Department, ActionSource.SourceOfAction FROM ActionSource INNER JOIN (Actions INNER JOIN Department ON Actions.Department = Department.Department) ON ActionSource.SourceOfAction = Actions.SourceOfAction WHERE (((Actions.Date_Raised) Between ? And ?)) GROUP BY Actions.Department, ActionSource.SourceOfAction ORDER BY Actions.Department;"
RSReport1_cmd.Prepared = true
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param1", 135, 1, -1, RSReport1__param1) ' adDBTimeStamp
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param2", 135, 1, -1, RSReport1__param2) ' adDBTimeStamp
Set RSReport1 = RSReport1_cmd.Execute
RSReport1_numRows = 0
%>
But get this error:
Datatype mismatch in criteria expression
Help Please!!!
AndyThanks bregent
I changed the type to 133 and the code is working now.
I still get the error in the Dreamweaver dialog box when i test the recordset, but the code works...
Thanks again
Andy -
Hi,
I m trying to filter an asp recordset with % wildcart but impossible to do it.
Have got a asp form with a dropdown list based on a recordset that stores value (numeric) in a variable (id).
So this variable is used on my result asp page to filter a new recordset by this numeric value.
Im using wild card in order to display all records like this SQL query:
SELECT *
FROM proprietes
WHERE ville LIKE %MMColParam%
MMColParam defined like this :
Numeric
Request.Form("ville")
default value %
So when it generates sql query, it gives SELECT *FROM proprietes WHERE ville LIKE '%MMColParam%' and testing it, it works (testing recordset in dream) but saving it and reopens recordset the query becomes : SELECT *FROM proprietes WHERE ville LIKE %MMColParam% and testing recordset gives error !!
Someone can help me?
Thanks a lot.Hi thanks a lot
Here my asp form :
Request form "ville" value is coming from access database and is a numeric value (autoid) wich is used to filer recordset on results page.
I done this type of fiter several times with other version of dreamweaver but with CS4 impossible to do it (or i missed something!!)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/immo.asp" -->
<%
Dim local
Dim local_cmd
Dim local_numRows
Set local_cmd = Server.CreateObject ("ADODB.Command")
local_cmd.ActiveConnection = MM_immo_STRING
local_cmd.CommandText = "SELECT * FROM villes"
local_cmd.Prepared = true
Set local = local_cmd.Execute
local_numRows = 0
%>
<!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=utf-8" />
<title>Document sans titre</title>
</head>
<body>
<p> </p>
<p> </p>
<form id="form1" name="form1" method="post" action="resultats3.asp">
<p> </p>
<p>
<label>
<select name="ville" id="ville">
<option value="%" <%If (Not isNull((local.Fields.Item("idville").Value))) Then If ("%" = CStr((local.Fields.Item("idville").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Indifférent</option>
<%
While (NOT local.EOF)
%>
<option value="<%=(local.Fields.Item("idville").Value)%>" <%If (Not isNull((local.Fields.Item("idville").Value))) Then If (CStr(local.Fields.Item("idville").Value) = CStr((local.Fields.Item("idville").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(local.Fields.Item("ville").Value)%></option>
<%
local.MoveNext()
Wend
If (local.CursorType > 0) Then
local.MoveFirst
Else
local.Requery
End If
%>
</select>
</label>
</p>
<p> </p>
<p> </p>
<p>
<label>
<input type="submit" name="button" id="button" value="Envoyer" />
</label>
</p>
</form>
<p> </p>
<p> </p>
</body>
</html>
<%
local.Close()
Set local = Nothing
%>
Here my asp results page:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/immo.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "%"
If (Request.Form("ville") <> "") Then
Recordset1__MMColParam = Request.Form("ville")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_immo_STRING
Recordset1_cmd.CommandText = "SELECT * FROM proprietes WHERE ville Like ?"
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5, 1, -1, "%" + Recordset1__MMColParam + "%") ' adDouble
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<!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=utf-8" />
<title>Document sans titre</title>
</head>
<body>
<p><br />
<%
response.write(request.form("ville"))%>
<br />
<br />
SELECT * <br />
FROM proprietes<br />
WHERE ville LIKE '%vil%'
</p>
<p> </p>
<p><br />
<br />
</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%> -
How to filter recordset after execute?
I hope this is an easy one.
Lets say that I have a recordset like:
Dim compRS
Dim compRS_cmd
Dim compRS_numRows
Set compRS_cmd = Server.CreateObject ("ADODB.Command")
compRS_cmd.ActiveConnection = myConn
compRS_cmd.CommandText = "SELECT * FROM myTable WHERE myCol
like ?"
compRS_cmd.Prepared = true
compRS_cmd.Parameters.Append
compRS_cmd.CreateParameter("param1", 200, 1, 255, myParam) '
adVarChar
Set compRS = compRS_cmd.Execute
compRS_numRows = 0
I wish to be able to filter the rows, loop through the
results and delete the filter more than once.
I was always using ADO filter like myRS.Filter = "myCol like
'something'" but it is not working now as the way that DW creates a
recordset has changed.
ThanksHi,
Thanks for your reply.
I don't really know how to do it.
Please explain me how to do it.
Thanks,
Marco -
Default values for dependent drop down menu
Hi!
I did create an insert record page that lets the user put in information using text fields. In addition the form has a dependent drop down menu for a category and then depending on the chosen category, the user is presented with choices in a second drop down menu for subcategories.
The insert of the record itself works fine.
The records are then listed in a table. A link to a details page should then list all fields of a chosen record. I have another form sporting them dependent drop down menus again. Since I retrieve a record from the database I would like to have the drop down menus default to the values stored in the database.
But whatever I tried the menus always default to the respective first entries in each menu.
I tried to use the "select value equal to" field in the "insert record" for the category and the "Default detail value" field in the dependent drop down item for the subcategory field.
Any pointers anybody?
Thanks in advance
JuergenHi there I cannot understand your request fully but I think I understand....
I think I have done nearly exactly what you need
I will try to explain
for a start I am working on a art gallery site that has many different artists and many different paintings
I am able to add a new artist and have that artist name appear automatically in a dropdown menu on my add painting form page so that when I add a new painting I do not have to type the arrtists name every time
I am not sure this is what you need but I think maybe....
(i have another site that displays different categories of jewellry... with a form that has same dropdown and can choose product category.... but the process is the same)
the way I did it was to first create an 'artist_info' table in my database and an 'add artist page' pretty simple
Then an painting_pnt table in my database and an 'add painting' page with a form that contains a dropdown menu that is dynamically populated from the artist_infotable... label from the artist_name field value from the artist_id field so the form uses two recordsets.......
Then in my painting_pnt table I have a field that stores the artist_id
So when I add a new artist..... the name automatically appears in the dropdown menu when I add a new painting I choose the artist name and then later I can filter recordsets on my detail pages using the id_artist....
there is a lot more to it as well but that should get you started
I hope this helps
If you have any questions at all I will try to explain better
takiteasy -
Can you use a php variable to filter a recordset?
I've got a table of 'events', which have a description and
more importantly for this a month ID number. (1-12 for the months
of the year, when the event takes place) .
I've used php's date function on a page to fund out
numerically what month it is now $thismonth = date("n");
i want to filter my recordset by only bringing up events that
take place during the current month so where event_month =
$thismonth
IS this possible? It seems like it should be easy to do but I
can't get it to work.
Thanks in advance
Davejnkjnkjnkjnkjn wrote:
> i want to filter my recordset by only bringing up events
that take place
> during the current month so where event_month =
$thismonth
>
> IS this possible? It seems like it should be easy to do
but I can't get it to
> work.
Yes, it's very easy, but you need to do a little hand-coding.
In the
Advanced recordset dialog box set the end of the SQL query to
WHERE
event_month = 1. When you have saved the recordset, change
the SQL to
WHERE event_month = $thismonth.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Unable to filter a recordset using a session variable
I have a volunteer application page and when the volunteer presses <Submit> their info is saved in a MySQl db table and a session variable is created containing the primary key of their record in the table, control is then passed to a "success page". The success page can access the session variable (I proved this by displaying the session variable on the success page) so my next step was to create a recordset in the success page with a filter using the session variable to select the appropriate row in the table, allowing me to display to the volunteer the info they submitted.
I set up a test success page which displays the session variable and one field of the volunteer info. When I test this I see the session variable displayed but the corresponding volunteer info field from the recordset is not displayed.
The volunteer application page is here www.hollisterairshow.com/volunteerapp.php and the successpage is here www.hollisterairshow.com/thanksvol.php
The code that creates the session variable in the volunteer application page is shown below
$_SESSION['volunteer_id'] = mysql_insert_id();
The code to display the session variable in the success page is shown below
<?php echo $_SESSION['volunteer_id']; ?>
The code to display the volunteer info is shown below
<h1> Thank You <?php echo $row_rsVolunteerApp['firstname']; ?>!! </h1>
The recordset definition is shown below
The success page test result is shown below, as you can see the volunteer's first name is not displayed immediately after the "Thank you" message but the session variable holding the correct primary key (41) is shown correctly.
Does anyone have an idea of what I'm doing wrong?
Thanks
TonyWhere did you put session_start()? It needs to be before the variable is accessed. It's obviously before the line that displays the value in your page, but is it before the SQL query is generated?
Also, have you checked in phpMyAdmin to see whether volunteernumber 41 has any values in the database? -
How to filter a recordset using a combo (ASP)
Hi.
I have my website in ASP linked to an Access database using DSN. It is working ok.
I need some help to make a filter in a recordset, but the filter is a combo box that any time that a value is choosed the data int he grid/table is also changed.
Here it is my code:
SELECT *
FROM qry_YTD
WHERE DirMan = MMColParam
ORDER BY id_fy DESC, tot desc
Please somebody help me.
Regards,
Marco
[Moved by moderator to the appropriate forum]Hi,
Thanks for your reply.
I don't really know how to do it.
Please explain me how to do it.
Thanks,
Marco -
Alternate method to writing filter for recordset using session variable
I'm not sure if this can be done. I have a user page which I'd like to return database info based upon a userid entered on another page. So far, the session variable (userid) is captured on the user page however it is supposed to return the user's name rather than displaying the session variable.
My problem is this. Within dreamweaver, I am able to create recordsets however I cannot create a filter. The connection works. At this point, I am searching for a workaround where I can tie in the session variable to recordsets. I should make mention that whenever I update the sql statement using the recordset widget, my recordset disappears. ? At any rate, heres a sample of the code sans connection strings, etc.
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_newuniversity1_STRING
Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid = '" & Session("userid_my") & "'"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
On the user page, I have a 'Welcome' and the following code
{Request.userid_my}
Any suggestions? I'm afraid I'm a newbie to asp within dreamweaver cs3.>When I insert request.userid_my code it returns the session variable
AFAIK, session variables are not part of the request object - so I do not understand why you are referencing them this way. I would use the standard reference method : Welcome <%Response.Write(Session("username"))%>
>when I insert the recordset associated with 'name' I get an Adobe End of file error. ?
Sounds like a possible problem with your installation. You may need to try reinstalling DW. How are you "inserting" this recordset and when does the error occur?
Regarding your next post...
>select name from table_name where userid = '" & namemy & "'"
>The statement consistently returns a 'quoted string not properly terminated' error.....
The select statement you quoted is obviously not complete. If you are refering to the select in your OP:
Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid = '" & Session("userid_my") & "'"
I see nothing wrong with that syntax and the string appears to be terminated correctly. If there is a different statement causing the error, please post the entire line and include a line above and below. -
Using the results of one recordset to filter another.
Hi
I have a dynamically generated web page that uses a recordset to gather most of the relevant information that is needed on it. However, what i need to do is create a second record set on the same page and filter that second recordset using one of the results generated from the first recordset. The problem that i am having is that the first recordset displays its information as an echo <?php echo $row_Recordset1['move_type']; ?> but i obviously cannot use this echo code in the filter for the second recordset, the code obviously needs tweaking but i am not sure how.
If it were as simple as copy and paste the query i would need for the recordset2 is as follows but i am unsure how to code the echo from the first recordset. I am well aware that the following code could never work but i hope it works as simplified example of my intention.
SELECT ID, move_name, catagory_link_path, move_type, mem_on_off
FROM moves
WHERE move_type = <?php echo $row_Recordset1['move_type']; ?>
ORDER BY move_name ASC
Any help would be appreciatedI can think of two ways this can be done. One way, (which may or may not be appropriate in your case) is to use an INNER JOIN. Here is an example:
$presenterset1=mysql_query("SELECT * FROM presenters INNER JOIN presenters_course USING (presenter_id) WHERE course_id='$course_id' ORDER BY presenter_rank");
Do a search for tutorials on INNER JOIN for information about how to use it.
Another possible solution is to nest one SQL statement within the result of another: like this:
$sql1=mysql_query("SELECT one, two, three from table1 WHERE one='$one'");
while ($result1=mysql_fetch_assoc($sql1)){
extract ($result1);
$sql2=mysql_query("SELECT apple, orange, pear from table2 WHERE fruit='$three'");
while ($result2=mysql_fetch_assoc($sql2)){
extract ($result2);
echo "$apple and $orange" and $pear<br/>"; -
REQUEST: A filter method for the Recordset object
How about it ? Having a recordset object without a .Filter method could reduce significantly the dependency on the Database server. Imagine having to make a query for each entry on a list in order to obtain related information!
No has comment on this ... for what I think it would be a useful tool for developers.
Is there a reason why isn't part of the SAP's recordset object.
Maybe you are looking for
-
How do I save an illustrator cc file to open in cs6?
How do I save an illustrator cc file to open in cs6? I get an error when I send the file to a colleague and they cant open it. It doesnt give me any options.
-
Servlet action is not available
Hi All, I am very new to the forum,I am trying to execute a simple struts program.I am calling a .java file which is in test package and callling success.jsp page.I am getting Servlet action is not available.I am calling as http://localhost:8080/trai
-
How do I get delete button back on inbox, it disapeared.
My delete button has disappeared from my inbox. I have to open email to delete it now. How do I get it back?
-
Hi gurus, could anyone plz tell me the load logic and the splitting logic for the following scenario: Conversion of General Ledger Balances from the various legacy systems into SAP. The balances will be loaded month for the current year only. SAP ha
-
Running firefox 3.6.19 on Dual 867 mhz PowerPC G4 Machine Name: Power Mac G4 Machine Model: PowerMac3,6 CPU Type: PowerPC G4 (2.1) Number Of CPUs: 2 CPU Speed: 867 MHz L2 Cache (per CPU): 256 KB L3 Cache (per CPU): 1 MB Memory: 2 GB Bus Speed: 133 MH