Select multiple records in a single pass
HelloI will select the row data for all items corresponding to a list of IDs.
For example:
TableA
ID; Name; (Color); Date; Time
I want to retrieve information for all the columns whose ID matches one of the following:
ID: 1,5,10
Thus,.
SELECT the color, name, Date, time of TableA
WHERE ID = '1'
but is there a way to get into the full list of IDS so that all the results are returned in a single keystroke?
Sorry for the simple question.
Published by: 803242 on November 19, 2010 07:02
where id (1, 5, 10)
Tags: Database
Similar Questions
-
How to concatenate multiple records in a single
Hello world:
I want to know if is a way to concat multiple records into one without the help of the sliders. For example, I have a table named "Authors" like this:
LAN | Author
-----------------
English | Ernest Hemingway
Spanish | Octavio Paz
Spanish | Mario Vargas Llosa
English | Sinclair Lewis
Spanish | Gabriel García Márquez
And I want to get this:
Author
-----------------
Octavio Paz, Mario Vargas Llosa, Gabriel García Márquez
I have worked with SQL Server and I can do something like this:
CREATE FUNCTION dbo. MyConcat (@lan varchar (10))
RETURNS varchar (5000) AS
BEGIN
declare @retvalue varchar (5000)
Set @retvalue = "
Select @retvalue = @retvalue + author + ',' authors where lan = @lan
return substring (@retvalue, 1, len (@retvalue)-1)
END
That is to say, do not use cursors to concatenate records. However, with ORACLE, I do something like that.
FUNCTION MyConcat(P_Lan IN VARCHAR2) VARCHAR2 IS BACK
v_ret VARCHAR2 (4000);
v_element VARCHAR2 (4000);
v_cursor sys_refcursor;
BEGIN
OPEN to SELECT V_cursor author of authors where Lan = P_Lan
LOOP
SEEK v_cursor INTO v_elemento;
OUTPUT WHEN v_cursor % NOTFOUND;
IF v_ret IS NULL THEN
v_ret: = v_element;
ON THE OTHER
v_ret: = v_ret | ', ' || v_element;
END IF;
END LOOP;
RETURN v_ret;
END;
There is another way to to do?
Best regards
JackYou can find plenty of examples here:
http://www.Oracle-base.com/articles/Misc/StringAggregationTechniques.php
and also here:
http://www.sqlsnippets.com/en/topic-11787.html
Published by: hoek on October 21, 2010 17:50
-
Select multiple channels for a single task - control and shift keys do not work
Hello
Following the advice of several other positions, I try to choose several physical channels in the drop-down list so that I can then use the function "unflatten channel channel" later. It seems that if I hold this key is pressed or cntrl, I should be able to select multiple channels in the list, however, this does not work for me. I tried to go in the "navigation key" property for the control channel to task, but there not all listed associations. Someone else has encountered this and found a solution? I previously around that by declaring several channels by a colon (for example, ai1:3), but it does not work for the unflatten function.
Thank you
Claire.
If I understand correctly, I think that you need to do is use a task property DAQmx. Try to use the channels property to get an array of strings.
-
Insert multiple records in the single form
Hi all
I met already insert many rows into a table using ADF BC. The solution is in the following thread
However,.
The above solution is useful when you want to enter new values as well as all the table entries is displayed.
What can I do if I don't want all values in the table, but just a page 'AddEntries' where I can only add new lines without going through the table entries is displayed.
As,
Say a form has 5 rows
Each line has empId, eMailSlNo, send attributes
EmpId is the same for all 5 recordings but emailId is different.
EmpId eMailSlNo plus the PK.
empId generated by the sequence.
Now, on presentation of the form, I want all five records to be inserted.
(can I use ADF form instead of the table of the ADF for the ViewObject in this case. I tried ADF form but I could only insert 1 plug at the same time).
I use 10.1.3.4
Help, please.
Thanks in advance,
Shri
Published by: newtoOTN on December 29, 2009 18:02Shri salvation,
ADF form is intended for the single insert/update. For multiple insert/update/delete using the collection as table UI is preferred. I guess your db table or table design INTERFACE default (in my opinion but I do not know your usecase entirely, so I guess might b wrong).
I would say,
-make EmpId as PK
-have another table to store EmpId (foreign key), emailSiNo, email
-Having the relationship of the master / detail between the British Colombia ADF db tables.
-Create master / detail UI and on the selection of the master, view the details and if no record is found does not add files and commit.See these examples:
http://www.Oracle.com/technology/products/jdev/tips/Mills/MasterDetailSync/Master_Detail_Synchronization_in_ADF_Faces.html
http://andrejusb.blogspot.com/2007/06/create-edit-and-delete-operations-in.htmlHope it makes sense.
~ K
-
Re: Error on select multiple records
I need the script below to select a single record by person_id. But when I run it, I have several recordings by same person_id you I used separate in the Charly.
As you can see below from the result of the query, the person_ids (21934 and 20102) appear twice.
What I want is only one record a.person_id.
Any guidance?
20102 AFRICA Benin AMER HIRE 351801 Robert Tallman EXPERT rselect a.person_id, c.org_name, a.person_type, c.org_code, a.first_name, a.last_name, d.position_title, b.email_address from person a, person_emails b, organization c, position_titles d, positions e where a.person_id = b.person_id and a.employee_status = 'A' and a.organization_code = c.org_code and a.person_type = 'AMER HIRE' and a.organization_code = e.org_code and d.position_title_number = e.position_title_number order by c.org_name ;
21934 AFRICA Benin AMER RENTAL 351801 Keith Howard COUNTRY DIRECTOR
16440 AFRICA Benin AMER HIRE 351801 Jen Norinee EXPERT [email protected]
20102 AFRICA Benin AMER HIRE 351801 Robert Tallman APCD/RURAL DEVELOPMENT rfrie
21934 AFRICA Benin AMER RENTAL 351801 John Doe APCD and RURAL DEVELOPMENT
21934 AFRICA Benin AMER RENTAL 351801 John Doe APCD/PROGRAMMING & TRAINING
21934 AFRICA Benin AMER RENTAL 351801 John Doe k EXPERTYou can try this and simply choose the title column that works for you, but for the first or the last title, you will need to fill in the correct sort order for this question:
SELECT a.person_id , c.org_name , a.person_type , c.org_code , a.first_name , a.last_name , max(d.position_title) max_title , min(d.position_title) min_title , max(d.position_title) keep (dense_rank first order by some_column) first_title , max(d.position_title) keep (dense_rank last order by some_column) last_title , b.email_address FROM person a , person_emails b , organization c , position_titles d , positions e WHERE a.person_id = b.person_id AND a.employee_status = 'A' AND a.organization_code = c.org_code AND a.person_type = 'AMER HIRE' AND a.organization_code = e.org_code AND d.position_title_number = e.position_title_number GROUP BY a.person_id , c.org_name , a.person_type , c.org_code , a.first_name , a.last_name , b.email_address ORDER BY c.org_name ;
Moreover, in the future try formatting your code is readable with out having to scroll from left to right so.
Published by: Sentinel on June 4, 2013 13:36
-
How to select multiple values in a single field.
Hi all
I once select stmt as below
==================================
SELECT msi.segment1,
IN l_chr_omc_item
OF SGM_INV_ITEM_ATTRIBUTES SIIA, msi mtl_system_items
WHERE msi.inventory_item_id = siia.inventory_item_id
AND siia.attribute12 = l_chr_tsb_item;
======================================
I need to print some l_chr_omc_item, but if the above query retrieves multiple values of the l_chr_omc_item for a l_chr_tsb_item so I need to print all the values. How to get all these values in a single rank.
Thanks in advance.
Published by: Shivaji M on June 28, 2009 23:18
Published by: Shivaji M on June 28, 2009 23:27cursor curGetxx (inpl_chr_tsb_item in SGM_INV_ITEM_ATTRIBUTES.attribute12%type)
is
SELECT
MSI. Segment1
Of
SGM_INV_ITEM_ATTRIBUTES SIIA
msi mtl_system_items
WHERE msi.inventory_item_id = siia.inventory_item_id
AND siia.attribute12 = inpl_chr_tsb_item;l_chr_omc_item SGM_INV_ITEM_ATTRIBUTES.attribute12%type;
vStrl_chr_omc_item varchar (500);Start
Open curGetxx (l_chr_tsb_item);
loop
extract the curGetxx in l_chr_omc_item;
When the output curGetxx % NOTFOUND;
vStrl_chr_omc_item: = concat (l_chr_omc_item, ',')
dbms_output.put_line (l_chr_omc_item);
end loop;
vStrl_chr_omc_item: = substr (vStrl_chr_omc_item, 1, length (vStrl_chr_omc_item)-1);
end;
/ -
Create multiple records instead of single record.
Form of Oracle 10g
Hi all
Enjoy id someone help me, I have a form and when I insert data in that form it will create a record in the database table, now my requirement that it will create 3 records in the same table, can someone tell me the logic to create 3 files instead of one.
I intend to create a database triggers but do not know who is a valid choice of not. Thank you
Concerning
Matt
Hello
If you want to do your job the way you want I suggest the creation of a joint table between
trans_amt
trans_type
called trans_amt_type , why do we not have to think about that... ?
Since it is a bad db design. It is supposed to rely on different types of Trans Table as a look up table where you can set different than necessary trans at all times.
Now, let's start on the VALIDATION KEY or insertion after Trigger (how economy and then duplicate record is as follows:)
You can use the following logic:
INSERT INTO table1 (column1..), SELECT col1... FROM table2 WHERE vc_amt > 0 and rs_amt_no _no = 0 and ct_amt_no = 0;
And as for the conditions of rest...
or
INSERT INTO trans_amt_type
(col1, col2,vc_amt_no, trans_type,
col4,
...)
values (select col1, col2 from(select col1, col2,:
vc_amt_no,
'V',col4
rn rownumfrom trans_amt where --relation FK & PK---) ;
Amatu Allah.
-
Data merge: how to get multiple records in a single text?
Hello
I'm experimenting with data merging in InDesign CS3. The biggest obstacle I've met tries to get my record flowing continuous text in a single text frame (which would, ideally, "automatic formatting" on the new pages in the document). Records vary considerably in length, and so I can't just create a standard repeat on the page text frame.
Perhaps, data fusion is not the best way to achieve this and I should be learning to script in place. I feel like I'm just one step, however.
Any suggestion would be appreciated.
Data fusion is not thread. There is a nifty script to Rorohiko who will do it for you after the merger, however. Best strategy is to merge, run the script, delete everything except the first image on the first page, then pick up the excess and auto-flux in the document.
-
scanning multiple pages and get multiple files in a single pass
be a slacker... I want to scan multiple pages using the auto feed my scanner and have EACH page end up as a single PDF...
any thoughts?
Thanks in advance
1. analyze and create a PDF document
2. open the PDF document in Adobe Acrobat and run menu Document > extract Pages...
-
Select multiple columns into a single column group
SQL dear Experts,
I have a question related to pl/sql.
I do query below. Please advice in right way.
Select phone, firstname, lastname code
of the customer
Code group
Group, but in the meantime, firstname and lastname.
Please advice
Thank you
AngeliqueBilly wrote:
I have a question related to pl/sql.
You posted the SQL code. Not PL/SQL code.
I do query below. Please advice in right way.
Select phone, firstname, lastname code
of the customer
Code groupGroup, but in the meantime, firstname and lastname.
Of course, you will also need to group by firstname and lastname for this SQL query.
With a Group of SQL, you have basically 2 types of values that can be returned:
-the value of Group of
-l' aggregated/calculated the value of this groupIf you could watch the first name and the last name by code:
select code, MIN(firstname), MAX(lastname) from customer group by code
You can see the number of unique name and surname by code:
select code, COUNT(DISTINCT firstname), COUNT(DISTINCT lastname) from customer group by code
Think of the clause group by in size (for example the code in the SQL above) and measures (calculations by code in the SQL above).
-
Data merge multiple records on a single page?
I'm working on a grand layout photos grad with names, of the years and images.
I'm trying to data merge my excel sheet spread if I can have all the images, names and years on one page. There are about 4000 images total (spread through 5 layouts), so I don't want to put all the pictures individually, the names of types and years individually and then re - arrange when we need to add additional images.
My problem is that the same data are reapeating in all fields on the page. Even when I create a new page, the same data made its appearance.
If I saw the data, I can scroll through all of them, but only ever displays both. Multiple data by option on the page are grayed out in the data merge window whenever I try. I use InDesign CS4.
Y at - it something I am doing wrong, or is there another way to approach it?
I agree that it seems like if you duplicated data in your source although I can't gray on the option of multiple data page, if I try. It is perhaps something poick to the top with this clip. Good luck & let us know how make you out.
http://www.theindesigner.com/podcasts/tid43_theindesigner_43.MP4
-
multiple records in a single line
Hi all
I want to display all group codes that have the same name of the part,
and I want to see all the codes of party in a line separated by commas. is this possible?Welcome to the forum.
Without any data sample (create table + insert orders), I guess you'll find the techniques listed here:
http://www.Oracle-base.com/articles/Misc/StringAggregationTechniques.php
you go you. -
Multiple selection of records in table advanced to update in the Search Page.
Hi all
I write the code below, to select multiple records in table advanced for the update after clicking on the button update in the Search Page.
I write this code in Processform request, but I got the exception when I run the code below.
If (PageContext.GetParameter ("UpdateOnSeaBtn")! = null)
{
Am = (XxSupppacklistAMImpl) pageContext.getApplicationModule (webBean) XxSupppacklistAMImpl;
am.saveRollback ();
OAViewObjectImpl upDtVO = (OAViewObjectImpl) am.findViewObject ("PackingListSeaVO");
PackingListSeaVORowImpl line;
HashMap vParm = new HashMap();
Row [] rows = upDtVO.getFilteredRows ("SingleSelection", "Y");
int fetCount = upDtVO.getRowCount ();
System.out.println ("Teh recovered rowcount is:," + fetCount);
RowSetIterator multiIter;
multiIter = upDtVO.createRowSetIterator ("multiIter");
multiIter.setRangeStart (0);
multiIter.setRangeSize (fetCount);
for (int i = 0; i < fetCount; i ++)
{
Row = (PackingListSeaVORowImpl) multiIter.getRowAtRangeIndex (i);
If (Row.GetAttribute ("SingleSelection")! = null)
{
If (Row.GetAttribute ("ItemNumber")! = null)
{
Object vitemNum = row.getAttribute ("ItemNumber");
System.out.println ("The selected element Num is:," + vitemNum);
vParm.put ("ItemNumber", vitemNum);
pageContext.setForwardURL ("OA.jsp?page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG", / / here, I got the exception below)
NULL,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
NULL,
vParm,
false, / / RetainAM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
}
multiIter.closeRowSetIterator ();
}
}
}
could you, please, can someone help on this.
I got below exception to the side server when it is run the code above.
Error (125,48): method setForwardURL (java.lang.String, null, null, byte, java.util.HashMap, boolean, java.lang.String, byte) is not not in the interface oracle.apps.fnd.framework.webui.OAPageContext
Kind regardsHello
832859 wrote:
for (int i = 0; i)<>
{
Row = (PackingListSeaVORowImpl) multiIter.getRowAtRangeIndex (i);
If (Row.GetAttribute ("SingleSelection")! = null)
{
If (Row.GetAttribute ("ItemNumber")! = null)
{
Object vitemNum = row.getAttribute ("ItemNumber");
System.out.println ("The selected element Num is:," + vitemNum);
vParm.put ("ItemNumber", vitemNum);> pageContext.setForwardURL"OA.jsp.page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG",//here I got below exception
NULL,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
NULL,
vParm,
false, / / RetainAM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
}-Here is you call pageContext.setForwardURL loop.
>I got below exception to the side server when it is run the code above.
Error (125,48): method setForwardURL (java.lang.String, null, null, byte, java.util.HashMap, boolean, java.lang.String, byte) is not not in the interface oracle.apps.fnd.framework.webui.OAPageContext-check 5th param should nt be vParm if it is null
Finally... After the for loop ends call... y bcz assume this page grouped 10 rows can he navigate both on the next page...:
pageContext.setForwardURL ("OA.jsp?page=/xxfls/oracle/apps/po/packlist/webui/XxSuppalistcrealistPG",
NULL,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
NULL,
NULL,
false, / / RetainAM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
}Concerning
Meher IrkPublished by: Meher Irk on March 31, 2011 19:54
-
Question to merge data from multiple records
Hi all, could really use some help here, I tried to fix this for hours now:
Make 3 different models for labels that I print on the basis of models of labels Avery for InDesign. When I come to my fusion of data on any of them, I select "Multiple records" in the title records per Document Page, but the preview and the actual creation just spits out a single unique label on each new page. For example, I use 2 x 4 "labels on 2 of them, so it should print 10 per page, but instead to put 10 unique labels on a page, it puts each new label on a new page. Therefore, instead of 100 pages for the 1 000 labels that I print, I find myself with 1,000 pages.
I know a double check of size constraints on the text box and make sure it suits you when duplicated, and to my knowledge, who is seeking as it's nice. I'm also fairly certain that CSV files that I use are in the right format, too. I am quite stuck at this stage as to what I have to do to solve this problem, no guidance would be great. Here are the screenshots of what I'm looking, please let me know if there is anything else I can give you to help diagnose the problem.
I thinnk the best way to deal with this would be to ensure that all the Avery template information on the master page. Let him be active while you do the layout in the upper left position on THE DOCUMENT PAGE, and then assign the master let anything showing that your placholders and art added none.
Reassign the master model after the merger.
-
Update multiple records at once
First, thank you very much the people who have helped me out several times now. I put things together and came across another issue of 'beauty' begin as follows. In the previous topics, I had a way to get to an array of automated classification based on the inputs of a fixtures table and some simple calculations. Now, which has been accomplished which resulted in me having to update all the teams by simply clicking a button.
As you can see in the code below, using a table with every row a form, at the end of the line, there is a button called 'OK' I have to push to update the record according to. A repeat region for all teams in this query shows the ranking of 'new', but is not yet inserted in the League table. Is it possible to have this repeat region without having to push 18 or 20 times a button update? At the end of the table, one (1) button update all records? The primary key is composed like this ' 0000 - u00a "(4 numéros un tiret puis un «u» 1 ou 2 numéros et 1 ou 2 lettres à nouveau)."
<?php require_once('Connections/connection.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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "klassement")) {
$updateSQL = sprintf("UPDATE klassement SET wedstrijden=%s, overwinning=%s, verlies=%s, gelijkspel=%s, goalsvoor=%s, goalstegen=%s, goalverschil=%s, punten=%s WHERE ploegid=%s",
GetSQLValueString($_POST['wedstrijden'], "int"),
GetSQLValueString($_POST['overwinning'], "int"),
GetSQLValueString($_POST['verlies'], "int"),
GetSQLValueString($_POST['gelijkspel'], "int"),
GetSQLValueString($_POST['goalsvoor'], "int"),
GetSQLValueString($_POST['goalstegen'], "int"),
GetSQLValueString($_POST['goalverschil'], "int"),
GetSQLValueString($_POST['punten'], "int"),
GetSQLValueString($_POST['ploegid'], "text"));
mysql_select_db($database_koscw, $koscw);
$Result1 = mysql_query($updateSQL, $koscw) or die(mysql_error());
$updateGoTo = "klassement-ploegen.php?reeksid=" . $row_klassement['reeksid'] . "";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
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;
}
}
$reeks_klassement = "-1";
if (isset($_GET['reeksid'])) {
$reeks_klassement = $_GET['reeksid'];
}
mysql_select_db($database_koscw, $koscw);
$query_klassement = sprintf("select * from klassement where reeksid = %s order by status asc, punten desc, overwinning desc, goalverschil desc", GetSQLValueString($reeks_klassement, "text"));
$klassement = mysql_query($query_klassement, $koscw) or die(mysql_error());
$row_klassement = mysql_fetch_assoc($klassement);
$totalRows_klassement = mysql_num_rows($klassement);
$id_reeks = "-1";
if (isset($_GET['reeksid'])) {
$id_reeks = $_GET['reeksid'];
}
mysql_select_db($database_koscw, $koscw);
$query_reeks = sprintf("select reeksnaam from reeksen where reeksid = %s", GetSQLValueString($id_reeks, "text"));
$reeks = mysql_query($query_reeks, $koscw) or die(mysql_error());
$row_reeks = mysql_fetch_assoc($reeks);
$totalRows_reeks = mysql_num_rows($reeks);
mysql_select_db($database_koscw, $koscw);
$query_seizoen = "select * from seizoen";
$seizoen = mysql_query($query_seizoen, $koscw) or die(mysql_error());
$row_seizoen = mysql_fetch_assoc($seizoen);
$totalRows_seizoen = mysql_num_rows($seizoen);
$huidig=$row_seizoen['huidigseizoen'];
?>
<!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" />
<link rel="stylesheet" type="text/css" media="all" href="../_styles/koscw-admin.css" />
<title>Klassement <?php echo $row_reeks['reeksnaam']; ?> | Beheerpaneel | 1349</title>
</head>
<body>
<div id="container">
<h1 class="overzichth1">Klassement <?php echo $row_reeks['reeksnaam']; ?></h1>
<?php if ($totalRows_klassement > 0) { // Show if recordset not empty ?>
<table cellpadding="5" cellspacing="0" border="0" id="klassement">
<tr>
<td class="klassementsmall bgccc bold"></td>
<td class="klassementteam bgccc bold">Ploegnaam</td>
<td class="klassementsmall bgccc bold">+</td>
<td class="klassementsmall bgccc bold">-</td>
<td class="klassementsmall bgccc bold">=</td>
<td class="klassementsmall bgccc bold">#</td>
<td class="klassementsmall bgccc bold"><img src="../_img/goalsmade.png" alt="Goals +" /></td>
<td class="klassementsmall bgccc bold"><img src="../_img/goalsagainst.png" alt="Goals -" /></td>
<td class="klassementsmall bgccc bold"><img src="../_img/goalsdifference.png" alt="Goals ≈" /></td>
<td class="klassementsmall bgccc bold">PTN</td>
<td class="klassementsmall bgccc"> </td>
</tr>
<?php
$i=0;
do {
$i++;
if($i % 2) { //this means if there is a remainder
echo "<tr class=\"calendareven\">";
} else { //if there isn't a remainder we will do the else
echo "<tr class=\"calendarodd\">";
}
?>
<td>
<?php
$rank += 1;
echo $rank;
?> </td>
<td class="klassementteam">
<?php
$thuisploeg=$row_klassement ['ploegid'];
$sql_select_thuisploeg="select ploegnaam from ploegen where ploegid = ('$thuisploeg')";
$resultset_thuisploeg=mysql_query($sql_select_thuisploeg);
while ($data_thuisploeg=mysql_fetch_array($resultset_thuisploeg))
{echo $data_thuisploeg['ploegnaam'] . " ";}?></td>
<form action="<?php echo $editFormAction; ?>" method="POST" name="klassement">
<input type="hidden" name="ploegid" value="<?php echo $row_klassement ['ploegid']; ?>" />
<td>
<?php
$tw=$row_klassement['ploegid'];
$sql_select_tw="SELECT COUNT( * ) AS twin FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tw' AND thuisploeggoals > bezoekersgoals";
$resultset_tw=mysql_query($sql_select_tw);
$data_tw=mysql_fetch_array($resultset_tw);
$data_tw['twin'];
$uitwin=$row_klassement['ploegid'];
$sql_select_uitwin="SELECT COUNT( * ) AS awin FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$uitwin' AND thuisploeggoals < bezoekersgoals";
$resultset_uitwin=mysql_query($sql_select_uitwin);
$data_uitwin=mysql_fetch_array($resultset_uitwin);
$data_uitwin['awin'];
$win=($data_tw['twin'])+($data_uitwin['awin']);
?>
<input type="text" name="overwinning" value="<?php echo $win; ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<?php
$tv=$row_klassement['ploegid'];
$sql_select_tv="SELECT COUNT( * ) AS tver FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tv' AND thuisploeggoals < bezoekersgoals";
$resultset_tv=mysql_query($sql_select_tv);
$data_tv=mysql_fetch_array($resultset_tv);
$data_tv['tver'];
$uitverlies=$row_klassement['ploegid'];
$sql_select_uitverlies="SELECT COUNT( * ) AS aver FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$uitverlies' AND thuisploeggoals > bezoekersgoals";
$resultset_uitverlies=mysql_query($sql_select_uitverlies);
$data_uitverlies=mysql_fetch_array($resultset_uitverlies);
$data_uitverlies['aver'];
$ver=($data_tv['tver'])+($data_uitverlies['aver']);
?>
<input type="text" name="verlies" value="<?php echo $ver; ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<?php
$thuisdraw=$row_klassement['ploegid'];
$sql_select_thuisdraw="SELECT COUNT( * ) AS tdraw FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$thuisdraw' AND thuisploeggoals = bezoekersgoals";
$resultset_thuisdraw=mysql_query($sql_select_thuisdraw);
$data_thuisdraw=mysql_fetch_array($resultset_thuisdraw);
$data_thuisdraw['tdraw'];
$awaydraw=$row_klassement['ploegid'];
$sql_select_awaydraw="SELECT COUNT( * ) AS adraw FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$awaydraw' AND thuisploeggoals = bezoekersgoals";
$resultset_awaydraw=mysql_query($sql_select_awaydraw);
$data_awaydraw=mysql_fetch_array($resultset_awaydraw);
$data_awaydraw['adraw'];
$draw=($data_thuisdraw['tdraw'])+($data_awaydraw['adraw']);
?>
<input type="text" name="gelijkspel" value="<?php echo $draw ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<?php $wedstrijden=$win+$ver+$draw; ?>
<input type="text" name="wedstrijden" value="<?php echo $wedstrijden; ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<?php
$tgv=$row_klassement ['ploegid'];
$sql_select_tgv="SELECT SUM( thuisploeggoals ) AS tgv1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tgv'";
$resultset_tgv=mysql_query($sql_select_tgv);
$data_tgv=mysql_fetch_array($resultset_tgv);
$data_tgv['tgv1'];
$ugv=$row_klassement ['ploegid'];
$sql_select_ugv="SELECT SUM( bezoekersgoals ) AS ugv1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$ugv'";
$resultset_ugv=mysql_query($sql_select_ugv);
$data_ugv=mysql_fetch_array($resultset_ugv);
$data_ugv['ugv1'];
$gv=($data_tgv['tgv1'])+($data_ugv['ugv1']);
?>
<input type="text" name="goalsvoor" value="<?php echo $gv; ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<?php
$tgt=$row_klassement ['ploegid'];
$sql_select_tgt="SELECT SUM( thuisploeggoals ) AS tgt1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$tgv'";
$resultset_tgt=mysql_query($sql_select_tgt);
$data_tgt=mysql_fetch_array($resultset_tgt);
$data_tgt['tgt1'];
$ugt=$row_klassement ['ploegid'];
$sql_select_ugt="SELECT SUM( bezoekersgoals ) AS ugt1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$ugv'";
$resultset_ugt=mysql_query($sql_select_ugt);
$data_ugt=mysql_fetch_array($resultset_ugt);
$data_ugt['ugt1'];
$gt=($data_tgt['tgt1'])+($data_ugt['ugt1']);
?>
<input type="text" name="goalstegen" value="<?php echo $gt; ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<?php $goals=$gv-$gt; ?>
<input type="text" name="goalverschil" value="<?php echo $goals; ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<?php $punten=($win*3)+($draw*1); ?>
<input type="text" name="punten" value="<?php echo $punten; ?>" class="inputscore" readonly="readonly" />
</td>
<td>
<input type="submit" value="OK" />
</td>
<input type="hidden" name="MM_update" value="klassement" />
</form>
</tr>
<?php } while ($row_klassement = mysql_fetch_assoc($klassement)); ?>
</table>
<?php } // Show if recordset not empty ?>
</div>
</body>
</html>
<?php
mysql_free_result($klassement);
mysql_free_result($reeks);
mysql_free_result($seizoen);
?>Each record is separated, as well as a record can be updated at once, unless you want that all records have the same value.
To update multiple records in a single operation, you must send the form tabular data. You do this by adding an empty pair of brackets at the end of the name attribute of each entry on the form like this:
This translates by $_POST ['ploegid'] which contains a table of all IDS: $_POST ['ploegid'] [0], $_POST ['ploegid'] [1], $_POST ['ploegid'] [2] and so on. All the attributes of the repeat region name need to have added hooks. The following hidden field should be outside of the repeat region and may not have the brackets:
You can then use a loop for updating the values like this:
for ($j = 0, $len = count($_POST['ploegid']); $j < $len; $j++) { $updateSQL = sprintf("UPDATE klassement SET wedstrijden=%s, overwinning=%s, verlies=%s, gelijkspel=%s, goalsvoor=%s, goalstegen=%s, goalverschil=%s, punten=%s WHERE ploegid=%s", GetSQLValueString($_POST['wedstrijden'][$j], "int"), GetSQLValueString($_POST['overwinning'][$j], "int"), GetSQLValueString($_POST['verlies'][$j], "int"), GetSQLValueString($_POST['gelijkspel'][$j], "int"), GetSQLValueString($_POST['goalsvoor'][$j], "int"), GetSQLValueString($_POST['goalstegen'][$j], "int"), GetSQLValueString($_POST['goalverschil'][$j], "int"), GetSQLValueString($_POST['punten'][$j], "int"), GetSQLValueString($_POST['ploegid'][$j], "text")); mysql_select_db($database_koscw, $koscw); $Result1 = mysql_query($updateSQL, $koscw) or die(mysql_error());}
Maybe you are looking for
-
Why I can't have junk mail for my Mail app from my iPhone update to iOS 9.3.4?
Since updating my iPhone 6 9.3.3 iOS I see is more, access or add my "junk e-mail" folder in my email application. It still vibrates or makes noise when I get a new email in my spam folder, but I can not physically at him. I use hotmail. Help, please
-
Satellite R630 - integrated webcam does not
Hello I hope someone can help me. My built-in webcam on my Toshiba Satellite R630 spontaneously stopped working in the last two weeks. I tried: -Check if it is enabled in the BIOS and there is no option to select a webcam here.-Restore my laptop comp
-
HP Deskjet F4480: Error paper output
I have not used my F4480 in a few years and I just bought new cartridges. I went to print something and it says that it is out of paper when I have about 20 sheets of paper loaded. I tried using the troubleshooting online, but it is said to use the p
-
How do I get my webscreen moved to the Center?
How do I get my webscreen moved to the Center? Everything has moved towards where I lose the right side. Even my desktop wallpaper is shifted to the right.
-
I tried everything I can think of including uninstall programs to create more memory. Nothing seems to work and the computer becomes slower and slower. I'm about to this uprising by the window and buy a new one. I have Windows XP Media Center Edition