PL/SQL Oracle php AVG

hi everyone :) im tryin to make AVG form salary(wynagrodzenie) but im doing something wrong , can someone correct me ???
it looks like this im trying to view avg salary(wynagrodzenie) from every departments(id_dzialu) , id_dzialu and wynagrodzenie are both in table pracownik(worker)
<?php
$c = oci_connect("xxx", "xxx", "localhost/XE");
$s = oci_parse($c, 'select id_dzialu
from pracownik;
where wynagrodzenie = :wynag');
$ba = array(':wynag' => 'avg');
foreach ($ba as $key => $val) {
oci_bind_by_name($s, $key, $ba[$key]);
oci_execute($s);
while (($row = oci_fetch_array($s, OCI_ASSOC))) {
foreach ($row as $item) {
echo $item." ";
echo "<br>\n";
?>

yes i gues so :D its my magic script
i was also trying to do something like this
$c = oci_connect("xxx", "xxx", "localhost/XE");
$s = oci_parse($c, 'select id_dzialu , avg(wynagrodzenie)
from pracownik
group by id_dzialu;
where ............'); what should i place in where ??? maybe avg(wynagrodzenie)???
$ba = array(.................); and what in here i want to view the array of avg salary of each department :)
/// id_dzialu is workers department id and avg(wynagrodzenie) is avg salary , just dont know how to construct this :P
or maybe you know some easier way to dispaly avg salary from my php oracle base ???

Similar Messages

  • Pl-Sql Oracle Function Concurrency Issue

    Hi All,
    Issue - pl-sql Oracle Function performance issue, when muliple users are accessing the function
    Detail -
    Oracle 11g / Linux Server
    I have developed a pl-sql oracle function to retrieve information from 3 tables, output as a particluar type array.
    Single request is getting processed within 2.2 seconds, but when multiple request are sent concurrently <tested with 50>, time taken for each output is different.
    BreakUp of Response times:-
    8 messages took - 2.2 sec
    +8 messages took - 4.4 sec
    ++8 messages took - 6.6 sec....etc
    I'm looking for any DB tunning parameter, which will help to resolve this issue.
    My only aim is to expose developed function to multiple users, who all can access it concurrently, but response should limit within 2.2 seconds.
    Any thoughts + guidance is higly appreciated.
    Thanks
    Preetam Singh

    Supporting data insert statements:
    =======================================================================================================================
    REM INSERTING into EXPERTISE
    Insert into EXPERTISE (USH_USER_NAME,USH_SKILL_SET1,USH_SKILL_SET2,USH_SKILL_SET3,USH_SKILL_SET4,USH_SKILL_SET5,USH_SKILL_SET6,USH_SKILL_SET7,USH_SKILL_SET8,USH_SKILL_SET9,USH_SKILL_SET10,USH_SKILL_SET11,USH_SKILL_SET12,USH_SKILL_SET13,USH_SKILL_SET14,USH_SKILL_SET15,USH_SKILL_SET16,USH_SKILL_SET17,USH_SKILL_SET18,USH_SKILL_SET19,USH_SKILL_SET20) values ('A','ENGLISH','FRENCH','HINDI',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into EXPERTISE (USH_USER_NAME,USH_SKILL_SET1,USH_SKILL_SET2,USH_SKILL_SET3,USH_SKILL_SET4,USH_SKILL_SET5,USH_SKILL_SET6,USH_SKILL_SET7,USH_SKILL_SET8,USH_SKILL_SET9,USH_SKILL_SET10,USH_SKILL_SET11,USH_SKILL_SET12,USH_SKILL_SET13,USH_SKILL_SET14,USH_SKILL_SET15,USH_SKILL_SET16,USH_SKILL_SET17,USH_SKILL_SET18,USH_SKILL_SET19,USH_SKILL_SET20) values ('B',null,'GERMAN','CHINIESE','HINDI',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into EXPERTISE (USH_USER_NAME,USH_SKILL_SET1,USH_SKILL_SET2,USH_SKILL_SET3,USH_SKILL_SET4,USH_SKILL_SET5,USH_SKILL_SET6,USH_SKILL_SET7,USH_SKILL_SET8,USH_SKILL_SET9,USH_SKILL_SET10,USH_SKILL_SET11,USH_SKILL_SET12,USH_SKILL_SET13,USH_SKILL_SET14,USH_SKILL_SET15,USH_SKILL_SET16,USH_SKILL_SET17,USH_SKILL_SET18,USH_SKILL_SET19,USH_SKILL_SET20) values ('C','ENGLISH',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    =======================================================================================================================
    ==================================================================
    REM INSERTING into WORKING
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('A','MON','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('A','TUE','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('A','WED',null,null);
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('A','THU','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('A','FRI','09:00','12:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('B','MON','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('B','TUE','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('B','WED','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('B','THU','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('B','FRI','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('C','MON',null,null);
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('C','TUE','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('C','WED','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('C','THU','09:00','18:00');
    Insert into WORKING (NAME,WEEKDAY,DAYSTARTTIME,DAYENDTIME) values ('C','FRI','09:00','12:00');
    ==================================================================
    =====================================================================================================================
    REM INSERTING into SCHEDULE
    Insert into SCHEDULE (APPOINTMENTDATE,APPOINTMENTSTART,APPOINTMENTEND,STATUS,NAME) values (to_timestamp('11-FEB-12 10.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 10.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 11.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'MEETING','A');
    Insert into SCHEDULE (APPOINTMENTDATE,APPOINTMENTSTART,APPOINTMENTEND,STATUS,NAME) values (to_timestamp('11-FEB-12 10.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 10.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 11.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'TRAINING','B');
    Insert into SCHEDULE (APPOINTMENTDATE,APPOINTMENTSTART,APPOINTMENTEND,STATUS,NAME) values (to_timestamp('13-FEB-12 10.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 10.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 11.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'MEETING','A');
    Insert into SCHEDULE (APPOINTMENTDATE,APPOINTMENTSTART,APPOINTMENTEND,STATUS,NAME) values (to_timestamp('11-FEB-12 10.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 11.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-FEB-12 11.30.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'MEETING','B');
    =====================================================================================================================
    Edited by: 910614 on Feb 10, 2012 9:29 AM

  • Can i Use two qery hints in one SQL(Oracle)?

    Hi,
    Can i Use two Query hints in one SQL(Oracle)? USE_HASH and No_Merge
    Thanks

    user10916886 wrote:
    Can I use like
    /*+ USE_HASH(X,Y) NO_MERGE(X) */
    will this work?Not really: NO_MERGE relates to mergeable views, not base tables. So whilst the USE_HASH may result in a hash join between the tables X and Y, USE_MERGE will be ignored for X.
    As hoek says, however, HINTs should be a last resort only, and if they're to be used at all you're best to stay with those that don't involve explicit objects, like ALL_ROWS, FIRST_ROWS_10, etc.
    user10916886 wrote:
    Im my database, if i don't use query hints. The expalin plan uses Nested loops, hence the query takes a lot of time.You would be better trying the ALL_ROWS hint here, instead of USE_HASH.
    Edit
    The optimizer, however, will have chosen NESTED LOOPs where it did because it believed that to be the most efficient data retrieval path with the information that it had to hand. So, if your statistics are comprehensive and up-to-date, yet the optimizer is continually opting for the less efficient plan, there's something else wrong, and HINTs are only masking that problem in the short-term.

  • Native and open  sql - oracle

    hi all,
    <dynamic >  = SELECT matnr  FROM mara .
    EXEC SQL.
      OPEN c1 FOR <dynamic >ENDEXEC.
    ENDEXEC.
    can  i use dynamic native sql in open sql-oracle .
    cheers
    senthil

    EXEC SQL doesn't allow for dynamic constructs. In order to get native SQL features dynamically you can use the JDBC-like classes CL_SQL_STATEMENT, CL_SQL_CONNECTION, and so on.
    Best regards
      Ulrich

  • PI - SQL ORACLE TO RFC

    Hi!
      I am studing PI and I have a question.
      I create a process to select a table in SQL Oracle
      and to send to the RFC.
      I run (Test ) the process and it is a erro.
    Step 1.  Send agreement
    Log.
    <Trace level="1" type="B">SENDER AGREEMENT SIMULATION</Trace>
    <Trace level="1" type="T">Simulating Adapter Engine...</Trace>
    <Trace level="1" type="T">Simply trying to loolup for the most specific Sender Agreement object</Trace>
    <Trace level="1" type="T">no objects found</Trace>
    <Trace level="1" type="T">Note that real results may differ</Trace>
    Stpe 2.  Receice Determination
    Runtime error
    "Die Nachricht ist unvollständig. Es wurde kein Sender gefunden."
      =  "The message is incomplete. There was no station is found."
    Your change list is not empty; activate changes before simulation
    <Trace level="1" type="B">CL_RD_PLSRV-ENTER_PLSRV</Trace>
    <Trace level="1" type="T">R E C E I V E R - D E T E R M I N A T I O N </Trace>
    <Trace level="1" type="T"> Cache Content is up to date </Trace>
    <Trace level="1" type="E">CL_RD_PLSRV-ENTER_PLSRV</Trace>
    May you help me? Where is it the problem?
    Thanks.

    Hi Clayton,
    Are you using the ICO object or the classic configuration (SA, RD, ID, RA)?, with the ICO object the ID test doesn't work.
    For the test, are you generating the right sender XML payload?, have you set the receiver fields in the ID test? (Configuring the Sender JDBC Adapter - Configuring the JDBC Adapter in the Integration Directory/PCK - SAP Library)
    Personally, i usually test the JDBC sender scenario directly, setting up the channel; but i dont see any reason because the ID test with a classical configuration wouldn't work.
    Regards.

  • How to create scheduler sql oracle developer

    Hi
    how to create How to create scheduler sql oracle developer?

    Hi
    finally i refer below link its usefull
    ORACLE-BASE - SQL Developer 3.1 Scheduler (DBMS_SCHEDULER) Support

  • 很全的help.sql 安装Oracle的sqlplus帮助系统

    在linux系统下的时候,我们可以通过man命令,获得系统里对某个命令的usage的解释。
    在sqlplus里我们也可以通过help和?命令。
    sqlplus的帮助主题对应的是数据库里的一张表(system.help)。
    在$ORACLE_HOME/sqlplus/admin/help/目录下的helpus.sql包含了这个表的帮助主题
    不过oracle自带的help和?的解释太少了
    在网上找了很久终于找到一个很全的help.sql叻
    下载文中附件,用system登录,因为这个是建立在system的schema里的help表里的。
    直接执行脚本就可以了。比如我把这个sql保存到$ORACLE_HOME\sqlplus\admin\help里,
    大家在这里可以看到有
    helpbld.sql
    helpdrop.sql
    helpus.sql
    hlpbld.sql
    这四个文件,这就是oracle自带的help脚本。可以执行
    helpbld.sql来安装oracle默认的help, 这里会提示你输入两个参数,看了这个源文件。
    两个参数一个是当前路径,一个是helpus.sql, 还是用system来执行,执行完就安装了help,
    就可以使用我上面的那些方式。这个是默认会安装的。
    要安装我这个最新的help文件,只需要执行就可以了
    SQL>conn system/systempwd;
    SQL>@?/sqlplus/admin/help/helpbld.sql
    输入 1 的值: F:\developer\oracle\product\10.2.0\db_1\sqlplus\admin\help
    输入 2 的值: F:\developer\oracle\product\10.2.0\db_1\sqlplus\admin\help\help.sql
    这里就会执行了,执行是有一些和默认的有冲突,可以忽略这些错误。
    成功以后,我们执行一下
    SQL> select count(*) from system.help ;
    COUNT(*)
    5085
    呵呵呵一下多了好多条了哟
    SQL> help create database;
    引用:
    CREATE DATABASE
    Use this command to create a database, making it available for
    general use, with the following options:
    * to establish a maximum number of instances, data files, redo
    log files groups, or redo log file members
    * to specify names and sizes of data files and redo log files
    * to choose a mode of use for the redo log
    * to specify the national and database character sets
    Warning: This command prepares a database for initial use and erases
    any data currently in the specified files. Only use this command
    when you understand its ramifications.
    .......这里还要好多有关create table的帮助信息,我就不写了。
    有了这个帮助系统,要查一个命令的详解,正是太方便叻。
    help.sql文件【 下载 】

  • Data insert in SQL & ORACLE databases

    Hi
    We are sending vendor master data from SAP to SQL & ORACLE database .
    It is working successfully for SQL.
    we have deployed oracle drivers, completed the configuration part.
    When idoc is triggered in SAP,data is uploaded in SQL successfully....but it is showing the following error for Oracle....
    ....." Unable to execute statement for table or stored procedure. 'tblVendorAddress' (Structure 'Table') due to java.sql.SQLException: FATAL ERROR: Column 'cVendorCode' does not exist in table 'tblVendorAddress' "......
    cVendorCode in SQL is defined as cVendorCode ... but in Oracle it is defined as CVENDORCODE...
    If  i change the datatype in XI as CVENDORCODE...my SQL scenario will not work(cVendorCode)..
    I don't want to change my XI datatype structure....records should be updated in SQL & Oracle datadase at the same time.
    Please suggest a solution..
    Regards
    Abhijit

    Hi!
    As far as I know this is the only way, because the PI works like all Java based systems (and unix systems) case-sensitive.
    But maybe there is a "Wizard" in this forum who knows another way
    Regards,
    Volker

  • XML to SQL (oracle) Parallel Processing Scenario

    hi,
    I have one scenario to load datas from XML to SQL but when this scenario runs in parallel duplicate information.
    I have done tests with 5 xml file these xml file have unique header_id but when run in parallel , insert 5 record in target table but one is repeat.
    the flow is the following,
    1. My scenario recieved one variable (name xml file), this variable is sent for bpel.
    2. Load datas from xml to sql(oracle), in this step I have concatenated to tables C$_, I$ and E$_ the session number how explain this link http://odiexperts.com/?p=1417.
    3. Invoke web service with status finished.
    I have tried the following.
    after of first step I set a procedure with sentence "SYNCHRONIZE schema SO from file" and modify my topology to &ro=true some time run perfect but check the target table and datas are duplicated and other time catch the error ....
    0 : null : java.sql.SQLException: class org.xml.sax.SAXException
    class java.lang.NullPointerException said null.
    Any suggestion o coment to execute my scenario in parallel?
    Thanks a lot.
    Antonio

    Please repost in the Data Integrator forum Data Integrator
    (this forum is for Data Service Integrator - an entirely different product).

  • Difference   LDAP & SQL & ORACLE

    Hi All
    I'm currently working in a messaging environment which
    includes LDAP Server and here i want to know the difference
    bettween LDAP - SQL - ORACLE.
    The Read access is faster in LDAP than write ? is it correct ??
    & i think in SQL write access is faster that read acess ?? is it correct??
    My Ques..
    1) If Any body know difference between LDAP,SQL & ORACLE ?
    kindly let me know ??
    Thanks in Advance.

    LDAP is a standard defined at IETF (RFC 4510 and associated)
    It is derived from the ISO-ITU standard X.500 and has a hierarchical, object oriented model.
    Sun Directory Server implements LDAP.
    SQL is a query language to access relational databases.
    Oracle is a company which has several products including a relational database, an LDAP server (Oracle OID).
    For more details, I would suggest a simple search on the internet for "LDAP vs RDBMs". There are many well written articles available.
    Regards,
    Ludovic.

  • Oracle - PHP books

    Can anyone recommend books on Oracle - PHP? I found only MySQL - PHP
    thanks,
    tubagus

    Easy Oracle PHP
    Create Dynamic Web Pages with Oracle Data
    Mladen Gogala
    ISBN: 0-9761573-0-6 Library of Congress Number: xxx
    400 pages - Perfect bind - 9x7 Publication Date: February 2006
    Shelving: Databases/Oracle Easy Oracle Series # 6

  • Pl sql---sql---oracle sql

    whats the difference between
    sql
    pl/sql
    oracle sql??

    You can google it and get the answer
    Both SQL and PL/SQL are languages used to access data within Oracle databases.
    SQL is a limited language that allows you to directly interact with the database. You can write queries (SELECT), manipulate objects (DDL) and data (DML) with SQL. However, SQL doesn't include all the things that normal programming languages have, such as loops and IF...THEN...ELSE statements.
    PL/SQL is a normal programming language that includes all the features of most other programming languages. But, it has one thing that other programming languages don't have: the ability to easily integrate with SQL.
    Some of the differences:
    SQL is executed one statement at a time. PL/SQL is executed as a block of code.
    SQL tells the database what to do (declarative), not how to do it. In contrast, PL/SQL tell the database how to do things (procedural).
    SQL is used to code queries, DML and DDL statements. PL/SQL is used to code program blocks, triggers, functions, procedures and packages.
    You can embed SQL in a PL/SQL program, but you cannot embed PL/SQL within a SQL statement

  • Oracle-PHP PL/SQL Problem

    Dear,
    I have this situation:
    Inside PHP I call this statement:
    $usr_stmt = oci_parse($conn, "begin PKG_USERBEHEER_TEST.user_insert(PKG_USERBEHEER_TEST.user_create_type(:usr_id,:usr_naam,:usr_vnaam,:usr_email,:usr_pass,SYSDATE,NULL),:p_exusr_id); end;");
    binding the variables
    oci_bind_by_name($usr_stmt, ':usr_id', $USR_ID);
    oci_bind_by_name($usr_stmt, ':usr_naam', $USR_NAAM);
    oci_bind_by_name($usr_stmt, ':usr_vnaam', $USR_VNAAM);
    oci_bind_by_name($usr_stmt, ':usr_pass', $USR_PASS);
    oci_bind_by_name($usr_stmt, ':usr_email', $USR_EMAIL);
    oci_bind_by_name($usr_stmt, ':p_exusr_id', $EXEC);
    INSIDE MY PACKAGE:
    FUNCTION user_create_type(usr_id users.usr_id%TYPE, usr_naam users.usr_naam%TYPE, usr_vnaam users.usr_vnaam%TYPE, usr_email users.usr_email%TYPE, usr_pass users.usr_pass%TYPE, usr_start_datum users.usr_pass%TYPE, usr_eind_datum users.usr_eind_datum%TYPE) return user_rec is
    v_rec user_rec;
    Begin
    v_rec.usr_id := usr_id;
    v_rec.usr_naam := usr_naam ;
    v_rec.usr_vnaam:=usr_vnaam;
    v_rec.usr_email:=usr_email;
    v_rec.usr_pass :=usr_pass;
    v_rec.usr_start_datum := usr_start_datum;
    v_rec.usr_eind_datum := usr_eind_datum;
    return v_rec;
    end user_create_type;
    PROCEDURE user_insert(r IN OUT user_rec, p_exusr_id IN users.usr_id%TYPE) IS
    BEGIN
    --check if allowed
    IF(NOT checkallowedactions(p_exusr_id, 117)) THEN
    raise_application_error(-20999, 'User is not allowed executing this action');
    END IF;
    --end check if allowed
    SELECT seq_users.nextval
    INTO r.usr_id
    FROM dual;
    SELECT sysdate
    INTO r.usr_start_datum
    FROM dual;
    INSERT
    INTO users(usr_id, usr_naam, usr_vnaam, usr_email, usr_pass, usr_start_datum)
    VALUES(r.usr_id, r.usr_naam, r.usr_vnaam, r.usr_email, cryptit.encrypt(r.usr_pass), r.usr_start_datum);
    END user_insert;
    When I excecute my statement I get this error:
    Warning: oci_execute() [function.oci-execute]: ORA-06550: line 1, column 39: PLS-00363: expression 'PKG_USERBEHEER_TEST.USER_CREATE_TYPE' cannot be used as an assignment target ORA-06550: line 1, column 7: PL/SQL: Statement ignored in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\add_user.php on line 22
    But I need the out parameter, because I need my generated ID (Sequence) for futher use in my script.
    I'm not able to edit the pl/sql script because an other application is using it.
    Somebody can help me?
    Thx
    Davy

    The call to PKG_USERBEHEER_TEST.user_insert needs to pass a single PL/SQL variable as the first argument so that user_insert can return an update record. The OUT declaration of 'r' in user_insert is throwing the error. To that point, the problem is not due to PHP. You would get the same error in SQL*Plus.
    But, because you can't bind a record in PHP, you need to create a new PL/SQL function that calls PKG_USERBEHEER_TEST.user_create_type putting the returned record into a PL/SQL variable, and then calls user_insert. PHP would call the wrapper PL/SQL function.
    -- cj

  • Oracle & PHP/Apache not working togather for unicode (working individually)

    hi, i have oracle xe zend core for oracle installed.
    When i insert data through aplication express or oracle sql developer its perfect. Unicode can be inserted and viewed, but when I try to view same data through php script it display ??? signs only english character show properly.
    Seems the unicode enviourment issue with php/apache and oracle communication, as php pages display uniode correctly when not taking data from oracle. I need help
    I have gone through globlizing_oracle_php_applications.pdf and have enabled mbstring, also php charset is utf8 i also used 'AL32UTF8' in connection string.
    Also if someone can provide a small sample php script to insert or view unicode data.
    thanks

    root the php module seems to be not working as the
    displayed index.php was just text page. I tried with
    apache2 as well but the result was the same.I don't believe the apache included with Solaris 10 includes PHP support; you will probably have to re-compile it . See the README file in /etc/apache for the actual config of the distributed version.

  • Country state drop down list oracle & php

    Hi all.
    I'm new in this forum.
    I have created two tables :
    create table countries
    country_id int not null,
    country_name varchar2(50),
    constraint countries_country_id_pk primary key (country_id)
    create table states
    state_id int not null,
    state_name varchar2(50),
    country_id int,
    constraint states_state_id_pk primary key (state_id),
    constraint states_country_id_fk foreign key (country_id) references countries (country_id)on delete cascade
    and insert data.
    I have connect to oracle database by this php file.
    <?php
    $conn = oci_connect('hr', 'hekal', 'or');
    if (!$conn)
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
    ?>
    then I make combobox dropdown list like that
    <?php
    include ('../connect_db.php');
    $sql = 'select * from countries order by country_name';
    $stid = oci_parse($conn, $sql);
    oci_define_by_name($stid, 'country_id', $country_id);
    oci_define_by_name($stid, 'country_name',$country_name);
    oci_execute($stid);
    ?>
    <select name="country">
    <?php
    while (oci_fetch($stid)) {
    ?>
    <option value="$country_id" id="country_id"> <?php echo"$country_name" ; ?></option>
    <?php } ?>
    This code get values into drop down list
    and make another to the states.
    But I need to connect the two each other.
    I need when I choose USA. the other list show only states of USA
    thank you

    See multiple dropdown

Maybe you are looking for

  • IPOD not showing up in WINDOWS XP

    I have the old 10gig IPOD(non click wheel), it's about 3 or 4yrs old now. For some reason, when I plug it into my computer via firewire, it won't show up in windows, my computer or at all or itunes. It has worked in the past, but all of a sudden it s

  • Blocked invoices for SRM PO

    Dear All I have requirement in that i need to create blocked invoices for SRM PO's . I have created a PO in SRM portal . Now the invoice need to be done at R3 side but i am not aware how i can create a invoice for the SRM PO's . Any one help me on th

  • New Forwarding Agent

    Hi, I would like to create a new forwarding agent. Kindly let me know the tcode for that. Regards, Raju.

  • Printing of excise invoice thro J1IS

    Hi MM Gurus, How can we print an excise invoice created thro' JI1S for other material movement. Thanks, S.R.

  • Speed - your having a laugh!

    I have to write this as I think it's disgraceful and shoddy. Before I start though, I know the service is an "upto" one in terms of speed but this takes the biscuit. Joined BT in May 2012 on infinity 2 and re contracted 12 months later. Upon joining,