Need help with dynamic code generation

Hi people,


I'm trying to dynamically create and run the following query

Environment: Oracle Database 10 g Enterprise Edition Release 10.2.0.4.0
DECLARE
A NUMBER;
stmt VARCHAR2(200);
     4
     5  CURSOR C1 IS
     6  SELECT TABLE_NAME
     7  FROM DB_MGMT.CTRL_TAB_RETENTION
     8  WHERE RETENTION_PERIOD_IN_MONTHS = 11
     9  AND rownum < 2;
    10
    11  BEGIN
    12  FOR i IN C1
    13  LOOP
    14
    15  -- dbms_output.put_line('Table Name: ' || i.TABLE_NAME);
    16
    17  -- dbms_output.put_line('SELECT min(DT_SKEY), max(DT_SKEY) FROM '||i.TABLE_NAME||' ;');
    18
    19  stmt :='SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.'||i.TABLE_NAME||';';
    20
    21  dbms_output.put_line(stmt);
    22
    23  execute immediate stmt;
    24  END LOOP;
    25  END;
    26  /
I get the following error message
SQL> @sanity_check
SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.FACT_NOK_CELL_SERVICE2_HH;
DECLARE
*
ERROR at line 1:
ORA-00911: invalid character
ORA-06512: at line 23
Does anyone can spot obvious syntax errors in the code above?

Thanks in advance

rogers42

rogers42 wrote:
Hello

Thanks for the suggestion.

Everything by getting rid of aid ';', but the output of the select statement is not displayed?

When you use a SELECT statement in PL/SQL, you must select the results in variables or arrays.
Try something like this:

DECLARE
     CURSOR C1 IS
                   SELECT  TABLE_NAME
            FROM    DB_MGMT.CTRL_TAB_RETENTION
            WHERE   RETENTION_PERIOD_IN_MONTHS = 11
            AND     rownum                  < 2;

     min_dt_skey    NUMBER;
     max_dt_skey    NUMBER;
     stmt            VARCHAR2 (100);
BEGIN
    FOR i IN C1
     LOOP

        -- dbms_output.put_line('Table Name: ' || i.TABLE_NAME);

        stmt :='SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.' || i.TABLE_NAME;

        dbms_output.put_line(stmt);

        EXECUTE IMMEDIATE stmt
         INTO min_dt_skey, max_dt_skey;
     dbms_output.put_line (  min_dt_skey   || ' = MIN (dt_skey), '
                    || max_dt_skey   || ' = MAX (dt_skey) for table '
                    || i.table_name
                    );
    END LOOP;
END;

Tags: Database

Similar Questions

  • Need help with dynamic where clause.

    Hello world.  I'm kind of a novice with PL/SQL, so please be patient with me.  I am building a web application using Weblogic Oracle 11 g and Oracle database.

    To make a long story short, I need to generate the complex dynamic WHERE clause.  I don't know what will be the name of the column or the operator of comparison or the value will be until the moment of execution.

    I'm not 100% certain, but I think I need to use dynamic SQL statements.  Unless there is a better way to do it.

    I'm sure that using dynamic SQL opens me up to SQL injection attacks if I use simple string concatenation.  I would like to use bind variable if possible.

    In any case, it seems like trying to build a dynamic where clause does not seem to work as I want it would be...

    bv1 := 'colA = 5 and colB >= 9';
    
    query_str := 'SELECT * FROM view WHERE :bv1';
    
    OPEN CUR FOR query_str USING bv1;
    

    The code above pours out when I try to run it.

    Is there a way to build dynamic where the provisions without the use of concatenation of simple string that leaves me open to attacks by SQL injection?

    Thank you

    Hello.  I have read briefly upward on things, you suggested, but it seems a bit abstract for me since I was a novice.

    Can you give us an explanation or an example of how to use it to accomplish what I need to do?

    Do ypu really plan create a query with a WHERE clause that contains a predicate for all possible columns?

    Variable bind offer performance when the same query is executed several times with different values for bind variables.

    Select * from emp where empno =: v_empno

    After the first run Oracle will always be this query in the library cache. The next running can use the version of the cache even if the bind value is different.

    Select * from emp where empno =: v_empno;

    Select * from emp where ename =: v_ename;

    Select * from emp where sal =: v_sal;

    Each one is a DIFFERENT query. Yes - each of them uses a variable binding, but queries are different.

    So, if your username select EMPNO, an '=', and a value from the first query can be executed. But the next time that the user can select the ENAME column so that 'stored' first request may not be used given that the query does not match.

    The third time your user selects SAL so none of the first two queries can be used in the library cache. The use of bind variables gives performance during the SAME QUERY is used multiple times with DIFFERENT values for the variable binding. Oracle is not to analyze the hard query everything simply because the VALUE is different.

    So bind variables do not help you if most of the queries were completely DIFFERENT sets of predicates. And SYS_CONTEXT will not help either since that simply provides a way to define binds the values of the variables.

    Just for the simple example above, there are at least SIX possible combinations of columns that could choose your user name: empno, ename, sal, empno ename, empno & sal, ename & sal

  • Newb needs help with dynamic text

    Hello world

    I'm not a newb - but that's how...

    I am trying to create a multi-page form that allows uses to register the products.
    The first page asks you name etc., and on the second page, I want to say "Welcome"+ username "!" -This kind of thing...
    The problem is that I can't seem to keep the values of dynamic text through the pages.

    I can get it to repeat the entry on the first page with this code:

    _root.firstname_txt. OnChanged = function() {}
    _root.firstname_repeat. Text = "Hello"+ _root.firstname_txt.text; "
    };

    However when I call on the second page it is not defined:

    second_repeat. Text = "Hello"+ _root.firstnamt_txt.text; "
    trace (_root.second_repeat.text);

    I'm sure it's something simple and I am just a dunce of programming...
    Any help is appreciated.

    your

    If your textfield (_root.firstname_repeat) does not exist on the 2nd frame, its text property will be indefinite.

    to remedy, or extend the existence of your textfield in frameworks or use a variable to store its text property (in your manager onChanged) and use this variable to retrieve the value you need.

  • Need help with error code 0 x 80070424 and 0x6D9

    I need help please!  Spent an entire day trying to figure this even ONCE!  When I try to change my windows firewall settings I get error code 0 x 80070424.  I worked at it so long, I forgot when I get the error 0x6D9 code.  But here is my BIGGEST problem, my computer won't let me do DOWNLOADS at all.  I even checked to make sure that the downloads are enabled in my internet settings.

    Any help would be GREATLY appreciated!

    Hi LindaL5299,

    I, too, got the dreaded error codes and spent much too much time looking for and try to apply the patches on the right!  I hope that I am sharing will help you!

    Have you seen this particular thread? (if you have, my apologies.)

    MS Answers: "I keep on getting error 0x6d9 and 0 x 80070424 code."

    If this isn't the case, you can check it out.

    Watch more precisely for the reply by VIJAY B.

    As a Microsoft Engineer, Vijay must know a few things about these formidable error codes!

    I have summarized his answer for you here.

    METHOD 1:

    If you have installed, UNINSTALL McAfee Firewall;

    AND

    T urn WINDOWS firewall "'WE ' "

    To ensure that Firewall service Windows is activated:

    1.   Click on:                         Start
    2 (in the search box) type: service

    3.   Select:                             services
    4 right-click right on: Windows Firewall service

    5.   Click:                              Stop

    6 right-click AGAIN on: Windows Firewall service

    7.   Click:                              START

    METHOD 2:

    Online virus scanner by using the Microsoft Safety Scanner
    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    METHOD 3:

    Try to install the latest updates from Windows Updates
    http://Windows.Microsoft.com/en-us/Windows7/install-Windows-updates


    METHOD 4:

    Run it Microsoft FixIt! tool (in the following article to see if that helps)

    Diagnose and automatically fix problems of Windows Firewall service

    http://support.Microsoft.com/mats/windows_firewall_diagnostic/

    *************************************************************************************************************

    Keep this site in your 'Favorites', too!

    WINDOWS SEVEN FORUMS    An informative, resourceful AND Microsoft-recommended WIN7 users including Q & A community can save you hours on a Google search! I BOOKMARKED the site (and you could want, too!)

    *************************************************************************************************************

    Hope ONE of these methods is right for you, Linda!  I DO "feel your pain!

    As a company of independent workers, online "etailer", my time AND my livelihood depends totally my PC!  I spent many an hour (s) search on the error codes and try to find fixes.  So, I hope that what I have learned and have just shared can lend to fix your problem (s), also!

    FINGERS CROSSED!

    WendeeMcCee

    "The he Miss Fix - It [If I can!] ". "

    Empathetic to the woes to find fixes for those darn "error codes".

    I hope I can help IF I can, but

    I not an 'IT' pro!

  • Hello [need help with exit code 7]

    Hello, I am having trouble installing the Premiere Pro and After Effects, the download is canceled without reason and this cloud creative reports "installation-fault read more ' link in this:

    Exit code: 7
    Please see specific errors below for troubleshooting. For example, ERROR: DS003...
    -------------------------------------- Summary --------------------------------------

    -fatal error 1, 0 error (s)



    -Payload: Adobe first Pro CC 2015 9.0.0.0 {38C72D42-0672-43B1-9E05-E7631684F9A1}.

    FATAL: DS003: installation package is possibly corrupt. Download the installer again and try again. (Impossible to extract '2015\payloads\AdobePremierePro9AllTrial\Assets1_1.zip C:\Users\wilmar\AppData\Local\Temp\{3F3A1FCC-6F0C-419D-BAF9-6527D5BAC6FF}\PremierePro_9_ LS20\Adobe Premiere Pro CC' to ' C:\Program Files (x 86) \Common {38C72D42-0672-43B1-9E05-E7631684F9A1} ".) : Error 1392 O land or pasta esta corrompido e ilegivel.)

    -------------------------------------------------------------------------------------


    Even if I restart the download is not finalized and have the same final repeatedly need help. The only software that has been installed has the Media Encoder, I didn't even want. Thanks I await a response

    [Title edited... MOD]

    you use the cc desktop app to install your adobe programs?

    If so, errors ' Exit Code: 6 "," Exit Code: 7 "|"» CS5, CS5.5

    If not, Download Adobe Creative Cloud apps | CC free trial Adobe

  • Need help with dynamic Action through 4 items

    Hello everyone.

    I'm having some trouble trying to comp with dynamic action that will turn on or display a select list item when a value is set for the four elements of the Radio button group.

    P1_SELCT_LIST

    P1_RADIO_GROUP_1

    P1_RADIO_GROUP_2

    P1_RADIO_GROUP_3

    P1_RADIO_GROUP_4

    So once all four Radio groups are not null, I want the select View list item.

    Any help with this would be great.

    I'm on Apex 4.2.0.00.27

    Hello

    You can create the following action:

    Event: click on

    Selection type: jQuery selector

    jQuery selector: radio

    condition:

    $v ('P1_RADIO_GROUP_1')! == ''

    &&

    $v ('P1_RADIO_GROUP_2')! == ''

    &&

    $v ('P1_RADIO_GROUP_3')! == ''

    &&

    $v ('P1_RADIO_GROUP_4')! == ''

    Then add a real Action as follows:

    ACtion: show

    Fires when the result of the event is: true

    Fire on the page loading: No. (uncheck)

    Assigned to elements, selection type: product (s)

    Product (s): P1_SELECT

    Also add an Action to false as follows:

    ACtion: hide

    Fires when the result of the event is: false

    Fire on the page loading: YES (check)

    Assigned to elements, selection type: product (s)

    Product (s): P1_SELECT

    Kind regards

    Vincent

    http://vincentdeelen.blogspot.com

  • need help with the code "meter."

    Hi I had this form of testing that executes_query on the new block instance.
    See the image below:

    http://i95.photobucket.com/albums/l133/element81/screenies.jpg
    [http://i95.photobucket.com/albums/l133/element81/screenies.jpg]

    I have this code on the button (next question) that captures the selected answer and compare it to the correct answer and then move to the next record:

    "If: blk_exam.radio_group76 =: blk_exam.answer_id then.
    -message('correct');
    -other
    -message('wrong');
    : blk_exam.score: =: blk_exam.score + 1;
    end if;
    next_record;
    "

    the problem is I want to create a score counter, but I do not know how to display it in the text (circled in blue) element.

    p.s. I'll hide the score counter, hurt later use it to record the score in the database.


    Ty in advance

    Hello
    No, there are no gaps. In fact, there is error in your code.

    Scenario 1:
    If the blk_exam is on the top of blk_score when I run the blk_exam form works with execute_query but the text of the note element is a bit turn off so I have to click on to a grey, she and her show '0' because of its first value 0 then walla pressing "next question" with my codes work... it increments...

    For this scenario, you use NVL then it will work as...

    :NON_DB_BLOCK.SCORE_FLD:=NVL(:NON_DB_BLOCK.SCORE_FLD,0)+1;
    

    Scenario 2:
    If I make blk_score on top of my blk_exam the text of the note element contains the value 0, but the test module does not work still... I had to click on any text element or anywhere on the form first seized execute_query and shows the question and choices... but then after that, it works well...

    So now don't need to keep the DB NO BLOCK on top just keep the issue/block on top. Normal then run query which is now to work it will work.

    hope you can imagine the two scenario hehe...

    Hope you can imagine the fault encoding ;)

    -Clément

  • Need help with the code to add dates to form

    Hello fans forum

    I am new to make forms and understood how to auto add the date, but I need the shape to change the date for each copy made.

    For example, is today 08/06/2012 if I print 10 copies of the form it will display 10 pages from 08/06/2012 to 17/06/2012. If the code exists for this I would be very gratefull to one who helps, I also wouldn't mind if this is not possible for manually inputing start / end dates.

    Currently I have print 15-30 copies of the form and hand write each of the dates but I get just to busy to do it. Also I can't print one a day, it must be in batches.

    Thanks in advance.

    I think that you misunderstood my comment about the Console window. Please see the Console window tutorial link in my previous answer. The Acrobat JavaScript Console window is internal to Acrobat, so there is no system restrictions that may prevent you from using it. It's a perfect place to run short automation scripts that do things like print separate copies.

    George also underscores a great solution, put the script in a (non-printable) button on the document itself. However, due to security restrictions this solution can be a bit tricky, but no more so than using the Console window. Each solution takes a little extra effort.

    The problem with having multiple pages, it's that you must manually create a document with pages already in it.  It is certainly a feasible solution, it comes you limit the number of pages that you have already created manually.  At least one solution AcroForm. If you re-create your form as a dynamic LiveCycle, then creating new pages on the fly is not a problem.

    None of these solutions will work fine, the real trick is to increment the date.

    Here's a short script that begins with today's date and adds a day for each iteration of the loop and then prints

    One day in milliseconds

    var nOneDay = 24 * 60 * 60 * 1000;

    var nToday = (new Date()) .getTime ();

    for (var i = 0; i)<>

    {

    oTheDate = new Date (nToday + i * nOneDay);

    Date format

    cTheDate = util.printd("mm/dd/yyyy",oTheDate);

    this.getField("MyDate").value = cTheDate;

    This.Print)

    }

    This same loop could be used to fill in a form on the page - multi (repeated) fields.

    Using the util.scand () function, this loop could be setup to start at an arbitrary date.

    See you soon,.

  • Need help with LabVIEW code for motor control.

    Hello

    My name is Sasi. I'm a grad student BME working on my thesis topic of assessment for back pain spine implants. To do this, I'm building a test machine that would apply pure moments of a specimen of the spinal column. I use LabVIEW 8.5 to implement the control of a brushless AC servo motor. My requirement is

    Step 1: Initialize the engine.
    Step 2: Start moving it to a uniform to the right PLAN (this value of RPM too user can enter).
    Step 3: while doing step 2; at the same time read the couple cell data (acquisition of data using Asst.). DAQ o/p is 0 v to 10 V; 0 v is 10 Nm n
    10 v is + 10 Nm
    Step 4: What torque reached + 10 Nm, i.e. 10 V, the engine stops.
    Step 5: from the position where the motor stopped (IE not need to return to the initial position) start moving in the opposite direction to the same
    Uniform rpm as in step 2 at the reading of data in the cells of the couple.
    Step 6: once more what torque reached-10 Nm, i.e. 0 V, the engine should stop.
    Step 7: Repeat "Step 2" to the "step 6' 3 times.
    Step 8: Reset engine position.

    So far, I managed to get the engine to move backward @ a desired vel, the accl, deceleration for 3 cycles before n n. I enclose my code. I have a problem inserting the code for reading DAQmx amidst all this. Can someone help me.

    Thnks,

    Sasi.

    Hi Sonia,.

    I took a quick glance to your problem and I think I have a solution for you.  I certainly agree with the suggestion of the use of parallel loops Lynn.  This will allow the portion DAQmx run uninhibited by the part of the motion, and vice versa.  In addition, you need only perform an iteration of the loop of the movement whenever the voltage level exceeds a threshold.  Thus, by performing an iteration on the code of movement in the same loop are you iterate over DAQmx code, you essentially waste processor.

    I created a VI that should do what you are wanting.  I tested it on me and it works very well.  You have a tweak a few things to apply to your system (such as motion Council DAQmx and physical channel ID, etc.).  I used two parallel loops and event programming.  Basically, the loop of movement starts the engine turns at the specified speed.  Once the engine is running, he expects the DAQmx loop to tell him that the voltage value has crossed the threshold.  When the voltage value exceeds the maximum threshold (I put a value slightly less than 10 to jitter and saturation), the DAQmx loop indicates the loop of the motion that it may end its iteration.  The motion loop stops the motion, causes a reversal and repeats the motion.  Once the movement has begun, he expects the DAQmx loop once again to tell him that a threshold was held, but this time, it's looking for a minimum threshold.  I used "Occurrences" to implement the event programming in LabVIEW.

    I've commented the code pretty thoroughly, so I hope that comments will answer all remaining questions.  The advantage of using programs that focus on the event for this is that you save time processor, and your movement is more closely synchronized with the DAQmx.  Instead of one iteration of the loop of movement as fast as you can, updates every hour, you just put in pause and wait for the other loop to tell you when to start up again.  Meanwhile, the processor doesn't have to worry about an iteration of this loop over and over again.  In addition, when the accident occurs, you catch him immediately, instead of having to wait until the next iteration.  Thus, you are more closely synchronized with the DAQmx code portion.

    I hope this will help you.  Please report if you have any questions about the code or its implementation.  Good luck!


  • I need help with dynamic input text

    I am developing a game and I have a problem with my dynamic input text. I am doing my input text appear on other images whenever I click on the button, well, I tried a few solutions I've seen here, but it hasn't really well.
    This is the first code I used:

    Stop();

    function handleClick(pEvent:MouseEvent):void {}

    var myfirstVariable = box1.text;

    Welcome.Text = "Welcome to the game" + myfirstVariable;

    }

    enter_button.addEventListener (MouseEvent.MOUSE_UP, handleClick);

    This works but only on an image. and this is the code I'm trying to use now:

    Stop();

    var enteredText:String;

    welcome.addEventListener (Event.CHANGE, updateString);

    function updateString(evt:Event) {}

    enteredText = welcome.text;

    }

    enter_button.addEventListener (MouseEvent.MOUSE_UP, handleClick);

    and on the other images:

    Stop();

    enteredText = welcome_2.text;

    Thank you much for the help ^^

    If you change the images have an another textfield on this new framework, you must set its text property to:

    enteredText = welcome_2.text;<-comment out="" this="" line="" and="">

    welcome_2.text = enteredText;

  • Need help with this code to update the user interface example

    I'm triying to understand the differences between the three methods to manage UI interactions.
    I'm really confused with these three terms when triying them figure out in a real case.
    Basically, I know that I should use invokeLater, invokeAndWat, or getEventLock() to avoid
    This exception: java.lang.illegalStateException: engine access UI without holding the lock on the event

    The code below illustrates the function of the invokeAndWait method, but if I replace it with
    invokeLater or getEventLock() the program will work exactly the same way.
    Could you please change the code to show the differences between the three
    methods of updating the user interface?

    / public final class HelloWorldMainScreen extends form {}

    private LabelField labelField;
    public HelloWorldMainScreen() {}
    labelField = new LabelField ("Hello World");
    Add (labelField);
    Thread MainScreenUpdaterThread = new MainScreenUpdaterThread (this);
    thread. Start();
    }

    {} public void appendLabelText (String text)
    labelField.setText(labelField.getText()+"\n"+text);
    }

    }

    SerializableAttribute public class MainScreenUpdaterThread extends Thread {}
    HelloWorldMainScreen screen;

    public MainScreenUpdaterThread (screen HelloWorldMainScreen) {}
    this.mainScreen = screen;
    }

    public void run() {}
    for (int i = 0; i)< 10;="" i++)="">
    try {}
    Thread.Sleep (5000);
    } catch (InterruptedException ex) {};
    UiApplication.getUiApplication () .invokeAndWait (new Runnable() {}
    public void run() {}
    mainScreen.appendLabelText ("Update");
    }
    });

    }
    }
    }

    These three concepts are very confusing for a lot from people so all explanatory source code
    describing their functions will be highly useful for everyone, I think.

    Thanks in advance!

    With respect to the effect, there is no difference between methods.  The difference is the way in which the result is achieved.  So we can't change the code to show you the difference.

    As we are unable to demonstrate the difference, you have to do with an explanation.  To understand the explanation, you'll need to understand the thread of events, so if you have not already, please consider this:

    http://supportforums.BlackBerry.com/T5/Java-development/what-is-the-event-thread/Ta-p/446865

    If the three options are differentiated by the processing order:

    (a) invokeLater executes the update on the thread of events.  The transformation takes place at a later stage and the code which is in order after the invokeLater will actually run before the code within the invokeLater.

    (b) invokeAndWait also manages the update on the thread of events, which means that all other events that await on the thread of events will be run before this code.  But any code after the invokeAndWait will not be executed.

    (c) the synchronized option, like invokeAndWait, runs the update of the UI before moving on to the following code.  The difference is that the code to run on the event Thread is not executed before code in the synchronized block.

    If this is meaningless, so that probably does not matter too much.  in general, you should use invokeLater, except if you need to update the user interface occur in the order with your background processing.  If so, use invokeAndWait. It has synced are very few occasions where you must use the block, and it should be very small updates to the user interface and you should understand the implications this could have on the wire events.

  • need help with the code for update of a record (conditional release)

    all together

    Published by: 871431 on July 9, 2011 18:30

    871431 wrote:
    Hello

    I am looking to update a table that contains documents approved & not homologous, for this combination date & funds it should allow the only recording not approved.

    what I did is check if the recording is U if the incoming value is not approved for this error of combination stimulus funds & date, but if I need to update this unlicensed recording error... so I need to update record, and trigger the error if try to insert another disc not approved.
    Hope I am clear...

    Not clear for me

    Help pls

    Please realize and understand that everyone here talks about SQL

    Please post DDL for table
    Please provide the sample/test data & then explain with the help of data from the trial itself said it that results should be & why

  • Need help with the code for drop-down selection, please!

    I'm falling out of scope with a drop of water in my form. My form is long, and certain areas are in Page 2. When I click on the "Customer hospitality event" drop-down list selection, the fields of P2 do not hide. Here is the code that I have on the menu drop-down:

    -form1. P1.meetDetails.meetType::exit :-(JavaScript, client).

    switch

    (this.rawValue)

    {

    " case" " Customer home ' :

    Header.PRESENCE = "visible";

    meetDetails.presence = "visible";

    meetDetailsaddl.presence = "visible";

    Form1. P2.rstatus.presence = 'hidden '.

    Form1. P2. Status.Presence = 'hidden '.

    breaking ;

    }

    Help, please!

    Thank you!

    I see that references to the P2 have no end of line separators (-).

    Form1. P2.rstatus.presence = 'hidden '.

    Form1. P2. Status.Presence = 'hidden '.

    The JavaScript runtime engine is perhaps unfortunate. Try to add them.

    Steve

  • I need help with the code of php mailer

    I followed the instructions to make this announcement and I get an email but no inside information. No message, no who he comes, nothing. only the mailer 'shape' is received. I am new to DW, still using training wheels. can anyone help?

    Here's the code for the contact page:

    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "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 > Untitled Document < /title >
    < / head >

    < body >
    < do action = "mailer.php" method = "post" > "

    Name: < br / > < input name = "test" type = "text" size = "32" / > < br / >
    E-mail: < br / > < input name = "email" type = "text" size = "32" / > < br / >
    Message: < br / > < textarea name = "message" rows = "10" cols = "40" > < / textarea > < br / >
    < input type = "submit" name = "submit" value = "Submit" / >
    < / make >
    < / body >
    < / html >

    code for mailer:

    <? PHP
    $to = "[email address removed by Moderator] ';
    $subject = "from my Web site";
    $headers = "from: Form Mailer ';
    $forward = 0; 0 = no redirect, redirection of 1 = 1
    $location = ""; If 1 then "yoursite.com".

    $date = date ("' 1, f js, y" ");
    $time = date (' h: i A ");

    $mgs = "this is the result of your feedback form. He received the $date $time.\n\n ";

    If ($_SERVER ['REQUEST_METHOD'] == 'POST') {}
    foreach ($_POST as $key = > $value) {}
    $mgs. = ucfirst ($key). » : «. $value. "\n";
    }
    }
    else {}
    foreach ($_GET as $key = > $value) {}
    $mgs. = ucfirst ($key). » : «. $value. » \n » ;
    }
    }
    mail ($à, $subject, $msg, $headers);
    If ($forward == 1) {}
    Header ("' Location: $location '");
    }
    else {}
    echo "thank you for your visit. We will review your information that has been sent to us. Be blessed! « ;
    }

    ? >

    [Proposed by the correct forum Moderator]

    The problem really has nothing to do with Dreamweaver, but your lack of experience with PHP.

    For example, you have this line of code:

    $date = date ("1,f js,y");
    

    If you use echo to display the output of the $date, what you get is this:

    1,f 1257,09
    

    Not a very useful date, I think you would agree.

    What should be your code is the following:

    $date = date ("l, F jS, Y");
    

    Very similar, but completely different insofar as PHP is concerned. Note that the first character is lowercase L and not one. The other letters are also crucial.

    This code generates "Sunday, July 12, 2009.

    Now, why have you not no messages? Elementary, my dear Watson. Throughout your code, you assign to a variable called $mgs the message. When finally, you send the mail, the variable you are using is $msg. I suspect that $mgs should be $msg throughout. As humans, we can identify the misspelling and may ignore it. The computers cannot. You must be very attentive to the spelling when you work with a language like PHP.

  • Need help with error code "WindowsUpdate_00000646".

    can anyone help?

    http://www.Microsoft.com/downloads/en/default.aspx

    Put the KB numbers in the search at the above link > download them manually.

    If this does not solve it:

    Windows Update Forum:

    You will get the best help for any problem of Update/Service Pack in the Windows Update Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon.

    Mick Murphy - Microsoft partner

Maybe you are looking for