PHP & array processing

Hello,
Can PHP process more rows in ocifetch ?
regards

I did a little testing on Windows 2000 using SQL*Plus and client
libraries from Oracle 9.2. The DB was a 9.2 release on a remote
machine.
The SQL script was:
  connect scott/tiger@mydb
  define AS = 1
  prompt Arraysize &AS
  set arraysize &AS
  set pagesize 0
  set linesize 200
  set termout off
  spool c:\temp\bmsp.log
  timing start
  select * from all_objects order by 1;
  spool off
  set termout on
  timing stopThe PHP file was:
  <?php
  require("ScriptTimer.php");  // from user comments on "microtime" man page
  $pfrc = 1;
  $filename = "c:/temp/bmphp.log";
  $conn = OCILogon('scott', 'tiger', 'mydb');
  Script_Timer::Start_Timer();
  if (!$handle = fopen($filename, 'w')) {
    echo "Cannot open file ($filename)";
    exit;
  $query = 'select * from all_objects order by 1';
  $stid = OCIParse($conn, $query);
  OCIExecute($stid);
  OCISetPrefetch($stid, $pfrc);
  while ($succ = OCIFetchInto($stid, $row)) {
    foreach ($row as $item) {
      fwrite($handle, $item." ");
    fwrite($handle, "\n");
  fclose($handle);
  $total_time = Script_Timer::Get_Time(3);
  echo "$pfrc Time was $total_time\n";
  ?>SQL*Plus 9.2 results:
   Time   Arraysize        
   2.1    1000             
   2.1    500              
   2.1    250              
   3.0    100              
   3.0    50               
   4.1    10               
   9.1    1                 PHP (CLI) 4.3.4 results:
   Time   Prefetchrowcount
   4.5    1000           
   4.5    500            
   4.6    250            
   4.7    100            
   4.8    50             
   5.7    10             
   9.2    1               This was a pretty rudimentary benchmark. There are a lot of areas of
difference between SQL*Plus and PHP that could be debated and
examined.
Overall I'm comfortable that PHP's prefetchrowcount has a positive
effect.
-- CJ

Similar Messages

  • Php form processing script

    Hi. I got a program to write a php form processing script. My submit form is for photo submission to my domain email. I published to site and did a test to see if it works i got this error:
    Warning: require_once(F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php): failed to open stream: No such file or directory in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24 Fatal error: require_once(): Failed opening required 'F:\Domains\mydomain\mydomain.com\wwwroot/includes/Upload_Photos-lib.php' (include_path='.;C:\php\pear') in F:\Domains\mydomain\mydomain.com\wwwroot\Upload_Photos.php on line 24
    What does this mean? How can i solve this so that i can process my form?

    See if the below form helps: You need to create a folder on your server named - upload - this is where any files uploaded will be stored (make sure the folder is writable. Also change the email address where the information that someone who has uploaded a file will go to. Look for the following in the code: $to ="XXXXXXXXXXXX.com";
    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    #wrapper {
    width: 400px;
    margin: 0 auto;
    </style>
    </head>
    <body>
    <div id="wrapper">
    <?php if(isset($_POST['submit'])) {
    $name = trim($_POST['name']);
    if(empty($name)) {
    $error['name'] = "Please provide your name";
    $location = trim($_POST['location']);
    if(empty($location)) {
    $error['location'] = "Please provide your location";
    $email = trim($_POST['email']);
    if(empty($email)) {
    $error['email'] = "Please provide your email";
    $category_description = trim($_POST['category_description']);
    if(empty($category_description)) {
    $error['category_description'] = "Please provide the category or description";
    $terms_conditions = trim($_POST['terms_conditions']);
    if(empty($terms_conditions)) {
    $error['terms_conditions'] = "Please accept the terms & conditions";
    $allowedExts = array(
       "doc",
      "docx",
            "rtf",
            "txt",
            "pdf",
            "jpeg",
            "jpg",
    $allowedMimeTypes = array(
      'application/msword',
            'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'application/rtf',
            'application/x-rtf',
            'text/richtext',
            'text/rtf',
            'application/plain',
      'application/pdf',
      'image/gif',
      'image/jpeg',
    $extension = end(explode(".", $_FILES["file"]["name"]));
    if (empty($_FILES["file"]["name"])) {
        $selectFile = 'Please select a file to upload';
    elseif ( ! ( in_array($extension, $allowedExts ) ) ) {
      $fileTypeNotAllowed = 'File type not allowed';
    elseif ($_FILES["file"]["size"] > 2097152) {
      $fileTooLarge = 'Please provide a smaller file';
    elseif (file_exists("upload/" . $_FILES["file"]["name"])) {
    $fileExists = $_FILES["file"]["name"] . " already exists, Please change the file name ";
    elseif (in_array( $_FILES["file"]["type"], $allowedMimeTypes ) )
        if(!empty($_POST['terms_conditions'])) {
    move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
        $fileName = $_FILES["file"]["name"];
        $fileUploadSuccessful = 'File uploaded successfully';
    $to = "XXXXXXXXXXXXX.com";
    $subject   = "Upload to website";
    $headers  = "From: $email\r\n";
    $headers .= "Reply-To: $email\r\n";
    $message = "Name: $name\n\n";
    $message .= "Location: $location\n\n";
    $message .= "Email Address: $email\n\n";
    $message .= "Category/Description: $category_description\n\n";
    $message .= "File: $fileName\n\n";
    mail($to, $subject, $message, $headers);
    $sent = "Mail was sent successfully";
    ?>
    <h1>Form</h1>
    <?php
    foreach ($error as $value) {
        echo "<p>".$value."</p>";
    if(isset($formFieldError)) {
    echo "<p>".$formFieldError."</p>";
    if(isset($selectFile)) {
    echo "<p>".$selectFile."</p>";
    if(isset($fileTypeNotAllowed)) {
    echo "<p>".$fileTypeNotAllowed."</p>";
    if(isset($fileTooLarge)) {
    echo "<p>".$fileTooLarge."</p>";
    if(isset($fileExists)) {
    echo "<p>".$fileExists."</p>";
    if(isset($fileUploadSuccessful)) {
    echo "<p>".$fileUploadSuccessful."</p>";
    ?>
    <form action="upload_file.php" method="post"
    enctype="multipart/form-data">
    <p>
    <label for="name">Name<br>
    <input type="text" name="name" id="name" value="<?php if(isset($name)) {echo $name; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="location">Location<br>
    <input type="text" name="location" id="location" value="<?php if(isset($location)) {echo $location; }  ?>"/>
    </label>
    </p>
    <p>
    <label for="email">Email<br>
    <input type="text" name="email" id="email" value="<?php if(isset($email)) {echo $email; }  ?>" />
    </label>
    </p>
    <p>
    <label for="category_description">Category and Description<br>
    <input type="text" name="category_description" id="category_description" value="<?php if(isset($category_description)) {echo $category_description; }  ?>" />
    </label>
    </p>
    <p>
    <label for="file">File Attachment:<br>
    <input type="file" name="file" id="file" />
    </label>
    </p>
    <p>
    <label for="terms_conditions">Terms & Conditions:
    <input name="terms_conditions" type="checkbox" value="accept" <?php if(isset($_POST['terms_conditions'])) {echo "checked"; }  ?>> (Please check)
    </label>
    </p>
    <input type="submit" name="submit" value="Submit" />
    </form>
    </div>
    </body>
    </html>

  • Bind PL/SQL array to PHP array

    Hi all!
    I try to bind a PL/SQL array (nested tables, index by integer) returned by a PL/SQL-function to an PHP array.
    Here is the code:
    create or replace package MyPackage as
    TYPE my_type IS TABLE OF VARCHAR2(1024);
    FUNCTION MyFunction RETURN my_type;
    end MyPackage;
    create or replace PACKAGE BODY MyPackage is
    FUNCTION MyFunction RETURN my_type IS
    t_docs my_type;
    begin
    t_docs := my_type('val0','val1','val2');
    return t_docs;
    end MyFunction;
    end MyPackage;
    In the PHP-code ist looks like this
    $query = "begin :vals := MyPackage.MyFunction; end;";
    $stmt = oci_parse ($conn, $query);
    oci_bind_array_by_name($stmt, ":vals", $vals_array, 5, 512, SQLT_CHR);
    oci_execute ($stmt);
    Output:
    PLS-00382: expression is of wrong type. Error in Line....
    This error point to
    begin :vals := MyPackage.MyFunction; end;
    ^^^
    Questions:
    Is it generally possible to bind a pl/sql array to a php array? Or only the other was around?
    Could you please post a snipet of code how to do it the right way :-)
    Thanks a lot for your help! Christian

    As you noted, you can't return a PL/SQL array and map it to a PHP array when it is a record type. Likewise, you can't map an object type to a PHP array. You can return a reference cursor through PL/SQL, and then fetch the function result with oci_fetch_assoc($rc).
    Alternatively, you can return an object type collection or a pipelined table function result into PHP. It's a bit long but you'll find examples on my blog. Start here, and there's a link to a full discussion of pipelined table functions:
    http://blog.mclaughlinsoftware.com/2009/03/19/beats-a-reference-cursor/
    This is an object table example, which you may prefer over pipelined table functions:
    http://blog.mclaughlinsoftware.com/2009/03/23/object-record-collections/
    Hope this helps.

  • How to store spry data in php array

    I am trying to store spry data in php array like this:
    <? $foo= array();?>
      <div spry:region="dsCALC">
        <div spry:repeat="dsCALC">
          <?php
    $foo[]='{dsCALC::DataPrice}';
    ?>
          </div>
      </div>
    <?var_dump($foo);?>
    Outputs:
    Array (     [0] => {dsCALC::DataPrice} )
    If I tried a variable, it works ok... The array, not... Any ideas?

    Outputs:
    Array (     [0] => {dsCALC::DataPrice} )
    And so it should, because that is what you told the PHP-script to do in the following line of code.
    $foo[]='{dsCALC::DataPrice}';
    Please remember that PHP code is handled on the server, whereas JavaScript (Spry) is handeld on the client (browser) end. JavaScript cannot be handeld by PHP nor can JavaScript handel PHP.
    My question to you is, why do you want to store the data in a PHP-array and how is the Spry data obtained?
    Ben

  • Array processing question

    Hello,
    I am somewhat new to JNI technology and am getting a bit confused about array processing.
    I am developing a C program that is called by a third party application. The third party application expects the C function to have a prototype similar to the following:
    int read_content(char *buffer, int length)
    It is expecting that I read "length" bytes of data from a device and return it to the caller in the buffer provided. I want to implement the device read operation in Java and return the data back to the C 'stub' so that it, in turn can return the data to the caller. What is the most efficient way to get the data from my Java "read_content" method into the caller's buffer? I am getting somewhat confused by the Get<Type>ArrayElements routines and this concepts of pinning, copying and releasing with the Release<Type>ArrayElements routine. Any advice would be helpful... particularly good advice :)
    Thanks

    It seems to me that you probably want to call the Java read_content method using JNI and have it return an array of bytes.
    Since you already have a C buffer provided, you need to copy the data out of the Java array into this C buffer. GetPrimitiveArrayCritical is probably what you want:
    char *myBuf = (char *)((*env)->GetPrimitiveArrayCritical(env, javaDataArray, NULL));
    memcpy(buffer, myBuf, length);
    (*env)->ReleasePrimitiveArrayCritical(env, javaDataArray, myBuf, JNI_ABORT);Given a Java array of bytes javaDataArray, this will copy length bytes out of it and into the C array named buffer. I used JNI_ABORT as the last argument to ReleasePrimitiveArrayCritical because you do not change the array. But you could pass a 0 there also, there would be no observable difference in the behavior.
    Think of it as requesting and releasing a lock on the Java array. When you have no lock, the VM is free to move the array around in memory (and it will do so from time to time). When you use one of the various GetArray functions, this will lock the array so that the VM cannot move it. When you are done with it, you need to release it so the VM can resume normal operations on it. Releasing it also propagates any changes made back to the array. You cannot know whether changes made in native code will be reflected in the Java array until you commit the changes by releasing the array. But since you are not modifying the array, it doesn't make any difference.
    What is most important is that you get the array before you read its elements and that you release it when you are done. That's all that you really need to know :}

  • Import PHP-Array into Java-Application

    Hi!
    I want to call a PHP-Script from inside my Java-Application. The PHP-Script can return an array.
    How do I use a PHP-Array in Java and how do I import it????
    Thanks! =)

    thanks! =D
    one last question:
    -how would i have to change my example to make a
    https-connection?
    Did you try
    URL theURL = new URL("https://www.mysite.com/myscript.php");It works that simply. The only complication is if your server is set up for https or not. This is an Apache (or whatever webserver you are using)problem not a PHP problem.
    I think it gets upset if you try and use certificates with problems (self-signed etc) but not having tried this (I have only used it with certificates that are otherwise trustable) I don't know that for sure.
    Once upon a time I asked a question about using https as a client in Java and I got a variety of answers including doing mystic stuff with my keystore but I tried the simple and obvious and it works like a charm. At least from an Applet but I see no reason an application won't work the same way.
    Anyway try the simple and easy and see if that works for you. You might find that it does.

  • Hung up on array processing in PHP

    If I have a complex array that contains things like this -
    Array
    [0] => Array
    [0] => Array
    [id] => 1234567
    [web_id] => 9876543
    [something_id] => 656f3953bc
    [folder_id] => 0
    [title] => Title 1
    [type] => regular
    [create_time] => Jan 05, 2009 08:39 am
    [1] => Array
    [id] => 234567
    [web_id] => 8765432
    [something_id] => 656f3953bc
    [folder_id] => 5499
    [title] => Title 2
    [type] => regular
    [create_time] => Dec 09, 2008 03:31 pm
    [2] => Array, etc. etc. etc. for another 15 elements
    [1] => Array
    [0] => Array
    [id] => 37214123
    [web_id] => 1234552
    [something_id] => 2750bd5a64
    [folder_id] => 0
    [title] => Title 3
    [type] => regular
    [create_time] => Jan 24, 2009 12:00 am
    [1] => Array
    [id] => 884174
    [web_id] => 477233
    [something_id] => 2750bd5a64
    [folder_id] => 0
    [title] => Title 3
    [type] => 0
    [create_time] => Jan 23, 2009 09:15 pm
    And what I want to do is to step through that inner array,
    either for
    element 1 or element 2, what would be the best way to do
    that? My attempts
    at using foreach() here are not working well!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================

    That's what I wanted. Seems simple now. What I had to do was
    to strip off
    the outer level array.
    Thanks, Gary!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Gary White" <[email protected]> wrote in message
    news:[email protected]..
    > On Mon, 26 Jan 2009 12:34:32 -0500, "Murray *ACE*"
    > <[email protected]> wrote:
    >
    >>And what I want to do is to step through that inner
    array, either for
    >>element 1 or element 2, what would be the best way to
    do that? My
    >>attempts
    >>at using foreach() here are not working well!
    >
    > Huh? What exactly are you trying to do?
    >
    > foreach($myarray as $a){
    > if (is_array($a)){
    > foreach($a as $inner){
    > // whatever
    > }
    > }
    > }
    >
    > Gary

  • [Error ORABPEL-10039]: invalid xpath expression  - array processing

    hi,
    I am trying to process multiple xml elements
    <assign name="setinsideattributes">
    <copy>
    <from expression="ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')"/>
    <to variable="ssn"/>
    </copy>
    </assign>
    where iterator is a index variable .
    I am getting into this error .
    Error(48):
    [Error ORABPEL-10039]: invalid xpath expression
    [Description]: in line 48 of "D:\OraBPELPM_1\integration\jdev\jdev\mywork\may10-workspace\multixm-catch\multixm-catch.bpel", xpath expression "ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')" specified in <from> is not valid, because XPath query syntax error.
    Syntax error while parsing xpath expression "ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')", at position "77" the exception is Expected: ).
    Please verify the xpath query "ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')" which is defined in BPEL process.
    [Potential fix]: Please make sure the expression is valid.
    any information on how to fix this .
    thanks in advance

    check out this note here
    http://clemensblog.blogspot.com/2006/03/bpel-looping-over-arrays-collections.html
    hth clemens

  • Array Processing in ABAP

    Hi all,
    I am a total newbie in ABAP.
    I need to process an array in ABAP.
    If it was in .NET C#, it will be like this:
    String strArr = new String[5] { "A", "B", "C", "D", "E" };
    int index = -1;
    for (int i=0; i<strArr.length; i++)
       if (myData.equals(strArr<i>))
            index = i;
            break;
    Can someone please convert the above code into ABAP?
    Urgent. Please help. <REMOVED BY MODERATOR>
    THank you.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 5:37 PM

    Hi,
    There is no concept of arrays in ABAP, we use internal tables to hold application data. U can use access internal tables with index.
    Read table itab index l_index this is same as u do in case of arrrays a(l_index)
    Instead use an Internal table to
    populate the values and read them ..
    say your Internal table has a field F1 ..
    itab-f1 = 10.
    append itab.
    clear itab.
    itab-f1 = 20.
    append itab.
    clear itab.
    itab-f1 = 30.
    append itab.
    clear itab.
    Now internal table has 3 values ...
    use loop ... endloop to get the values ..
    loop at itab.
    write :/ itab-f1.
    endloop.
    Also you can do this way:
    IT IS POSSIBLE TO DECLARE THE ONE -DIMENSIONAL ARRAY IN ABAP BY USING INTERNAL TABLES.
    EX.)
    DATA: BEGIN OF IT1 OCCURS 10,
    VAR1 TYPE I,
    END OF IT1.
    IT1-VAR1 = 10.
    APPEND IT1.
    IT1-VAR1 = 20.
    APPEND IT1.
    IT1-VAR1 = 30.
    APPEND IT1.
    LOOP AT IT1.
    WRITE:/ IT1-VAR1 COLOR 5.
    END LOOP.
    <REMOVED BY MODERATOR>
    Cheers,
    Chandra Sekhar.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 5:38 PM

  • PHP Arrays in Dreamweaver

    Hi,
    First off, I hope this is the proper place to post this
    question... I've been looking all over for an answer and have yet
    to find one.
    I'm currently working on a project where I need to submit an
    array of intergers into a database. The user makes a number of
    selections on a form of check boxes, the form is submitted, and an
    array (should be) stored in a column within my database. I'm
    currently having issue though with only the value of the final
    checked box appearing in my database. I'm wondering if anyone can
    help as I've checked all over and can not find an appropriate
    answer. Thank you in advance.

    sacomoney wrote:
    > I'm sure it's not overly complicated but I
    > guess I'm just not ready to grasp it yet.
    It's not overly complicated, but you have come face-to-face
    with a
    common problem: it appears that you're relying on Dreamweaver
    to
    generate PHP for you without really understanding how the
    code works.
    Once you start doing anything not covered by the basic server
    behaviors,
    you need to have a good knowledge of PHP in order to adapt
    the code
    successfully. You have made a brave attempt, but it won't
    work like that
    in a million years.
    The code that I gave you needs to go at the top of the page
    like this:
    <?php
    if (isset($_POST['cb_minorcat'])) {
    $_POST['cb_minorcat'] = implode(',', $_POST['cb_minorcat']);
    } else {
    $_POST['cb_minorcat'] = null;
    ?>
    Then you need to change the code created by Dreamweaver from
    this:
    GetSQLValueString($_POST['cb_minorcat'] ? "true" : "",
    "defined","'Y'","'N'")
    to this:
    GetSQLValueString($_POST['cb_minorcat'], "text")
    Dreamweaver's GetSQLValueString() function prepares the form
    values for
    safe insertion into the database. What the first block of
    code does is
    change the array into a string. Therefore, you need to pass
    $_POST['cb_minorcat'] to GetSQLValueString() as text.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions"
    http://foundationphp.com/

  • Array Processing in Forms 6i

    I am developing a common function in a PLL library that requires data from a calling form to be retrieved into temporary arrays on which some processing and calculation takes place and the resultant data is inserted into the destination table.
    In order to do this array manipulation and processing, I know of three options :
    1. Table Type
    2. Record Group
    3. Temporary Tables.
    Which is the best option to use in terms of
    1. Processing speed ,
    2. Client load ,
    3. Server Load,
    4. Multi user processing ,
    5. Re-usability,
    6. Forms 9i compatibility,
    7. Database Interactions
    If there is any other option, apart from the three above, please point out that too. Thanks in advance.

    If you are extracting the data and processing it all from one form, I would use a pl/sql table (Table Type). The coding would be easiest.
    A server side temporary table would give you SQL functionality, but would be much slower than a stand-alone client-side table.

  • PHP array

    I have a page listing part numbers and each row one checkbox. When selected rows are tagged, press "Save" and MySQL is updated. How to create an array?
    Each checkbox (row) has a different value.
    $TickMark=$Tickmark + 1;
    print <<<EOD
    <td>
    <INPUT type=checkbox name="CheckApp" value="$TickMark">
    </td>
    <td>$myrow[PartNo]
    </td>
    When "Save" button is pressed:
    $checkapp=$_POST['CheckApp'];
    if (issue($checkapp) && $checkapp !="") {
    mysql_query("UPDATE StockReg SET OrderTick = '$checkapp' WHERE PartNo = 'partno'");

    rasat wrote:
    Romashka wrote:What a strange construct...  Is it Perl/Python/Rubysh thing? :?
    Copied from from php's official manual. You also recommended to read it, that's what an user may get when too much information.
    Where did you read that?
    Function Reference - Arrays - foreach
    The right way is described here, and also
    You may have noticed that the following are functionally identical:
    Even in Language Reference - Types - Arrays there's no mention of list/each way, only foreach. So I'm curious why did you choose that way.
    It's highly recommended to read Language Reference, Security and Features before Function Reference, and always have the latest version of PHP Manual with users' comments (or online).
    rasat wrote:This is why I prefer instead Arch Forum (General Programming Forum) ... if not the direct answer but right direction for the solution.
    Arch Community is great!
    rasat wrote:Thanks, for the simpler format.
    You are welcome!
    BTW, you are forum and wiki admin, but who maintains their code? dtw?

  • PHP Self Processing Form

    Hi
    I'm tring to adapt a form processing script that appears in
    the book "PHP Web Development with Macromedia Dreamweaver MX 2004"
    published by Apress. The example in the book has a simple form
    containing a "comments" field and a "email" and "confirm your
    email" fields. The script works fine but the form I need has a few
    more fields. ie. "name" and "telephone". How can I alter the
    attached script so that the contents of these extra fields are sent
    along with the rest of the email?
    Thanks for your help!

    After
    if (isset($_POST['comments']) &&
    !empty($_POST['comments'])) {
    $message=strip_tags($_POST['comments']);
    else {
    $nomessage = 'You have not entered any comments';
    And using the same syntax as above add:
    if (isset($_POST['name']) && !empty($_POST['name']))
    $message .= "\n";
    $message .= "Name: " . strip_tags($_POST['name']);
    if (isset($_POST['telephone']) &&
    !empty($_POST['telephone'])) {
    $message .= "\n";
    $message .= "Telephone: " . strip_tags($_POST['telephone']);
    \n is the newline character for emails
    Gareth
    http://www.phploginsuite.co.uk/
    PHP Login Suite V2 - 34 Server Behaviors to build a complete
    Login system.

  • Help with PHP array code

    Not sure what's going on here, but hopefully someone can spot where I'm going wrong.
    Its especially weird, as I'm using the same code, with the same database table names etc but on a different site.
    Basically, I've set up a database table to store customer feedback on products.
    Its all working fine on this site :
    http://www.mye-reader.co.uk/customerreviews.php
    But on the site I'm working on, its only showing the first record. There are only a couple of records at the moment, but I've tried changing the query from ASC to DESC, and it swaps the one it shows, so it looks like the issue is with the array. Even though its the same code.
    http://www.mybabymonitors.co.uk/reviews.php
    Anyway, my query looks like :
    mysql_select_db($database_connPixelar, $connPixelar);
    $query_rsReviews = "SELECT * FROM feedback WHERE Approved = 'Yes' ORDER BY Product DESC";
    $rsReviews = mysql_query($query_rsReviews, $connPixelar) or die(mysql_error());
    $row_rsReviews = mysql_fetch_assoc($rsReviews);
    $totalRows_rsReviews = mysql_num_rows($rsReviews);
    And the array code looks like :
    <table cellpadding="0" cellspacing="0" width="100%" border="0">
           <?php
         $groups = array();
    while ($row = mysql_fetch_assoc($rsReviews)) {
        $groups[$row['Product']][] = $row;
    foreach ($groups as $product_name => $rows) {
        echo "<tr><td class=\"product\">$product_name</td></tr>";
        foreach ($rows as $row) {
            echo "<tr><td class=\"review\">".$row['Review']."</td></tr>";
            echo "<tr><td class=\"name\">".$row['CustomerName']."</td></tr>";
            echo "<tr><td class=\"date\">".$row['Date']."</td></tr>";
    ?>
    </table>
    Any ideas what's going on here?

    Its OK - I figured it out - it was the
    $row_rsReviews = mysql_fetch_assoc($rsReviews);
    line in the query.
    Turns out it wasn't that one was working, and the other not - they were both starting from the second record.

  • ARGB to RGB, array processing performance

    I'm trying to use a 2D picture control to display rapidly changing data - I need a decent frame rate.  I'm using the Cairo graphics library to generate the bitmap I want to display and then using a dll call to LabVIEW:MoveBlock to get it to display.  The bitmap is fairly large (720x1366) but Cairo and the MoveBlock seem pretty efficient and their performance is fine.
    The problem is that I need to convert the frame (a 1D array of U32, representing ARGB) to an array of U8 representing R then G then B. This is then converted to a string and sent to the 2D picture control to display.
    I'm using this VI to do the conversion.
    The ARGB and RGB arrays are preallocated.  However, the performance still sucks.  At the moment I'm getting about 16 frames a second and this section of my main loop is taking four times longer than everything else put together.  All I'm trying to do is strip out the alpha channel!  I've tried using masking and bitshifts rather than the split number blocks - no benefit.  I've tried pulling back the original frame as an array of U8 (A then R then G then B) and then using the decimate array and interleave array blocks to filter out the A bytes.  It was slower.
    Any ideas?
    Luke

    The array going into the shift register is already preallocated to the right size (number of pixels * 3).  The ARGB array is sized to the number of pixels.  I've tried various splitting solutions, but it seems the cost of resizing the array into a linear array so I can convert it into a string to send it to the picture control is too great. 
    Here's the code in context:  The ARGB array is grabbed using MoveBlock, processed to just get the RGB values and then formatted to be sent to the picture control.  The picture control is updated after the frame blank is detected, which just about gives flicker free updating.  The slow bits seem to be processing the ARGB array and passing the array to the picture control.  I've tried grabbing the ARGB as an array of A, R, G and B (ie bytes) but this doesn't yield any speed up.  I've also tried not processing it at all and telling the picture control to expect a color depth of 32 rather than 24, and, whilst this works (not documented... Grr NI Grr)  it isn't any faster and gets the colours wrong...
    All I want to do is put an ARGB array on the screen quickly... how hard can it be??

Maybe you are looking for

  • Please help me figure out what's wrong with my girls fairly new Toshiba lap top.

    OK as of late my girl got a nice new laptop. It started off really fast and she was really happy with it. But in the past three weeks or so it's been acting up. It's not connecting to the Wi-Fi properly, and won't read and other available confections

  • Abap OO workflow event

    Hello everybody, i am trying to use a class event as trigger event in my new workflow but i alwasy get the message: "Event xx does not exist". I am already implementing the IF_WORKFLOW interface in the class, the event is public ... i don't understan

  • Scenario to pick the mail with its attachments into XI

    Hi to All, I am creating a scenario in which i have to pick the mail from mail server (gmail) into XI ...and then want to process the attachment of the mail( which is in XML format)...&  put the information of the attachment into the RFC. So i need a

  • Creation of products in standalone system

    hi what is the procedure for creating products in crm stand alone system? what steps are involved in creation? thanks ajay

  • OWA_COOKIE package problems

    Hello! I'm new to this forum and I have subscribed because I started working in an Oracle partner in Portugal. I am programming a dynamic menu and I have a problem using cookies (I need them to transmit menu selections informations between different