Extract data from database using php script and entry for datagrid.
Hi all
I intend to use the php script below to extract data from a database.
I want to then display it in a datagrid control, the datagrid control has Ref columns job, the company and the position.
The php script I have is
<? PHP
$hostname_conn = "localhost";
$username_conn = "";
$password_conn = "";
$conn = mysql_connect ($hostname_conn, $username_conn, $password_conn);
@mysql_select_db ("videochat");
$query = "SELECT * FROM work."
$result = mysql_query ($query);
$row = mysql_fetch_array ($result);
$ref = $row ["jobref"];
$company = $row ['company'];
$position = $row ["position"];
echo "< Ref > $ref < / Ref >";
echo "< company > $company < / company > ';
echo "< location > $position < / location >."
? >
Could someone show me how I chuck this data in a grid?
Thank you
Hello
You should start using the authority, either zendamf which is used by the data wizards in flashbuilder 4 or with amfphp which is probably better than zend but has not all nicities such as the creation of objects of value.
This project uses amfphp, basically, it uses remoteobjects so returned php is in a ready to put directly into a grid or a datagroup arraycollection collection.
If you need help with this sort of thing PM me and I can do a login session...
the PHP services for calls used in the application
<>
class pets
{
var $db_host = "localhost";
var $db_name = "flashhub_pets";
var $db_user = "flashhub_david";
var $db_pwd = "david";
function pets()
{
Define the methodTable for this class in the constructor
$this-> methodTable = array)
"getPets"-online (table)
'description' => 'Pets, database',
'access' => 'remote '.
)
);
}
function getAllPets()
{
$mysql = mysql_connect ($this-> $this-> db_user, db_host), $this-> db_pwd;
@mysql_select_db ($this-> db_name);
$Query = "SELECT * from pet;
$Result = mysql_query ($Query);
return ($Result);
}
function getTypeOfPets ($category)
{
$mysql = mysql_connect ($this-> $this-> db_user, db_host), $this-> db_pwd;
@mysql_select_db ($this-> db_name);
$Query = "SELECT * from pet where CATEGORY = $category;
$Result = mysql_query ($Query);
return ($Result);
}
function getCategories()
{
$mysql = mysql_connect ($this-> $this-> db_user, db_host), $this-> db_pwd;
@mysql_select_db ($this-> db_name);
$Query = "SELECT * from category";
$Result = mysql_query ($Query);
return ($Result);
}
}
?>
David
Tags: Flex
Similar Questions
-
How to ETL extract data from database Oracle 11.1 using Cognos Data Manager 10.1
Hello
I need to run the IBM Cognos Data Manager 10.1 version ETL tool for extracting data from the Oracle11.1 database.
My understanding is that, from the point of view of database, the best way would to have a stored procedure that will provide a reference cursor in the ETL client tool.
However, a database procedure the ETL tool running seems not to be possible in this version of the data manager.
If someone has done this before? What is the best way for this snippet to do?
Thank you
Emilija
Annabelle says:
My reading of original question: "What is the best way for this snippet to do?"
Sorry - is NOT helping.
The BEST way to extract data from a table is to use a SELECT statement.
You said you want to do.
So just repeat your original question instead of those that ask you to answer will not move forward us.
-
Unable to display data from database using persistence mobile A-team
Hello
We use the accelerator of persistence for Mobile A-team with application of the MAF. We built the REST services based for CRUD operations on a table. We are unable to use the POST CREATE service by application of the MAF. We tried using saveTask and addTask data control methods it generates automatically. Although it is saved locally to the iterator of data control, it doesn't push the data from database. We tried to test the service REMAINS independent and works well.
Can anyone help regarding if lack us measures in the same?
Thank you
Vignesh
Vignesh,
Indeed, there are two issues here:
-the attributes of the payload are different
-the structure of the payload is different, the GET request has an attribute "Task" that returns an array, the POST request submitting a single object through the attribute "taskDetails.
By default, the accelerator of persistence assumes that the POST request has the same payload structure and attributes as the GET request that you used to 'discover' the data objects.
However, you can easily change this as follows:
-To add additional attributes required in the POST, you should restart the wizard REST-JSON directly access the data object attributes screen and click on the button 'add an attribute '. Add each attribute you need in the POST request and the attribute name to the value required in the POST request payload. No matter that this attribute of the payload does not exist in the payload GET, it will be ignored during extraction of the tasks.
-To fix the second issue, you must change the persistence - mapping.xml:
-go to the createMethod task
-Remove the payloadElementName attribute
-Add the payloadRowElementName attribute and set the value to "TaskDetails.
It's a little strange that you post in order to get other attributes, it is there another resource GET that returns all attributes for a task?
In addition, you cannot derive columns audit as created_by on the server-side? It's a bit unusual set these values at the level of the customer.
Steven.
-
extract data from XMLType using vbscript on OleDB?
Hello.
We have a problem where the XMLType column data to get in 11.2.0.1 on Windows x 64 worked very well, but we have moved to 11.2.0.3 Patch 21 and the column type changed to binary storage default, and we started to do read errors when the data was greater than 32 k (or so it seems).
I opened a SR, and Oracle support sent me a VB script to test playback of the table on OleDB. However, their script doesn't seem to work as announced, so after a lot of gooling, came to us with the following to read a column of xmltype - not the same table, just to test that the vbscript works:
REM need to re-register the dll OLEDB as there is a problem with the oracle client and the dll registration
REM start following an administrator command prompt
REM regsvr32.exe c:\Users\finite9\oracle\product\11.2.0\client_2\bin\oraoledb11.dll
the con value = createobject ("adodb.connection")
con. Open "provider = oraoledb.oracle; user id = finite9; password = password1; data source = TSTDB ".
Set rs = createobject ("adodb.recordset")
RS. Open 'select SW_REPLY changedate', con
While not on the place. EXPRESSIONS OF FOLKLORE
MsgBox rs. Fields ("ChangeDate"). Value
RS. MoveNext
Wend
RS. Close
Set rs = nothing
con. Close
the value con = nothing
This works perfectly and displays 12 rows in this column in a vbscript dialog box, but I am not able to do to extract the XMLType column clob data. I try with for example. RS. Open 'select REPLYDATA.getclobval () from SW_REPLY', stupid but just get errors.
Is it possible to extract data from XMLType on OleDB with vbscript? It cannot be OleDB itself which poses problem, because it has worked in our application and 11.2.0.1 although with < 32 k of data. But it would be nice to have a working test case while we were able to test out our app. If it is with vbscript or c# is irrelevant.
ignore the message, it is possible. Support of Oracle gave me this:
the con value = createobject ("adodb.connection")
con. Open "provider = oraoledb.oracle; user id = finite9; password = password1; data source = DEVTST ".
Set rs = createobject ("adodb.recordset")
RS. Open "select t.REPLYDATA.getclobval () as xmltestdata OF SW_REPLY t", con
While not on the place. EXPRESSIONS OF FOLKLORE
MsgBox rs. Fields ("xmltestdata"). Value
RS. MoveNext
Wend
RS. Close
Set rs = nothing
con. Close
the value con = nothing
but there is a problem when xmldata exceeds a certain size. small starters work well if.
-
Extracting data from table using the date condition
Hello
I have a table structure and data as below.
create table of production
(
IPC VARCHAR2 (200),
PRODUCTIONDATE VARCHAR2 (200),
QUANTITY VARCHAR2 (2000).
PRODUCTIONCODE VARCHAR2 (2000).
MOULDQUANTITY VARCHAR2 (2000));
Insert into production
values ('1111 ', '20121119', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20121122', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20121126', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20121127', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20121128', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20121201', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20121203', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20121203', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20130103', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20130104', ' 1023', 'AAB77',' 0002');
Insert into production
values ('1111 ', '20130105', ' 1023', 'AAB77',' 0002');
Now, here I want to extract the data with condition as
PRODUCTIONDATE > = the current week Monday
so I would skip only two first rows and will need to get all the lines.
I tried to use it under condition, but it would not give the data for the values of 2013.
TO_NUMBER (to_char (to_date (PRODUCTIONDATE, 'yyyymmdd'), 'IW')) > = to_number (to_char (sysdate, 'IW'))
Any help would be appreciated.
Thank you
MaheshHello
HM wrote:
by the way: it is generally a good idea to store date values in date columns.One of the many reasons why store date information in VARCHAR2 columns (especially VARCHAR2 (200)) is a bad idea, it's that the data invalid get there, causing errors. Avoid the conversion of columns like that at times, if possible:
SELECT * FROM production WHERE productiondate >= TO_CHAR ( TRUNC (SYSDATE, 'IW') , 'YYYYMMDD' ) ;
-
When I extract data from a column that contains and it gets converted to &; amp;
I have data in a column say countries with the following value New Zealand & Australia
It gets converted into New Zealand & am p; Australia ... in the text element...
The value is taken from the column
How to avoid that this amp; being added.
Is it a bug how do we get around that.
Select off_country of contact where contact_No = mnontactno;
I use this in a dynamic action when I load the page.
I have a question in the hope of data one can help with this
Version 4.2 db 11g apex
Edited by: zycoz100 January 6, 2013 18:59Please, don't post duplicate discussions: + {: identifier of the thread = 2482368} +.
As you can see, doing so does not get answers just more quickly.
Close this message and stick to the original.
-
ODI extract data from HFM using hierarchies / members whose list of filters
Hi all
is it possible to use lists of members or hierarchies from account to account and filter data HFM LKM to SQL entity?
In the example:
ACCOUNT_FILTER = AccList (where AccList is a list)
or
ACCOUNT_FILTER = AccX. * (where the CAC is a parent account and we want that all his children)
ODI, Version 10.1.3.6.5
Thank youI don't think it's possible, you must provide a list of the accounts comma separated values
-
How to extract data from an arbitrary xml file and export it to a CSV friendly?
Hallo,
I am facing big problems in the use of XML files. I have a
application that generates XML files with clusters containing arrays
and scalars as in the example pasted below. My task is to
Read it and export the data into a CSV document readable by a human.
Since I do not know the actual content of the cluster, I need some sort
Smart VI through the XML looking for berries
and other data structures for export properly in the CSV file
format (columns with headers).
Thank you
3
6
0
1
2
3
4
5
3.14159265358979
Ciao
Rather than to get the
node, you can just go directly to the node since ' one that really interests you. Basically what it means to determine the elements of table how much you have, and it depends on if you have 1 or 2 knots . The rest is just of the child nodes and the next siblings. See attachment as a starting point. The attached XML file is a table 2D (change the .xml extension). Notes on the example:
- I did not close properly references, so it's something you need to do.
- It is limited to tables 1 d or 2D.
- I suggest using a control path of the file to specify the input XML file and path of the file/folder control to specify the location of the output file.
-
Extract data from EO using findbyprimarykey
I'm having some difficulty trying to retrieve a line of the EO. My case, I have a table (with CodeType as primary key) ParamSetup defined as ParamSetupEO in the entity objects and ParamSetupVO objects in view.
I've implemented the findbyprimarykey in the module of the application. The code snippet looks like this:
public ParamSetupEOImpl FindandRetrieveParameter (String vcodeType) {}
ParamDef EntityDefImpl = ParamSetupEOImpl.getDefinitionObject ();
Create the Key object
Key paramKey = ParamSetupEOImpl.createPrimaryKey (vcodeType);
Find and return the desired instance
return (ParamSetupEOImpl) paramDef.findByPrimaryKey (getDBTransaction (), paramKey);
}
My problem is how to make reference to it in a managedbean. Here's how to move to parameter (vcodeType) and how to reference each column (attribute)
For example, you can use a display criteria where you only use the pk as the criteria field. In a method in the original version, you apply the display criteria, run the query and return the line you get, which can be either the line for the pk, or null if no row could be found using this key. For an example of how to do this check http://adfpractice-fedor.blogspot.de/2011/08/how-to-apply-view-criteria.html
Instead of return void, your method returns a line
public line applySalaryCriteria (salary number) {}
setsalary (salary);
setApplyViewCriteriaName ("SalaryCriteria");
executeQuery();
This.first () return;
}
Timo
-
Extract data from Oracle into excel file
Hello
I have a requirement where in I need to extract data from Oracle into excel file and the worksheet excel name should be 'given '.
for example. Excel 'AR Data_DDMMYY' file name and the name of the "Data" sheet excel
I used the UTL_FILE API to extract the data delimited by tabs that you can open in excel, but it's not exactly an excel file as the name of the worksheet is the same as the name of the file.
I tried to use utl_file.fcopy and frename.
Is it possible to do it using PLSQL?
Select * from version of v$.
Example Code:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi PL/SQL Release 10.2.0.5.0 - Production "CORE 10.2.0.5.0 Production" TNS for HPUX: Version 10.2.0.5.0 - Production NLSRTL Version 10.2.0.5.0 - Production
Thank youdeclare cursor c is select * from scott.emp; v varchar2(100); f utl_file.file_type; file_name varchar2(100) := 'AR Data.xls'; dir varchar2(50) := 'CESDIR191710'; --select * from dba_directories begin f := utl_file.fopen(dir, file_name, 'W'); v := 'EMPNO'||chr(9)||'ENAME'||chr(9)||'JOB'||chr(9)||'SAL'||chr(9)||'HIREDATE'||chr(9)||'DEPTNO'; utl_file.put_line(f, v); for i in c loop v := i.empno||chr(9)||i.ename||chr(9)||i.job||chr(9)||i.sal||chr(9)||i.hiredate||chr(9)||i.deptno; utl_file.put_line(f, v); end loop; utl_file.fclose(f); --utl_file.frename(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls', false); utl_file.fcopy(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls'); end;
ImranHello
I tried to change the .xlsx to .xls and it gives a note at the opening of the file "the file you are trying to open, abc.xls, is in a different format that it is specified by the file extension. Check that the file is not corrupted and precedes from a trusted source before you open the file. Do you want to open it now? »
When you rename the file does not solve your problem.
Anton Scheffer package generates a file in format xlsx Office 2010. When rename you it with the .xls extension, then Office 2010 will give you the warning that the file format does not match the extension.but the requirement has to generate excel 2003 file.
The xml_spreadsheet package writes a format that was introduced with Office 2003, but you must use .xml as extension in other Office 2010 will give you the same caveat.
To write the real xls version (binary), you can use Apache POI. You will need to import Java classes in your db and write a PL/SQL wrapper. Or you can use one of the options above, writing the output to a windows server and then use Excel to open and save in the required format.You must decide whether it is easier to write the binary xls format or to convince the customer to accept other formats that can be opened with Excel.
Concerning
Marcus -
Is API available in Acrobat for extracting text from images using c#
Is API available in Acrobat for extracting text from images using c#
Thank you for your response. Acrobat is not appropriate for this task, because it is technically suitable or licensed for the server.
Adobe have a PDF library which allows extraction of text for C/C++, but it does not OCR. There are OCR of the LiveCycle PDF Generator Server product, but I don't think that does OCR on a PDF file.
Sorry not to have better news.
-
Extracting data from table without refreshment and without using the tab key.
Hi friends,
I have a problem I want to extract data from table without discount in the text field without using the Tab key. When I enter a field value any value then the text corressponding should enter into corressponding textfield without using the Tab key.
for example. When I get back emp_id 101 in a text field then first_name and last_name, address would come in to the text fields corressponding without refresh and use the Tab key.
How can I do that.
Thank you
MauryHi Maury,
I guess it's similar to: retrieving data without refreshing rather than Re: value of a textfield should enter into an another textfield without using the TAB ?
If so, the only change you want to bring on the first is to use the parameter "Onkeyup" instead of "onchange" in the 'HTML Form attributes of the element' element.
Note, however, that the user must move away from the issue at some point (for example, to click on a button), so the onchange will fire anyway.
Andy
-
How to extract data from SAP and COBOL using ODI
Hi people,
Can you please let me know the procedures in ODI to extract data from SAP and COBOL?
Thank you all for the help.Hello
You can download the Patch 8571830 to Oracle metalink.
It has a new technology 'SAP ABAP' and KMs to extract and load data-
RKM SAP ERP and SAP to Oracle ERP LKM.Thank you
-
Query to extract data from source DB driver using process mapping pre...
Hi all
I have a source for the query to retrieve the data from the source database. Looking for suggestion what could be the best approach to extract data from the source database.using owb 11 GR 1 material.
I'm in printing, create the process of mapping driver prerequisite for aid to perform immediate with Create table T1 as a sql query. Petition to the sides of the Insert into T1 Select * from Source_Table in the different database.
Certainly, need to create Db users in the Source database, to get privileges to read the data of source_database.
Is - this good aproach to or of any other alternative to achieve this.
Means, create the table in the transit area (desired area, where I am) and using driver mapping process before you run the select query to retrieve data from a data source.
Would apreciate your previous answer.
Thank you
MAKYou can mark Correct or useful if it solves your purpose.
-
Script Insert statement to extract data from Table in Oracle 7i
Hi all, I have an old Oracle legacy system that works for more than 15 years. Every now and then, we need to extract data from this table @ ORacle 7i to import to Oracle 10 G.
My thoughts are to create a script to Insert statements in oracle 7 and that, to be deployed to Oracle 10 G.
I found cela scripts in Google and don't know exactly how it works. No explanation on these scripts, would be greatly appreciated. I find that this format can help to produce a set of insert statements in this table to the last table to 10G.
< pre >
-Step 1: create this procedure:
create or replace function ExtractData (v_table_name varchar2) return varchar2 as
Boolean b_found: = false;
v_tempa varchar2 (8000);
v_tempb varchar2 (8000);
v_tempc VARCHAR2 (255);
Start
for tab_rec in (select table_name from user_tables where table_name = upper (v_table_name))
loop
b_found: = true;
v_tempa: =' select ' insert into ' | tab_rec.table_name |' (';
for col_rec in (select * from user_tab_columns)
where
table_name = tab_rec.table_name
order by
column_id)
loop
If col_rec.column_id = 1 then
v_tempa: = v_tempa | " ' || Chr (10) | " ' ;
on the other
v_tempa: = v_tempa |', ". Chr (10) | " ' ;
v_tempb: = v_tempb |', ". Chr (10) | " ' ;
end if;
v_tempa: = v_tempa | col_rec.column_name;
If instr(col_rec.data_type,'CHAR') > 0 then
v_tempc: = "' |' | col_rec.column_name |'| " ' ;
elsif instr (col_rec.data_type, 'DATE') > 0 then
v_tempc: = "' to_date ("'| to_char('|| col_rec.column_name||',''mm/DD/YYYY HH24 '') | ") (', "' dd/mm/yyyy hh24"') "';
on the other
v_tempc: = col_rec.column_name;
end if;
v_tempb: = v_tempb | " ' || Decode('|| col_rec.column_name||',''Null'','||v_tempc||') | " ' ;
end loop;
v_tempa: = v_tempa |') values ('| v_tempb |'); "from ' |" tab_rec.table_name | « ; » ;
end loop;
If not b_found then
v_tempa: ='-Table ' | v_table_name | 'not found ';
on the other
v_tempa: = v_tempa | Chr (10) | "select"-commit; "double;';
end if;
Return v_tempa;
end;
/
display errors
-STEP 2: run the following code to extract the data.
Go head
set pages 0
game of stripes on
fixed lines 2000
the feeding off value
trigger the echo
var retline varchar2 (4000)
coil c:\t1.sql
Select 'set echo off' from dual;
Select 'spool c:\recreatedata.sql' from dual;
Select ' select "-these data was extracted on" | TO_CHAR (sysdate, "mm/dd/yyyy hh24" ") double;' double.
-The following two lines as repeat as many times as the tables that you want to extract
exec: retline: = ExtractData ('dept');
print: retline;
exec: retline: = ExtractData ('emp');
print: retline;
Select 'off spool' from dual;
spool off
@c:\t1
-Step 3: run the updated c:\recreatedata.sql waiting for output to recreate the data.
Source: http://www.idevelopment.info/data/Oracle/DBA_tips/PL_SQL/PLSQL_5.shtml
< / pre >Hello
Well what this script do.
You will pass a table name as input to the function that will return varchar2 (string - insert statement). It will generate 2 t1.sql of sql script that contains the output sequence.Will use the first passed the user_tables scipt to check if the input table name exists and if there is the will reterive user_table_columns column names and generate the following sql script.
Now, this t1.sql will run to generate a final sript formally orders insert that will run you on the target schema (make sure that the table exists).* #t1.sql*
set echo off spool recreatedata.sql select '-- This data was extracted on '||to_char(sysdate,'mm/dd/yyyy hh24:mi') from dual; select 'insert into MY_OBJECT1 ('||chr(10)||'OWNER,'||chr(10)||'TOTAL) values ('||decode(OWNER,Null,'Null',''''||OWNER||'''')||','||chr(10)||''||decode(TOTAL,Null,'Null',TOTAL)||');' from MY_OBJECT1; select '-- commit;' from dual; spool off
Then @t1.sql runs, and the general insert for the infeed table table.
-- This data was extracted on 03/09/2009 23:39 INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('MDSYS', 92800); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('TSMSYS', 256); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('DMSYS', 15104); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('TESTME', 128); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('PUBLIC', 2571392); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('OUTLN', 768); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('CTXSYS', 21888); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('OLAPSYS', 78336); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('KLONDIKE', 2432); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('SYSTEM', 51328); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('EXFSYS', 21504); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('DBSNMP', 4096); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('ORDSYS', 216192); INSERT INTO MY_OBJECT1 (OWNER, TOTAL) VALUES ('SYSMAN', 111744); -- commit;
Hope this helps
Concerning
Maybe you are looking for
-
I want to delete 1000 + photos from my iPhone
I have over 1000 pictures on my iPhone. They were copied on my iMac, but not deleted from the phone. How can I select all of the inventory for deletion, other than selecting them individually? iMac, OS X Yosemite (10.10.2) iPhone 6 Plus, iOS 8.1.2 Th
-
Programatically change control to generate and event...
I add some improvements of the user (anti-screw-it-up functions) to ensure the desired process are executed. First question: if I have handles by a change of value in a text control, an event (event occurs when you press enter or exit control with th
-
In our small business we have Dell pc that we used as an exchange of mail for several years, and now we're looking to put new readers and also to get Windows Server 2012. However, I said that I'd better get used to cloud computing as the main versio
-
Hi, I built a VI that data of 2 scans of modules DAQ and then that summarizes data collected in an Excel sheet. I used 2 loops of sampling and 1 extra loop that must save the data in Excel, using the functions of the queue when a value Boolean true.N
-
I need to get a new laptop as my only current becomes slow and unresponsive, so I thought I'd do a Microsoft Surface tablet when they become available. I only bought my printer a couple of months, and it would really be a guy, if it was not compatibl