Help with indexing in PHP

Hello,
I use dbxml version 2.2.13 with PHP.
I am trying to index a document but seems that without success because the performance doesn't change.
The doc has 1600 elements and executing a query takes about 0.22 secs
The xquery looks like this (a bit simplified):
<pre>
declare namespace ns1 = "urn:...";
declare function local:foo ($p1 as element(), $p2 as element()) as item() {
let $a := data($p2/AAA)
let $b := data($p2/BBB)
let $r := $p1//CCC/*[name()=\$a][@ns1:attr1=\$b]
return $r/DDD
local:foo( doc("...")/*[1] , ... )
</pre>
I create the container like this:
$mgr->createContainer($qcname,DBXML_INDEX_NODES);
I have 4 questions:
Q1) Which index strategy should I take?
I have tested using "CCC" , "node-element-presence-none" but no speed up occurs.
The qplan shows sth like:
<OQPlan>P(node-element-presence-none,=,CCC)</OQPlan>
So seems the index is correctly set.
It is strategy ok? Which other indexes should I use?
Q2) should the indexes be inserted before or after inserting the document, or is this irrelevant?
Q3) If I create the container from php as shown before, and then I open it with dbxml it shows:
Type of default container: NodeContainer
Index Nodes: off
However if I create the container directly from dbxml it
Type of default container: NodeContainer
Index Nodes: on
Why is that?
Q4) I need to repeat several times $mgr->query(....) . Does this affect somehow the data base acces performance?
I'd be glad if someone could help me to make the indexes work..
Best,
/Enric

Q2) should the indexes be inserted before or after
inserting the document, or is this irrelevant?In the sense that this will not affect what the indexes contain, this is irrelevent. However, we normally recommend adding indexes before documents, or you would risk a lengthy re-index operation.
Q3) If I create the container from php as shown
before, and then I open it with dbxml it shows:
Type of default container: NodeContainer
Index Nodes: off
However if I create the container directly from dbxml
it
Type of default container: NodeContainer
Index Nodes: on
Why is that?This is a bug in the PHP API - it is also why your indexes made no difference for you. You will need to create your container outside PHP using DBXML_INDEX_NODES.
Q4) I need to repeat several times $mgr->query(....)
. Does this affect somehow the data base acces
performance?If the query is run several times, you would benefit from preparing it once, and executing it from the XmlQueryExpression object.
John

Similar Messages

  • Need Urgent Help with Apache and PHP

    I have been struggling with apache and php for a week now and I finally broke down to post a message.
    I have apache 1.3 running on my mac mini g4 with 10.4.9 and I installed sql. I went to the entropy website and downloaded php5 to install without knowing I already had php4 on the machine. I installed 5 but could not get it to work. I then went back to httpd.conf and tried to install php4 by uncommenting out the loadmodule and addmodule lines. I restarted apache but php still did not work. I tested the phpinfo.php script but all I got was the script in Safari and not the actual page. At the moment, I have php4 and php5 on my machine but can't get either one to work. I am sure there is an easy fix but I don't know it. Please help.

    The problem is not terribly complicated, but Apache will not start with the entropy file in the folder
    /etc/httpd/users/
    Let me experiment on you. Rename the entropy file and then try to start Apache. To do this, open Terminal and paste this command:
    <pre>sudo mv /etc/httpd/users/+entropy.conf /etc/httpd/users/+entropy<pre>
    Now check the Apache configuration:
    <pre>apachectl configtest<pre>
    If it says "Syntax OK", start Apache:
    <pre>sudo apachectl start<pre>
    Since we only disabled the entropy file, you should be able to enable PHP5 with some more advanced configuring.

  • Help with Mac Dreamweaver PHP

    Well, I finally have PHP embedded within HTML working however the directory structure is totally confusing me.  I place files is /MAMP/htdocs and yet nothing works unless I add /MAMP/htdocs/htdocs and place the index and other php files ALSO in there.  I must open the ones in /MAP/htdocs and yet when I run them using my test server the files in /MAMP/htdocs/htdocs are the ones that are actually used.
    My configuration in SITES is
    Test Server
    local/network
    /Applciations/MAMP/
    http://localhost:8888/
    I would appreciate help understanding how to properly configure DreamWeaver SITE so that I can place all files in the MAMP/htdocs directory and eliminate the reducntant one.
    Thanks,
    Rick

    If you're using MAMP, your DW local site folder should be something like this:
    /Applications/MAMP/htdocs/sitename
    Because htdocs is the default folder MAMP routes to as localhost. Whatever site you have within htdocs folder will be suffixed with localhost in your browser for testing.
    For example, your site files (working files) can be put in a folder and that folder should be placed within 'htdocs' folder in MAMP Application folder.
    Say, you have a folder called 'test' containing index.php and this folder is placed within htdocs, your DW local site folder will be:
    /Applications/MAMP/htdocs/test
    To check this in browser, you'll simply enter
    http://localhost:8888/test
    This will run the index.php file within test folder by default.
    Your testing server can be the same as 'localhost:8888/test' for the site.
    If you want your Remote FTP also configured, enter your webhost's details and get that configured.
    -ST

  • Help with JS form, PHP Contact Form....

    I originally posted this in another area, but had no luck...
    I'm having trouble with a template that I downloaded (from Template Monster). My contact form shows "submitted", but I get no email.  I will submit my coding below & see if someone can help... My JS.forms is in a "JS" sub-folder in the main directory and my index.html and MailHandler.php/ashx files are in the main directory.
    MailHandler.php --
    <?php
        $owner_email = $_POST["owner_email"];
        $headers = 'From:' . $_POST["email"];
        $subject = 'A message from your site visitor ' . $_POST["name"];
        $messageBody = "";
        if($_POST['name']!='nope'){
            $messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['email']!='nope'){
            $messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        }else{
            $headers = '';
        if($_POST['state']!='nope'){       
            $messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['phone']!='nope'){       
            $messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['fax']!='nope'){       
            $messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
            $messageBody .= '<br>' . "\n";
        if($_POST['message']!='nope'){
            $messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
        if($_POST["stripHTML"] == 'true'){
            $messageBody = strip_tags($messageBody);
        try{
            if(!mail($owner_email, $subject, $messageBody, $headers)){
                throw new Exception('mail failed');
            }else{
                echo 'mail sent';
        }catch(Exception $e){
            echo $e->getMessage() ."\n";
    ?>
    JS Form --
    //forms
    ;(function($){
        $.fn.forms=function(o){
            return this.each(function(){
                var th=$(this)
                    ,_=th.data('forms')||{
                        errorCl:'error',
                        emptyCl:'empty',
                        invalidCl:'invalid',
                        notRequiredCl:'notRequired',
                        successCl:'success',
                        successShow:'4000',
                        mailHandlerURL:'MailHandler.php',
                        ownerEmail:'I have Client's Email Here',
                        stripHTML:true,
                        smtpMailServer:'localhost',
                        targets:'input,textarea',
                        controls:'a[data-type=reset],a[data-type=submit]',
                        validate:true,
                        rx:{
                            ".name":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},
                            ".state":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},
                            ".email":{rx:/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@(( ?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1 [0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][ 0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i,target:'input'},
                            ".phone":{rx:/^\+?(\d[\d\-\+\(\) ]{5,}\d$)/,target:'input'},
                            ".fax":{rx:/^\+?(\d[\d\-\+\(\) ]{5,}\d$)/,target:'input'},
                            ".message":{rx:/.{20}/,target:'textarea'}
                        preFu:function(){
                            _.labels.each(function(){
                                var label=$(this),
                                    inp=$(_.targets,this),
                                    defVal=inp.val(),
                                    trueVal=(function(){
                                                var tmp=inp.is('input')?(tmp=label.html().match(/value=['"](.+?)['"].+/),!!tmp&&!!tmp[1]&&tmp [1]):inp.html()
                                                return defVal==''?defVal:tmp
                                trueVal!=defVal
                                    &&inp.val(defVal=trueVal||defVal)
                                label.data({defVal:defVal})                               
                                inp
                                    .bind('focus',function(){
                                        inp.val()==defVal
                                            &&(inp.val(''),_.hideEmptyFu(label),label.removeClass(_.invalidCl))
                                    .bind('blur',function(){
                                        _.validateFu(label)
                                        if(_.isEmpty(label))
                                            inp.val(defVal)
                                            ,_.hideErrorFu(label.removeClass(_.invalidCl))                                           
                                    .bind('keyup',function(){
                                        label.hasClass(_.invalidCl)
                                            &&_.validateFu(label)
                                label.find('.'+_.errorCl+',.'+_.emptyCl).css({display:'block'}).hide()
                            _.success=$('.'+_.successCl,_.form).hide()
                        isRequired:function(el){                           
                            return !el.hasClass(_.notRequiredCl)
                        isValid:function(el){                           
                            var ret=true
                            $.each(_.rx,function(k,d){
                                if(el.is(k))
                                    ret=d.rx.test(el.find(d.target).val())                                       
                            return ret                           
                        isEmpty:function(el){
                            var tmp
                            return (tmp=el.find(_.targets).val())==''||tmp==el.data('defVal')
                        validateFu:function(el){                           
                            el.each(function(){
                                var th=$(this)
                                    ,req=_.isRequired(th)
                                    ,empty=_.isEmpty(th)
                                    ,valid=_.isValid(th)                               
                                if(empty&&req)
                                    _.showEmptyFu(th.addClass(_.invalidCl))
                                else
                                    _.hideEmptyFu(th.removeClass(_.invalidCl))
                                if(!empty)
                                    if(valid)
                                        _.hideErrorFu(th.removeClass(_.invalidCl))
                                    else
                                        _.showErrorFu(th.addClass(_.invalidCl))                               
                        getValFromLabel:function(label){
                            var val=$('input,textarea',label).val()
                                ,defVal=label.data('defVal')                               
                            return label.length?val==defVal?'nope':val:'nope'
                        ,submitFu:function(){
                            _.validateFu(_.labels)                           
                            if(!_.form.has('.'+_.invalidCl).length)
                                $.ajax({
                                    type: "POST",
                                    url:_.mailHandlerURL,
                                    data:{
                                        name:_.getValFromLabel($('.name',_.form)),
                                        email:_.getValFromLabel($('.email',_.form)),
                                        phone:_.getValFromLabel($('.phone',_.form)),
                                        fax:_.getValFromLabel($('.fax',_.form)),
                                        state:_.getValFromLabel($('.state',_.form)),
                                        message:_.getValFromLabel($('.message',_.form)),
                                        owner_email:_.ownerEmail,
                                        stripHTML:_.stripHTML
                                    success: function(){
                                        _.showFu()
                        showFu:function(){
                            _.success.slideDown(function(){
                                setTimeout(function(){
                                    _.success.slideUp()
                                    _.form.trigger('reset')
                                },_.successShow)
                        controlsFu:function(){
                            $(_.controls,_.form).each(function(){
                                var th=$(this)
                                th
                                    .bind('click',function(){
                                        _.form.trigger(th.data('type'))
                                        return false
                        showErrorFu:function(label){
                            label.find('.'+_.errorCl).slideDown()
                        hideErrorFu:function(label){
                            label.find('.'+_.errorCl).slideUp()
                        showEmptyFu:function(label){
                            label.find('.'+_.emptyCl).slideDown()
                            _.hideErrorFu(label)
                        hideEmptyFu:function(label){
                            label.find('.'+_.emptyCl).slideUp()
                        init:function(){
                            _.form=_.me                       
                            _.labels=$('label',_.form)
                            _.preFu()
                            _.controlsFu()
                            _.form
                                .bind('submit',function(){
                                    if(_.validate)
                                        _.submitFu()
                                    else
                                        _.form[0].submit()
                                    return false
                                .bind('reset',function(){
                                    _.labels.removeClass(_.invalidCl)                                   
                                    _.labels.each(function(){
                                        var th=$(this)
                                        _.hideErrorFu(th)
                                        _.hideEmptyFu(th)
                            _.form.trigger('reset')
                _.me||_.init(_.me=th.data({forms:_}))
                typeof o=='object'
                    &&$.extend(_,o)
    })(jQuery)
    $(window).load(function() {   
        $('#ContactForm').forms({
            ownerEmail:'I Have Client's Email Here'
    Contact HTML --
    <form action="contact.php" method="post" id="ContactForm">
                                <div class="success"> Contact form submitted!<br>
                                  <strong>We will be in touch soon.</strong> </div>
                                <fieldset>
                                  <div class="wrapper">
                                    <span class="col1">Name:</span>
                                    <label class="name">
                                      <span class="bg"><input name="cf_name" type="text" class="input"></span>
                                      <span class="error">*This is not a valid name.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="wrapper">
                                    <span class="col1">Email:</span>
                                    <label class="email">
                                      <span class="bg"><input name="cf_email" type="text" class="input"></span>
                                      <span class="error">*This is not a valid email address.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="wrapper">
                                    <span class="col1">Phone:</span>
                                    <label class="phone">
                                      <span class="bg"><input name="cf_phone" type="text" class="input"></span>
                                      <span class="error">*This is not a valid phone number.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="wrapper">
                                    <span class="col1">Message:</span>
                                    <label class="message">
                                      <span class="bg"><textarea name="cf_message" rows="1" cols="1"></textarea></span>
                                      <span class="error">*The message is too short.</span> <span class="empty">*This field is required.</span>
                                      </label>
                                    </div>
                                  <div class="btns"><a href="#" class="link1" data-type="submit">Send</a><a href="#" class="link1" data-type="reset">Clear</a></div>
                                  </fieldset>
                                </form>

    If Template Monster supplied you with this code, I think you should contact them about it.
    It's not how I would do things.
    Nancy O.

  • Help with phpMyAdmin setup.php script

    Hi all,
    I am a newbie to Arch Linux even though I've been running Linux (-only) for more than a year. I have been mostly running Debian based distributions, so sometimes I feel a bit lost on Arch. So far I have been able to set everything up, from wireless to X server (by just reading the instructions, and some posts in the forum).
    Now I am stuck with something that is not so distro-related, I was following this guide (http://wiki.archlinux.org/index.php/LAMP) but I got stuck at the configuration script for phpMyAdmin.
    In fact, when I go to the address http://localhost/phpMyAdmin/scripts/setup.php I can only see the PHP code, not the web page.
    Now I am sure that Apache is running properly since my php test page runs just fine. So I cannot figure out why the setup.php page does not show correctly.
    Could somebody please give me some hints?
    Any help is greatly appreciated,
    Thanks for your time.

    np .. i forgot one point though , you needed to restart the web server so the php module takes the new settings. this is the case fro all config changes to either teh websierver or a modules/addon

  • Help with flash and php prlblem

    the problem is flash receive the data back after send
    loadvars.but it always got it wrong.
    code in flash is:
    send_btn.onRelease = function() {
    myVars = new LoadVars();
    myVars.username = username_txt.text;
    myVars.phonenum = phonenum_txt.text;
    myVars.picktime = picktime_txt.text;
    myVars.email = email_txt.text;
    myVars.address = address_txt.text;
    myVars.shortmessage = shortmessage_txt.text;
    myVars.onLoad = function(success) {
    if (success) {
    if (this.order) {
    gotoAndStop(2);
    } else {
    gotoAndStop(3);
    delete myVars;
    myVars.sendAndLoad("sendorder.php", myVars, "POST");
    and code in php is:
    $username = $_POST['username'];
    $phonenum = $_POST['phonenum'];
    $picktime= $_POST['picktime'];
    $email = $_POST['email'];
    $address = $_POST['address'];
    $shortmessage= $_POST['shortmessage'];
    $result=mysql_query("insert into
    userinfo(email,username,phonenum,address,picktime,message)
    values('$email','$username','$phonenum','$address','$picktime','$shortmessage')");
    if($result){
    echo "order=1";
    }else{
    echo "order=0";
    flash reponse after receiving the varaible from php is always
    go to frame 3
    but the test of php is output order=1.
    what is wrong with it?please help::^_^

    interesting b, but i think i see something else here that is
    the reason you needed to add the '&'. You're passing back a
    number value (ie. 0/1) and treating it as a boolean (all fine)
    except that in the echo statement it's all inside quotes, so it's
    being interpreted as a complete String. to remedy, try writing the
    echo like this:
    if($result) {
    echo('order='.1);
    }else{
    echo('order='.0);
    and you're welcome :)

  • Help With HttpURLConnection and PHP

    I can connect to a site with HttpURLConnection but i need to access a link FROM that site.
    Ex: www.hangman/index.php
    I need to get a link like www.hangman/index.php?letter=a
    It will only display the letter if you go from www.hangman/index.php and click on the letter. But how do i do that with HttpURLConnection.
    I think you have to use the POST , but it doesnt work.
    Thanks.

    That's probably because the site uses cookies to maintain a session.
    The cookie's name is PHPSESSID, so I'm guessing this is a standard PHP session maintenance system (I haven't worked with PHP much...).
    So if you want to create a java app that will play hangman from that site, it looks like you'll have to handle cookies to keep the session active between accesses. So you'll grab the cookie from the response headers in the first connection, and then send it to the server in the request headers in subsequent connections. The cookie may remain the same throughout the session, or it may change on each connection; I don't know.
    I did a quick google and found this:
    http://jcookie.sourceforge.net/
    I haven't used it myself, but it looks useful. Unless you're doing this as a learning exercise, it's probably easier to use this than to wrote your own cookie code.

  • Need help with a simple php page link

    I have a small .php to force the download of a file when a user clicks on a link:
    <?php
    header ("Content-type:application/pdf");
    header ("Content-Disposition:attachment;filename='form.pdf'");
    readfile ("form.pdf");
    ?>
    I need to include code which will redirect the user back to the home page without opening a new browser window, either during or immediately after downloading the file. And if it's possible, prevent the browser back button to return the user to the download page.
    I tried adding this after the readfile line:  echo "<a href="mywebsite.com/index.html" /a>";
    but that failed miserably. My php knowledge is as weak as a bull moose after the mating season. Can someone help me out on this?

    If you couldn't tell whether it is AS2 or AS3, it is doubtful you can turn it from AS2 into AS3, at least not until you learn both languages.  There is no tool made that does it for you.

  • Help with Voting System (PHP)

    I am working on a voting system for my site, allowing users
    to rate submissions.
    On the submission page there is a voting meter (1-5) which is
    actually five individual images side by side. Each one links the
    user to the same page (index.php?page=submission&id=[id]) but
    adds '&vote=[a number 1-5]' to the url. When the submission
    page loads it checks if $_GET['vote'] is set and will take actions
    accordingly. After these actions are taken I wanted to use the PHP
    header function to reload the same page without the 'vote' variable
    in the url, but I can't do this because the submission page is an
    include on index.php, so it tells me the header has already been
    set.
    Obviously this method isn't going to work. Could someone tell
    me a better way of doing this?

    Q2) should the indexes be inserted before or after
    inserting the document, or is this irrelevant?In the sense that this will not affect what the indexes contain, this is irrelevent. However, we normally recommend adding indexes before documents, or you would risk a lengthy re-index operation.
    Q3) If I create the container from php as shown
    before, and then I open it with dbxml it shows:
    Type of default container: NodeContainer
    Index Nodes: off
    However if I create the container directly from dbxml
    it
    Type of default container: NodeContainer
    Index Nodes: on
    Why is that?This is a bug in the PHP API - it is also why your indexes made no difference for you. You will need to create your container outside PHP using DBXML_INDEX_NODES.
    Q4) I need to repeat several times $mgr->query(....)
    . Does this affect somehow the data base acces
    performance?If the query is run several times, you would benefit from preparing it once, and executing it from the XmlQueryExpression object.
    John

  • Urgent help with Index page needed

    Can anyone help? I use Dreamweaver 8 to modify and update my
    work's website and I've come across a very strange problem that I
    haven't seen before. I amended a news page, entitled 'news.html'
    and uploaded it as normal last week. I also put a few new pictures
    on the index page and did the same. It was fine at that point,
    however having looked at the page four days later, the news page
    now shows as the home page when you visit the site. It isn't
    calling itself the index page as the browser still shows as the
    page as 'news.html'.
    But the strange thing is, when you first go to the site or
    click the homepage from an internal page, you get a very quick
    glimpse of the original index page before the news page replaces
    it. Almost overwrites it.
    VERY confused. Have tried re uploading the index page and am
    running out of solutions. Any help most welcome.

    On Wed, 21 Feb 2007 11:54:52 +0000 (UTC), "Rach JH"
    <[email protected]> wrote:
    >Can anyone help? I use Dreamweaver 8 to modify and update
    my work's website and
    >I've come across a very strange problem that I haven't
    seen before. I amended a
    >news page, entitled 'news.html' and uploaded it as normal
    last week. I also put
    >a few new pictures on the index page and did the same. It
    was fine at that
    >point, however having looked at the page four days later,
    the news page now
    >shows as the home page when you visit the site. It isn't
    calling itself the
    >index page as the browser still shows as the page as
    'news.html'.
    >
    > But the strange thing is, when you first go to the site
    or click the homepage
    >from an internal page, you get a very quick glimpse of
    the original index page
    >before the news page replaces it. Almost overwrites it.
    >
    > VERY confused. Have tried re uploading the index page
    and am running out of
    >solutions. Any help most welcome.
    URL?
    Win
    Win Day, Wild Rose Websites
    http://www.wildrosewebsites.com
    [email protected]
    Skype winifredday

  • Help with arrays in PHP

    Hi All,
    I have created a page that shows thumbnail images of all
    images in a
    given directory. Here is the function that searches the
    directory and
    builds an array of qualified files:
    > function getImages($dir) {
    > $directory = new DirectoryIterator($dir);
    > $fileTypes =
    '#\.jpg$|\.jpeg$|\.gif$|\.png$|\.JPG$|\.GIF$|\.PNG$#i';
    > $filtered = new RegexIterator($directory, $fileTypes);
    > $array = array();
    > foreach ($filtered as $item) {
    > $array[] = $item->getFilename();
    > }
    > return new ArrayIterator($array);
    > }
    >
    > // get an ArrayIterator of filenames and the total
    number:
    > $images = getImages('../images/images_news/');
    > $totalImages = $images->count();
    Here is the HTML and PHP used to display the images (I'm
    excluding code
    that is specific to the paging function):
    > // Implement offset and files per page
    > foreach (new LimitIterator($images, $offset,
    $filesperpage) as
    > $image) { ?>
    > <div class="imgcont">
    > <div class="imgholder">
    > <img src="../images/images_news/<?php echo $image;
    ?>"
    > alt="<?php echo $image; ?>" height="55"
    class="center" />
    > </div>
    > <p class="smallname"><?php echo $image;
    ?></p><br />
    > </div>
    > <?php } ?>
    > <div class="clear"><br />
    My question is this. I need to provide a way to delete images
    that will
    no longer be needed. Actually, I need to be able to delete
    the main
    image and the thumbnail image, each of which is in a separate
    directory. What I don't know is how this type of thing is
    normally done
    (I don't want the FTP route because I don't want a client
    messing about
    in the directory structure). And what I don't understand is
    how to
    select one or more files to delete when they were produced by
    an array.
    For ease of use, it would be nice if I could add a checkbox
    that the
    user could check to indicate that the image(s) should be
    deleted. I
    just can't figure out how to select the file(s). I sure hope
    this is
    not one of those simple things that will make me hide my head
    in shame.
    Any help would be most appreciated.
    Brett

    Brett wrote:
    > the thumbnail images now have _tmb inserted between
    > the file name and the extension. So when deleting I keep
    getting
    > warnings that the file mypic001.jpg cannot be found in
    the thumbs
    > directory. How do I get the _tmb into the file name?
    foreach ($_POST['images'] as $image) {
    unlink($mainImgDir . $image);
    $pos = strrpos($image, '.');
    $thumb = substr($image, 0, $pos) . '_tmb' . substr($image,
    $pos);
    unlink($thumbsDir . $thumb);
    > By the way, you used unset() where I think you meant
    unlink().
    Yes, I did. Sorry about that.
    > Finally, I have discovered that if I upload a file named
    Ti301.JPG, I
    > get Ti301.JPG001_thb.jpg. It seems that the strtolower()
    function in
    > getNextFilename5.php is not converting the uppercase
    extension, it is
    > just adding the incremented number plus _tmb and the new
    extension. Any
    > ideas about how to correct that?
    That shouldn't be happening, but I don't have time to look
    into that
    now. Sorry.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Help with indexes

    1. Provide the SQL to create a bitmap index on a column named survey_vals in a table named results.
    2. Describe the overall characteristics of the data in the survey_vals column. (In other words, why is the data in this column a good candidate for a bit-mapped index)
    3. Provide the SQL to create a function-based index on a column called lastname in a table named authors.
    4. Provide an example of a query that would justify the use of a function-based index that you created in number 3.
    5. Provide the SQL to create a sequence named yourname_cmis420 that starts with 50,000 and has a maximum value of 100,000.
    Once you have completed these exercises, save the file as yourname_indexes.sql and submit via the assignments folder by the due date.

    submit via the assignments folder by the due dateDon't know if its before or after due date, but...
    1).
    SQL> create table results (survey_vals varchar2(10)) ;
    Table created.
    SQL> create bitmap index idx_results_survey_vals on results(survey_vals) ;
    Index created.
    SQL>2). without having the DDLs of the objects involved and the type of queries that will be asked from this table, it will be hard to tell.
    3).
    SQL> create table authors (lastname varchar2(50)) ;
    Table created.
    SQL> create index idx_authors_lastname on authors(upper(lastname)) ;
    Index created.
    SQL>4). Could be used for case-insensitive queries.
    5).
    SQL> create sequence yourname_cmis420 start with 50000 maxvalue 100000 ;
    Sequence created.
    SQL>

  • Need help with FlashVars and PHP

    I'm trying to pass a variable (an mp3 URL) generated from a SQL query with PHP to a small flash mp3 player embedded in the page. I am using FlashVars and its not receiving the .swf is not receiving the variable.
    Here is the embed code:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" width="35" height="35">
    <param name="movie" value="http://www.myurl.com/audioButton.swf"  />
    <param name="quality" value="high" />
    <param name="FlashVars" value="theFile=<?php echo $myaudio; ?>" />
    <embed src="example.swf" width="550" height="400" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="theFile=<?php echo $myaudio; ?>"></embed>
    </object>
    I've declared the variable at the top of the page like so:
    $myaudio = "http://www.myurl.com/demo.mp3";
    When I load the page, the flash player doesn't play the mp3. But if I put the mp3 URL directly into the embed code (see below) it works ...
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" width="35" height="35">
    <param name="movie" value="http://www.r2creative.com/audioButton.swf"  />
    <param name="quality" value="high" />
    <param name="FlashVars" value="theFile=http://www.myurl.com/demo.mp3" />
    <embed src="example.swf" width="550" height="400" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="theFile=http://www.myurl.com/demo.mp3"></embed>
    </object>

    Ok. I see where my problem is. What I'm ultimately trying to do is query a database of podcasts, and when they are displayed on a php page, have a small flash button next to each which streams the audio.
    I was placing the entire embed code of the flash player and placing into a field in the database (audioPlayer) and using another field (mp3Link) a the source. The page was displaying the players next to the podcasts but there was no audio.
    I just placed the embed code directly into the page and it works, so the flashvars problem is solved - outputting the embed code from the database must not work for some reason. I'm still not sure how I'll accomplish this, but I know now that the swf was receiving the variable.
    Thanks guys.

  • Help with indexing of files

    Hello,
    I have some text files and I have the words and their frequencies from each text
    file. Now I want to create an index for the words inorder to get the common
    number of words in the given text files.
    which method will be good for this part ... i'm thinking of vectors.
    Any help ??
    Thanks in advance

    Thanks for the reply.
    Is this possible to do it as a matrix representation i.e., like
             File1        File2      File3
    Word1      3            2           0            =    5
    Word2      1            1           4            =    6
    Word3      0            2           1            =    3If I'm correct, incase of HashMap, I have to use 2 keys (word & file) and
    1 value. I have the list of words, files and list of number of times the word
    appears in each file. Could you please tell me the best method to map them ?
    Thanks

  • Help with SL Server PHP and Oracle ?

    (my apologies for post to wrong forum first)
    I'm attempting to add oci8/instantclient to the "out-of-the-box" php distribution w/o recompiling (if at all possible)
    have installed instantclient in /usr/local
    installed oci8 from pecl and built w/instantclient
    I THINK my main issue is adding the DYLIB- envt variables because I cannot find a reference to the required XML syntax
    Has anyone got this bad boy working?

    Assuming you installed the Oracle Instant Client correctly, then try this as root (or issue sudo -s before):
    mkdir -p /SourceCache
    cd /SourceCache
    curl -O http://www.opensource.apple.com/source/apachemod_php/apache_modphp-53/php-5.3.0.tar.bz2
    tar xjf php-5.3.0.tar.bz2
    cd /SourceCache/php-5.3.0/ext/oci8
    phpize
    MACOSXDEPLOYMENTTARGET=10.6 CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch i386 -arch x86_64 -bindatload" ./configure
    make
    make install
    When done, edit/create /etc/php.ini and add:
    extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/oci8.so
    next issue:
    sudo apachectl graceful
    with a little luck you are all set.
    HTH,
    Alex

Maybe you are looking for

  • .pdf files will not open in Adobe Reader 9

    I have Windows XP Media Center edition and Internet Eplorer 7. I recently installed Adobe 9. Now, every time I try to open a PDF file, I get a broken link. Help!!!!!!

  • Problem in unzipping a file : ZipInputStream

    Hi All, I am having some issues in unzipping a zip file using ZipInputStream. Following is the code : public class ZipInputStreamExample {       * @param args      public static void main(String[] args) {           // TODO Auto-generated method stub

  • In need of help syncing my VC3... and yes I know there are many post, BUT

    So, Here is the difference between what many of you might take as first instinct to reply by saying, "there are many questions regarding this topic already..." My phone has been syncing fine with iSync. It is not until today that it has decided to st

  • How to find Shared Serivces Roles and Groups using scripts in IR?

    hi all, I am in IR 9.3.1 environment. I am trying to see if I can find a user's shared service group or role when they come into a BQY file, and I can code my IR accordingly to provide different needs. I know I can create a simple query using those V

  • Can i downgrade my ios 4.2 to 3.1.3

    Hi guys am i allowed to downgrade my my ipod touch 2g with ios 4.2.1 to an older version because i like the 3.1.3 style more. and i don't like jailbreaks. hope it will works thx