Recordset definition CONCAT in php

I am having trouble with the CONCAT not being legal syntax in
the Dreamweaver Advance Recordset definition dialog?
For instance:
| Key | Cost1 | Cost2 |
--------+----------+------------
| A | 10.50 | 11.35 |
"SELECT CAST(t1.Cost1 AS CHAR), CAST(t1.Cost2 AS CHAR) FROM
t1" is valid syntax and works great, with a result of
| CAST(t1.Cost1 AS CHAR) | CAST(t1,Cost2 AS CHAR) |
--------------------------------------+---------------------------------------
| 10.50 | 11.35 |
However
"SELECT CONCAT( CAST(t1.Cost1 AS CHAR), CAST(t1.Cost2 AS
CHAR)) FROM t1"
is NOT valid syntax according to Dreamweaver.
Instead Dreamweaver v8.0.2 changes the above query to read
"SELECT CAST(t1.Cost1 ASCHAR, CAST(t1.Cost2 AS CHAR)) FROM
t1"
and then gives an error message.
1) The initial syntax is valid and works when applied
directly against the database.
2) If I change the autogenerated 'Code' directly and modify
the SQL Statement back to it's original form and then post the page
the query executes correctly.
Am I doing something wrong?

First: I've been working my way through your book 'Foundation
PHP for Dreamweaver 8'.
THANK YOU!
You have a rare gift.
Second: Any thoughts on how I might convince Adobe that I
will not hold it against them if they're hot fix isn't quite ready
for prime time?
I got the following very disappointing response to my
request.
I'm not interested in starting a rant. I just want to get my
work done.
Truth be told I'm starting to get a glimmer on how I can
solve this for myself by creating my own 'sever behavior', but that
will have to wait till I finish working through your book.
None the less I do like to feel supported by the vendors I
purchase my professional tools from.
More so, as I'm new to Dreamweaver and am in the process
determining if this will become my tool of choice.
As a result support receives very close scrutiny.
Adobe's response follows:
<<
Hi Donald,
Thank you for contacting Adobe Technical Support.
I understand you are having issues with using the CONCAT SQL
function through the advanced recordset in Dreamweaver 8.0.2.
This is still considered as an emerging issue with the
Dreamweaver 8.0.2 updater and the engineering team is currently
working for a fix right now. A fix will be released soon so you
just need to standby our website for fix releases (
http://www.adobe.com/go/updates).
For your new issues, please feel free to contact us again
using our web-based form:
http://www.adobe.com/support/email/complimentary
Thank you for understanding, and have a nice day.
Best regards,
Christine R.
Technical Support Engineer
Adobe Systems
A web based center providing TechNotes and documentation for
known product issues:
http://www.adobe.com/support
Please use your incident number 8574947 in any correspondence
with us.
Technical Support at Macromedia, now part of Adobe Systems
http://www.macromedia.com/support/
Note concerning Attachments: Please do not send attachments
in a reply to this email.
Instead, can you please contact the support agent to make
arrangements to send your files.
Thank you.
>>

Similar Messages

  • Unable to filter a recordset using a session  variable

    I have a volunteer application page and when the volunteer presses <Submit> their info is saved in a MySQl db table and a session variable is created containing the primary key of their record in the table, control is then passed to a "success page". The success page can access the session variable (I proved this by displaying the session variable on the success page) so my next step was to create a recordset in the success page with a filter using the session variable to select the appropriate row in the table, allowing me to display to the volunteer the info they submitted.
    I set up a test success page which displays the session variable and one field of the volunteer info. When I test this I see the session variable displayed but the corresponding volunteer info field from the recordset is not displayed.
    The volunteer application page is here www.hollisterairshow.com/volunteerapp.php and the successpage is here www.hollisterairshow.com/thanksvol.php
    The code that creates the session variable in the volunteer application page is shown below
    $_SESSION['volunteer_id'] = mysql_insert_id();
    The code to display the session variable in the success page is shown below
    <?php  echo $_SESSION['volunteer_id']; ?>
    The code to display the volunteer info is shown below
    <h1> Thank You <?php echo $row_rsVolunteerApp['firstname']; ?>!! </h1>
    The recordset definition is shown below
    The success page test result is shown below, as you can see the volunteer's first name is not displayed immediately after the "Thank you" message but the session variable holding the correct primary key (41) is shown correctly.
    Does anyone have an idea of what I'm doing wrong?
    Thanks
    Tony

    Where did you put session_start()? It needs to be before the variable is accessed. It's obviously before the line that displays the value in your page, but is it before the SQL query is generated?
    Also, have you checked in phpMyAdmin to see whether volunteernumber 41 has any values in the database?

  • CONCAT in MySQL

    Hi, I am trying to use recordset with CONCAT function in
    SELECT, and it always gets distorted by, it seems, Dreamweaver.
    Is there a workaround?

    JStefano wrote:
    > Hi, I am trying to use recordset with CONCAT function in
    SELECT, and it always gets distorted by, it seems, Dreamweaver.
    It sounds as though you're using Dreamweaver 8.0.2. Go to the
    following
    page, and download the PHP extension fix (the link is in the
    first
    paragraph):
    http://www.adobe.com/go/b6c2ae2a
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • PHP using soap to call EJB

    Hello everybody,
    I've a problem to call a EJB form a PHP script.
    There is a Apache with PHP 5.2.0 and a SAP NetWeaver Application Server 7.10 / AS Java 7.10 running on the system.
    I wanted to use soap to call a method in an EJB. It's only a test EJB:
    [code]
    package beans;
    import javax.ejb.Stateless;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    @WebService(name="HelloWorldEARBean",serviceName="HelloWorldEARBeanService",targetNamespace="http://beans/",portName="HelloWorldEARBeanPort") @Stateless public class HelloWorldEARBean {
      @WebMethod public String sayHello(String testStr){
                return "Hello Mr. "+testStr;
      @WebMethod public String getReturn(String inputStr){
                return "the return value is"+inputStr;
    [/code]
    I tried it with the PEAR SOAP in the following script:
    [code]
    <?php
    require_once 'SOAP/Client.php';
    $wsdl_url     = 'http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean?wsdl';
    $WSDL = new SOAP_WSDL($wsdl_url);
    $client = $WSDL->getProxy();
    $client->__trace(1);
    $options=array('namespace' => 'http://beans/',
      'style' => 'rpc',
      'soapaction' => 'sayHello');
    $NAME = "Bob"; 
    $parameters=array(
         'parameters', $NAME
    $result = $client->getReturn($parameters);
    echo "<pre>";
    print_r($params);
    echo "</pre>";
    echo "<h2>return</h2>";
    echo "<pre>";
    print_r($result);
    echo "</pre>";
    echo '<h2>Request</h2>';
    echo '<pre>' . htmlspecialchars($client->__getlastrequest(), ENT_QUOTES) . '</pre>';
    echo '<h2>Response</h2>';
    echo '<pre>' . htmlspecialchars($client->__getlastresponse(), ENT_QUOTES). '</pre>';
    ?>
    [/code]
    The AS distributes the following WSDL:
    [code]
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://beans/" xmlns:tns="http://beans/">
    - <wsdl:types>
    - <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://beans/">
      <xs:element name="getReturn" type="tns:getReturn" />
      <xs:element name="getReturnResponse" type="tns:getReturnResponse" />
      <xs:element name="sayHello" type="tns:sayHello" />
      <xs:element name="sayHelloResponse" type="tns:sayHelloResponse" />
    - <xs:complexType name="sayHello">
    - <xs:sequence>
      <xs:element name="arg0" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="sayHelloResponse">
    - <xs:sequence>
      <xs:element name="return" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="getReturn">
    - <xs:sequence>
      <xs:element name="arg0" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="getReturnResponse">
    - <xs:sequence>
      <xs:element name="return" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
      </xs:schema>
      </wsdl:types>
    - <wsdl:message name="sayHelloIn">
      <wsdl:part name="parameters" element="tns:sayHello" />
      </wsdl:message>
    - <wsdl:message name="sayHelloOut">
      <wsdl:part name="sayHelloResponse" element="tns:sayHelloResponse" />
      </wsdl:message>
    - <wsdl:message name="getReturnIn">
      <wsdl:part name="parameters" element="tns:getReturn" />
      </wsdl:message>
    - <wsdl:message name="getReturnOut">
      <wsdl:part name="getReturnResponse" element="tns:getReturnResponse" />
      </wsdl:message>
    - <wsdl:portType name="HelloWorldEARBean">
    - <wsdl:operation name="sayHello" parameterOrder="parameters">
      <wsdl:input message="tns:sayHelloIn" />
      <wsdl:output message="tns:sayHelloOut" />
      </wsdl:operation>
    - <wsdl:operation name="getReturn" parameterOrder="parameters">
      <wsdl:input message="tns:getReturnIn" />
      <wsdl:output message="tns:getReturnOut" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="HelloWorldEARBeanBinding" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" type="tns:HelloWorldEARBean">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="sayHello">
      <soap:operation soapAction="" />
    - <wsdl:input>
      <soap:body parts="parameters" use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="getReturn">
      <soap:operation soapAction="" />
    - <wsdl:input>
      <soap:body parts="parameters" use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="HelloWorldEARBeanService">
    - <wsdl:port name="HelloWorldEARBeanPort" binding="tns:HelloWorldEARBeanBinding">
      <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    [/code]
    By the following output it's obvious that the AS or the EJB (webservice) doesn't receive the parameter send by the PHP script. Look at the output:
    return value:
    the return value is null
    [code]
    Request:
    POST /HelloWorldEARBeanService/HelloWorldEARBean HTTP/1.0
    User-Agent: PEAR-SOAP 0.8.0RC4-devel
    Host: localhost
    Content-Type: text/xml; charset=UTF-8
    Content-Length: 438
    SOAPAction: ""
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    >
    <SOAP-ENV:Body>
    <getReturn xmlns="http://beans/">
    <item>parameters</item>
    <item>Bob</item></getReturn>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Response:
    HTTP/1.1 200 OK
    server: SAP NetWeaver Application Server 7.10 / AS Java 7.10
    content-type: text/xml; charset=utf-8
    date: Wed, 14 Feb 2007 15:51:53 GMT
    connection: close
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsu:Created>2007-02-14T15:51:53Z</wsu:Created>
    <wsu:Expires>2007-02-14T15:52:23Z</wsu:Expires></wsu:Timestamp></wsse:Security></SOAP-ENV:Header>
    <SOAP-ENV:Body><ns2:getReturnResponse xmlns:ns2='http://beans/'>
    <return>the return value is null</return></ns2:getReturnResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
    [/code]
    I used different soap interfaces for PHP like nusoap and the integrated soap interface of PHP 5.
    Further I experimented with different parameters inside the function call
    that results in small differencies at the xml-request.
    Thanks.

    Hi
    I've solved the problem now. I just have to add
    @SOAPBinding(style=SOAPBinding.Style.RPC)
    in the EJB, that's all.
    Here is the complete code, ... maybe some other guys have this problem too, so I will post the working code:
    At first the EJB:
    package beans;
    import javax.ejb.Stateless;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.soap.SOAPBinding;
    import beans.HelloWorldEARBean;
    @WebService(name="HelloWorldEARBean",serviceName="HelloWorldEARBeanService",targetNamespace="http://beans/",portName="HelloWorldEARBeanPort")
    @SOAPBinding(style=SOAPBinding.Style.RPC)
    @Stateless public class HelloWorldEARBean {
         @WebMethod public String sayHello(@WebParam(name="testStr") String testStr){
                return "Hello Mr. "+testStr;
    2. the local XML:
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://beans/" xmlns:tns="http://beans/">
      <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://beans/">
          <xs:element name="sayHello" type="tns:sayHello"/>
          <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
          <xs:complexType name="sayHello">
              <xs:element name="testStr" type="xs:string" minOccurs="0"/>
          </xs:complexType>
          <xs:complexType name="sayHelloResponse">
              <xs:element name="return" type="xs:string" minOccurs="0"/>
          </xs:complexType>
        </xs:schema>
      </wsdl:types>
      <wsdl:message name="sayHelloIn">
        <wsdl:part name="parameters" element="tns:sayHello"/>
      </wsdl:message>
      <wsdl:message name="sayHelloOut">
        <wsdl:part name="sayHelloResponse" element="tns:sayHelloResponse"/>
      </wsdl:message>
      <wsdl:portType name="HelloWorldEARBean">
        <wsdl:operation name="sayHello" parameterOrder="parameters">
          <wsdl:input message="tns:sayHelloIn"/>
          <wsdl:output message="tns:sayHelloOut"/>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="HelloWorldEARBeanBinding" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" type="tns:HelloWorldEARBean">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="sayHello">
          <soap:operation soapAction=""/>
          <wsdl:input>
            <soap:body parts="parameters" use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="HelloWorldEARBeanService">
        <wsdl:port name="HelloWorldEARBeanPort" binding="tns:HelloWorldEARBeanBinding">
          <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean"/>
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    3. the PHP script:
    see next post
    Thank you very much for your help.

  • Recordset(Query) Error Message

    Hi
    I'm a newbie, so I need your help. Whenever I try to add a
    Recordset(Query) to a PHP page I get the following error:
    " While executing addDynamicSource, the following JavaScript
    errors occured:
    At line 29 of file " C:\Program
    Files\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Recordset.js":
    JavaScript error while loading Recordset.htm
    At line 1111 of file
    "C:\ProgramFiles\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Recordset.js ":
    theStr=theStr.replace(/(?>)*/gi,""); //remove close tags
    SyntaxError: invalid quantifier? "
    Or this error (the same as in the Philgreg's post): "The
    Recordset script does not define the applyServerBehavior function"
    I'm using PHP5, MySQL with IIS as a testing server, and DW8
    (updated). Connection to database is OK.
    PLEASE HELP!
    Thanks in advance.
    link
    to the post
    link[/L]

    Have you tried reinstalling DW?
    "dedurus" <[email protected]> wrote in
    message
    news:e6pm9v$hci$[email protected]..
    > Hi
    > I'm a newbie, so I need your help. Whenever I try to add
    a
    > recordset(Query) to
    > a page I get the following error:
    > " While executing addDynamicSource, the following
    JavaScript errors
    > occured:
    > At line 29 of file " C:\Program
    >
    Files\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Recordset.js":
    > JavaScript error while loading Recordset.htm
    >
    >
    > At line 1111 of file
    >
    "C:\ProgramFiles\Macromedia\Dreamweaver8\Configuration\DataSources\PHP_MySQL\Rec
    > ordset.js":
    > theStr=theStr.replace(/(?>)*/gi,""); //remove close
    tags
    > SyntaxError: invalid quantifier? "
    >
    > I'm using PHP5, MySQL with IIS as a testing server, and
    DW8. Connection to
    > database is OK.
    > PLEASE HELP!
    > Thanks in advance.
    > dedurus
    >

  • Help setting up Flash Builder 4.5 for PHP

    I am looking for a concise set of steps for setting up ALL requirements for running Flash Builder 4.5 for PHP.  I have been fighting for three days to get the TestDrive example up and running, with no success.  At every step of the way I have encountered problems.  I fought for a day and a half with MySQL.  Then I fought for another day with PHP (Liip).  Then I fought for another day with Zend.  All along the way I have fought problems with Flash Builder and Flash Builder for PHP.  I've had to relearn all of my UNIX shell commands (it's been a few years).  I've tried using a remote server at 000webhost.com.  I've tried using an old laptop for a server.  I finally ended up trying to do it all on my main laptop.  I have completely given up and am ready to dump my project altogether.  Forget my students.  They'll just have to live without what would have been a fantastic new way of learning.
    HELP!!!

    Hi There,
    I do not have a 'concise' answer for you - in fact I am not using FB 4.5 for PHP.  I started using FB 4  around 8 months ago.  I installed a 'WAMP' thing, called 'EasyPHP'.  That actually went pretty smoothly.  I did the whole thing on my personal laptop running Windows 7.  I 'hooked up' FB to the PHP side using the built in data services wizards and such, as I imagine you are trying to do.  I too had to 'fight' a bit, but found most of the answers scattered around the Internet.  Had to tweak a few settings here and there in various files, and viola, it worked.
    I have resisted upgrading to 4.5, and especially the 4.5 "for" PHP, only becuase of the great expense.  It seems like a lot of money to pay for 'integrated, round-trip debugging'.  I already can debug the PHP side 'independently' of the FB side (from inside the Eclipse+PHP plugin free toolset), which, for most SQL situations is good enough. I simply set up a 'test page' in PHP and use that to 'call' the various functions I write.
    On the FB side, I gave up on using the 'built in data services wizard thingies' because they simply could not get the data-type mappings correct between the two sides.  Also, the "value objects" things (really just a fancy data-object class definition) seeme overly complex and inflexible, i.e., they would re-code themselves after every change I made to the PHP side.  I prefer a more 'lean' approach, and one that I control 100%.  So far I am able to do everything I need using my own 'value objects' (simple classes).
    So...as you can see, I may not be able to help much, but, if you can explain some of the details of what is failing, maybe I can provide a bit of assistance.  From what I understand, the big difference between 4.5 and 4.0, at least on the PHP side, is that the 'introspector' is a bit more accurate now and of couse there is the 'round-trip' debugging and 'awareness of each other's objects/definitions' while in PHP or FB.
    Finally, as best I can tell, after 8 months of 'experimenting' with Flex and PHP, there are simply not many people doing it, or, at least not that many doing it that participate on this forum and who have practical experience, especially with the more 'recent' releases, i.e., 4.0, 4.5.  I would encourage you to scan the rest of the Internet...there *is* knowledge out there...but it can difficult and slow to get.
    -David

  • Java SOAP and PHP server

    HI all, I have the follow problem:
    I have created a SOAP server with PHP. The client connection with PHP and with generated local classes for Java, with java.apache.axis.wsdl.WSDL2Java, is working very well and I don't have problems with this.
    But now I try to use my API with the normal calls from JAVA with the direct Call without local classes:
    Here are any sniplets:
    My Method in the wsdl file:
    - <xsd:complexType name="MyMethodRequest">
    - <xsd:all>
    <xsd:element name="username" type="xsd:string" />
    <xsd:element name="password" type="xsd:string" />
    <xsd:element name="partnerid" type="xsd:int" />
    <xsd:element name="signkey" type="xsd:string" />
    </xsd:all>
    </xsd:complexType>
    - <operation name="MyMethod">
    <soap:operation soapAction="urn:MyURN#MyMethod" style="rpc" />
    - <input>
    <soap:body use="encoded" namespace="urn:MyURN" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    - <output>
    <soap:body use="encoded" namespace="urn:MyURN" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    The definition in the PHP file look like this:
    $server->wsdl->addComplexType(
    'MyMethodRequest',
    'complexType',
    'struct',
    'all',
    array(
    'username' => array('name' => 'username', 'type' => 'xsd:string'),
              'password' => array('name' => 'password', 'type' => 'xsd:string'),
              'partnerid' => array('name' => 'partnerid', 'type' => 'xsd:int'),
    'signkey' => array('name' => 'signkey', 'type' => 'xsd:string')
    The server function is recieving an array with all this paramethers:
    function MyFunktion($member)
    // do anything
    Also the Java code:
    String method = "MyMethod";
    Object[] member = new Object[] {username, password, partnerid, signkey};
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress( new java.net.URL(endpoint) );
    call.setOperationName(new QName("urn:MyURN", method));
    call.setSOAPActionURI("urn:MyURN#MyMethod");
    call.setUseSOAPAction(true);
    call.addParameter( "member", XMLType.SOAP_ARRAY, ParameterMode.IN );
    call.setReturnType( XMLType.XSD_BOOLEAN );
    Object[] params = new Object[] {member};
    Boolean ret = (Boolean) call.invoke(params);
    System.err.print(" " + ret);
    System.err.println();
    I compile the class and when I start it, I don't send any data to the server, but why??? What do I made false? The server don't gives an error, but he dont recieve any data from me!
    Thanks for every help:-)
    Best Regards
    Nik

    Hi is there really noone who can help me? I need this so much:-)
    Please help me here:-)
    Thanks!
    Regards
    Nik

  • MySQL database - Recordset's echoing problem

    Gary, David & any other PHP wizards, listen up -
    Today I decided to use a MySQL database to hold my articles
    in, and then
    call them with a recordset when applicable. Everything works
    really, really
    nicely except for one thing.
    If you go here:
    http://sourtea.com/articles2.php
    And select "Read this article" for any of the articles,
    scroll down to the
    bottom where the comment form is and you'll see some PHP code
    being
    echo'ed - which isn't supposed to be.
    I've noticed in IE - it's always displayed with all articles,
    but on
    Firefox, it seems to only happen with the first article you
    open up, then
    all the others are fine.
    I'm calling the recordsets inside of my php cases, for
    example:
    <?php
    break;
    case 10:
    ?>
    <?php echo $row_getArticles['textfields']; ?>
    <?php
    break;
    case 20:
    ?>
    And so on.
    Now, everything in the "textfields" row is the physical HTML
    and PHP code
    that will write and display the article and the comment form.
    It seems that something is getting scrambled, or that I need
    to write the
    PHP code differently inside the table...
    Help?
    Thanks for your time,
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Web Dev Articles, Photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================

    Hi Joe -
    I did cut and paste the code from DW into the table. I just
    finished up,
    actually, with another solution. I entered the code for the
    comment form
    into a .txt file, and used it as a PHP include for the
    articles.
    Also, for the action of the form (since it's the same form
    being used for
    three different pages) - I set a variable when it calls a
    certain Recordset,
    and then did an "if, elseif" statement inside the .txt file
    where it will
    echo out the appropriate page, depending upon which article
    the user is at.
    For example (from my code):
    <form id="contact_form" action="articles.php?ref=<?php
    if($var == 10) { echo
    '10'; } elseif($var == 20) { echo '20'; } elseif($var == 30)
    { echo '30'; }
    ?>" method="post">
    That's was really the only problem I had to overcome because
    I'm using the
    same form for all three articles (assigning the proper
    action).
    Thanks for the help, Joe - though, I'm not sure if your
    suggestion would
    have worked! Maybe I'll try it sometime...
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Web Dev Articles, Photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "Joe Makowiec" <[email protected]> wrote in
    message
    news:[email protected]...
    > On Wed 30 Aug 2006 02:08:30p, Shane H wrote in
    macromedia.dreamweaver:
    >
    >> Thanks for the prompt reply. Is there a way around
    this (e.g., being
    >> able to include the PHP code in the row)?
    >
    > Is the PHP code being pulled in from the database? I'm
    not where I can
    > test it right now, but I believe that it won't be
    executed. The only way
    > would be to have it in the page itself.
    >
    > For example:
    >
    > <input
    > name="namefield"
    > class="contactfield"
    > id="namefield"
    > value="&lt;?php if(isset($_POST['namefield'])) echo
    htmlentities($_POST
    > ['namefield']);?&gt;"
    > tabindex="1"
    > accesskey="1"
    > type="text">
    >
    > You can't have that in the data. You could do this:
    >
    > <input
    > name="namefield"
    > class="contactfield"
    > id="namefield"
    > value="<?php if(isset($_POST['namefield'])) echo
    htmlentities($_POST
    > ['namefield']);?>"
    > tabindex="1"
    > accesskey="1"
    > type="text">
    >
    > Or maybe you cut and pasted code, and got the character
    entities &lt;
    > &gt; rather than <>?

  • CS4 javascript error in recordset.htm

    Hi,
          I'm using Webassist eCart with Dreamweaver CS4. I will be doing digital downloads and when trying to add the proper recordset to the checkout_success.php (which tests fine) I get the following error upon hitting ok,  javascript error in the recordset.htm. I'm told by webassist that this is a bug in CS4. "Quote: The problem is that DW recordset behavior errors when any other server behaviors are on the page that are'nt using the new EDML technique for building server behaviors." Doe's Adobe have a fix for this, or a solution? Thanks in advance for any help.

    I'm using Webassist eCart with Dreamweaver CS4. I will be doing digital downloads and when trying to add the proper recordset to the checkout_success.php (which tests fine) I get the following error upon hitting ok,  javascript error in the recordset.htm. I'm told by webassist that this is a bug in CS4. "Quote: The problem is that DW recordset behavior errors when any other server behaviors are on the page that are'nt using the new EDML technique for building server behaviors." Doe's Adobe have a fix for this, or a solution?
    I am not sure what error you are talking about, but start by clearing out your JavaScript cache in Step 4 of this TechNote:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19105#dat
    If you are still seeing the problem, them specify the exact wording of the error message that you are getting.
    HTH,
    Randy

  • Template Updates wipe out PHP code at top of file

    Hey everybody,
    I'm helping my wife with a web site that needed PHP, and
    since I know Dreamweaver I figured it couldn't be that hard to do.
    And it's not - between the DW application development features and
    a little hacking, it's been going fgreat.
    But the site is based off of a .dwt template, and every time
    she makes a change to the design it wipes out all the connection
    code that dreamweaver writes at the top of the page... arrrgh! I
    tried looking it up on the site, and tried adding a
    codeOutsideHTMLIsLocked="false" tag (I also tried "true") and that
    did not help.
    I never had this problem with Cold Fusion before. There's
    something in the livedocs about "dynamic templates" but that seems
    to imply I'd have to make my own XML definition file for php
    documents, which is pretty stupid, and makes me think it's not
    necessary.
    Anyone ever come up against this before?

    There's more to it than that, right? Let's see it all,
    please. The best
    way would be to upload it and post a link....
    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
    ==================
    "illovich" <[email protected]> wrote in
    message
    news:g1frjf$mi6$[email protected]..
    > Here is is, thanks for taking a look!
    >
    >
    >
    > <?php require_once('Connections/serv.php'); ?>
    > <?php
    > if (!function_exists("GetSQLValueString")) {
    > function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "",
    > $theNotDefinedValue = "")
    > {
    > $theValue = get_magic_quotes_gpc() ?
    stripslashes($theValue) :
    > $theValue;
    >
    > $theValue = function_exists("mysql_real_escape_string")
    > mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    >
    > switch ($theType) {
    > case "text":
    > $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    > break;
    > case "long":
    > case "int":
    > $theValue = ($theValue != "") ? intval($theValue) :
    "NULL";
    > break;
    > case "double":
    > $theValue = ($theValue != "") ? "'" .
    doubleval($theValue) . "'" :
    > "NULL";
    > break;
    > case "date":
    > $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    > break;
    > case "defined":
    > $theValue = ($theValue != "") ? $theDefinedValue :
    > $theNotDefinedValue;
    > break;
    > }
    > return $theValue;
    > }
    > }
    >
    > mysql_select_db($database_serv, $serv);
    > $query_posters = "SELECT * FROM isazPosters ORDER BY
    posterID ASC";
    > $posters = mysql_query($query_posters, $serv) or
    die(mysql_error());
    > $row_posters = mysql_fetch_assoc($posters);
    > $totalRows_posters = mysql_num_rows($posters);
    > ?>
    >

  • Linking to a detail page

    I have the letters A to Z in a master page and would like to
    link to a
    detail page, where all companies are displayed whose names
    begin with A,
    or B depending which letter the user has clicked.
    On the detail page (compdetail.php) I have that code:
    $query_rsCompanies = sprintf("SELECT id, name FROM
    tblcompanies WHERE
    name LIKE %s", GetSQLValueString($colname_rsCompanies . "%",
    "text"));
    But how do I link from the master page to that detail page?
    I have as example for the letter "p" <a
    href="compdetail.php?name=colname">p</a>, but that
    doesn't work - I
    fear, the link is ridiculous, sorry :(
    Could someone point me the right way?
    Thank you
    Leo

    On 13 May 2008 in macromedia.dreamweaver.appdev, Leolux
    wrote:
    > I have the letters A to Z in a master page and would
    like to link to
    > a detail page, where all companies are displayed whose
    names begin
    > with A, or B depending which letter the user has
    clicked.
    >
    > On the detail page (compdetail.php) I have that code:
    > $query_rsCompanies = sprintf("SELECT id, name FROM
    tblcompanies
    > WHERE name LIKE %s",
    GetSQLValueString($colname_rsCompanies . "%",
    > "text"));
    >
    > But how do I link from the master page to that detail
    page?
    > I have as example for the letter "p" <a
    > href="compdetail.php?name=colname">p</a>, but
    that doesn't work - I
    > fear, the link is ridiculous, sorry :(
    >
    > Could someone point me the right way?
    Since you're using PHP, I'll assume MySQL.
    The link winds up looking like:
    <a href="compdetail.php?name=p">p</a>
    Then the SQL winds up looking like:
    SELECT id, name FROM tblcompanies WHERE LEFT(name,1) = asdf
    ORDER BY
    name ASC
    You'll use the Advanced screen in the recordset definition.
    In the
    parameter box, you'll add asdf; default value is A and
    runtime value is
    $_GET['name']
    You can even generate a dataset for the master page with the
    first
    initials of all the companies:
    SELECT DISTINCT LEFT(name) AS initial FROM tblcompanies ORDER
    BY
    initial ASC
    Joe Makowiec
    http://makowiec.net/
    Email:
    http://makowiec.net/contact.php

  • Need help with page navigation

    I've got a database where records are retrieved and displayed in a repeating region.  I've added page navigation to it because I'm getting enough records in the database that scrolling through them all on a single page is getting to be a very big page.  The page navigation works as far as the first page goes.  I get the correct records on the first page based on my selection critiera.  However, when a result set spans multiple pages, when I hit 'next page', instead of going to the second page based on the search critiera, the records displaying on the second page are the records that would be on the section page if I selected every record in the database.
    My search critiera is pretty complex, so I have not found a way to develop it inside of the recordset definition panel in DW, but I have attempted to recreate the page from scratch and I'm getting the same result each time.
    Does anyone have a snippet of code to make the pagination work correctly?
    This is the code that DW put in there:
    maxRows_rs_results = 10;
    $pageNum_rs_results = 0;
    if (isset($_GET['pageNum_rs_results'])) {
      $pageNum_rs_results = $_GET['pageNum_rs_results'];
    $startRow_rs_results = $pageNum_rs_results * $maxRows_rs_results;
    $queryString_rs_results = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_rs_results") == false &&
            stristr($param, "totalRows_rs_results") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_rs_results = "&" . htmlentities(implode("&", $newParams));
    $query_limit_rs_results = sprintf("%s LIMIT %d, %d", $query_rs_results, $startRow_rs_results, $maxRows_rs_results);
    $rs_results = mysql_query($query_limit_rs_results, $dqdb) or die(mysql_error());
    $row_rs_results = mysql_fetch_assoc($rs_results);
    if (isset($_GET['totalRows_rs_results'])) {
      $totalRows_rs_results = $_GET['totalRows_rs_results'];
    } else {
      $all_rs_results = mysql_query($query_rs_results);
      $totalRows_rs_results = mysql_num_rows($all_rs_results);
    $totalPages_rs_results = ceil($totalRows_rs_results/$maxRows_rs_results)-1;
    TIA!

    I've put some echo statements into my code to figure out what it is doing and I can see why I'm getting the results I'm getting, but I don't know how to fix it.
    Here's a description of my site.  A user has a select form where they can select records matching their critiera.  There are over 30 attributes that can be selected.  None of them can be selected and that results in every record in the database being displayed.  Any combination of the attributes can be selected and that results in the set of records that match that criteria.
    There is one caveat.  One of the attributes has multiple possible values.  Any given record will only have one value for that attribute, but the selection critiera may include multiple values of that attribute.  So in the middle of the string of "<value = > and <value = >",  I have  "and (<value = > OR <value = > OR....) and <value=>". You can see the actual select statement I have built in a previous discussion I started.
    I'm not a sophisticated php programmer or DW user for that matter, so I don't know how to build an array to capture my record data and then read the array to display the page.  It would be simpler if the selection critiera wasn't so complex - I have found several snippets of code that work well with simple select statements, but I have not been able to adjust them to work with this kind of selection possibility.
    So what I see happening is that after the first mysql statement correctly retrieves the results set, the code to set the select statement is executed again.  But at this second time through, the $_POST values from my form are no longer set to correctly build the select statement.  I thought I might save the select statement and use some if/else logic to circumvent this, but all variables seem to be getting reset when the logic goes back up to the top of the code.
    I hope I'm describing this clearly enough to generate some helpful responses.
    TIA!

  • Random record selection in Access

    I need to define a record set in ASP / Access consisting of a
    single record from the available records.
    In PHP / MySQL I have used the following and it works fine:
    SELECT *
    FROM photolist
    ORDER BY RAND()
    LIMIT 1
    Can anyone give me a suitable recordset definition to do this
    in access?

    "whatalotofrubbish" <[email protected]>
    wrote in message
    news:gmk6pe$90k$[email protected]..
    >I need to define a record set in ASP / Access consisting
    of a single record
    > from the available records.
    > In PHP / MySQL I have used the following and it works
    fine:
    >
    > SELECT *
    > FROM photolist
    > ORDER BY RAND()
    > LIMIT 1
    >
    > Can anyone give me a suitable recordset definition to do
    this in access?
    >
    Access won't do a "random" command when queried from a web
    page, although it
    can if done so within the actual Access application. ASP
    pages can certainly
    utilize mySQL databases; why not use mySQL as it would be far
    more robust
    and stable than Access would be. If you can't move to mySQL,
    try this
    extension from DMXzone:
    http://www.dmxzone.com/go?3705

  • Limiting search results to show results based off of entry in a catgory.

    I am working of someones previous search query, and now the company wants it to be more limited to what is viewed.  I have multiple users in a database and each user has a state assigned to them. I do not want the user when doing a search, to have the results comeback and show all results for every state. The States are defined in the database category as follows. IL, IA, FL, NV.  There will never be anything in this category but these. Below is the code that I am trying to modify to limit the result to the specific state they are using. This is current page for searching in IA. What do I need to change so it will search all search terms, but limit the results to only show for that state.  Thanks in advance.
    <?php require_once('../Connections/forms.php'); ?>
    <?php include('inc_auth.php') ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $colname_subcat3 = "-1";
    if (isset($_GET['Category'])) {
      $colname_subcat3 = (get_magic_quotes_gpc()) ? $_GET['Category'] : addslashes($_GET['Category']);
    $colname1_subcat3 = "-1";
    if (isset($_GET['SubCat1'])) {
      $colname1_subcat3 = (get_magic_quotes_gpc()) ? $_GET['SubCat1'] : addslashes($_GET['SubCat1']);
    $colname2_subcat3 = "-1";
    if (isset($_GET['SubCat2'])) {
      $colname2_subcat3 = (get_magic_quotes_gpc()) ? $_GET['SubCat2'] : addslashes($_GET['SubCat2']);
    $colname3_subcat3 = "-1";
    if (isset($_GET['SubCat3'])) {
      $colname3_subcat3 = (get_magic_quotes_gpc()) ? $_GET['SubCat3'] : addslashes($_GET['SubCat3']);
    mysql_select_db($database_forms, $forms);
    $query_subcat3 = sprintf("SELECT * FROM `forms` WHERE Category = %s and SubCat1 = %s and SubCat2 = %s and SubCat3 = %s ORDER BY Description ASC", GetSQLValueString($colname_subcat3, "text"),GetSQLValueString($colname1_subcat3, "text"),GetSQLValueString($colname2_subcat3, "text"),GetSQLValueString($colname3_subcat3, "text"));
    $subcat3 = mysql_query($query_subcat3, $forms) or die(mysql_error());
    $row_subcat3 = mysql_fetch_assoc($subcat3);
    $totalRows_subcat3 = mysql_num_rows($subcat3);
    $colname_category = "-1";
    if (isset($_GET['Category'])) {
      $colname_category = (get_magic_quotes_gpc()) ? $_GET['Category'] : addslashes($_GET['Category']);
    mysql_select_db($database_forms, $forms);
    $query_category = sprintf("SELECT * FROM `forms` WHERE Category = %s ", GetSQLValueString($colname_category, "text"));
    $category = mysql_query($query_category, $forms) or die(mysql_error());
    $row_category = mysql_fetch_assoc($category);
    $totalRows_category = mysql_num_rows($category);
    $colname_subcat1 = "-1";
    if (isset($_GET['Category'])) {
      $colname_subcat1 = (get_magic_quotes_gpc()) ? $_GET['Category'] : addslashes($_GET['Category']);
    $colname1_subcat1 = "-1";
    if (isset($_GET['SubCat1'])) {
      $colname1_subcat1 = (get_magic_quotes_gpc()) ? $_GET['SubCat1'] : addslashes($_GET['SubCat1']);
    mysql_select_db($database_forms, $forms);
    $query_subcat1 = sprintf("SELECT * FROM `forms` WHERE Category = %s and SubCat1 = %s ORDER BY Description ASC", GetSQLValueString($colname_subcat1, "text"),GetSQLValueString($colname1_subcat1, "text"));
    $subcat1 = mysql_query($query_subcat1, $forms) or die(mysql_error());
    $row_subcat1 = mysql_fetch_assoc($subcat1);
    $totalRows_subcat1 = mysql_num_rows($subcat1);
    $colname_subcat2 = "-1";
    if (isset($_GET['Category'])) {
      $colname_subcat2 = (get_magic_quotes_gpc()) ? $_GET['Category'] : addslashes($_GET['Category']);
    $colname1_subcat2 = "-1";
    if (isset($_GET['SubCat1'])) {
      $colname1_subcat2 = (get_magic_quotes_gpc()) ? $_GET['SubCat1'] : addslashes($_GET['SubCat1']);
    $colname2_subcat2 = "-1";
    if (isset($_GET['SubCat2'])) {
      $colname2_subcat2 = (get_magic_quotes_gpc()) ? $_GET['SubCat2'] : addslashes($_GET['SubCat2']);
    mysql_select_db($database_forms, $forms);
    $query_subcat2 = sprintf("SELECT * FROM `forms` WHERE Category = %s and SubCat1 = %s and SubCat2 = %s ORDER BY Description ASC", GetSQLValueString($colname_subcat2, "text"),GetSQLValueString($colname1_subcat2, "text"),GetSQLValueString($colname2_subcat2, "text"));
    $subcat2 = mysql_query($query_subcat2, $forms) or die(mysql_error());
    $row_subcat2 = mysql_fetch_assoc($subcat2);
    $totalRows_subcat2 = mysql_num_rows($subcat2);
    $colname_subcat4 = "-1";
    if (isset($_POST['searchbox'])) {
      $colname_subcat4 = (get_magic_quotes_gpc()) ? $_POST['searchbox'] : addslashes($_POST['searchbox']);
    $colname6_subcat4 = "-1";
    if (isset($_POST['searchbox'])) {
      $colname6_subcat4 = (get_magic_quotes_gpc()) ? $_POST['searchbox'] : addslashes($_POST['searchbox']);
    $colname1_subcat4 = "-1";
    if (isset($_POST['searchbox'])) {
      $colname1_subcat4 = (get_magic_quotes_gpc()) ? $_POST['searchbox'] : addslashes($_POST['searchbox']);
    $colname2_subcat4 = "-1";
    if (isset($_POST['searchbox'])) {
      $colname2_subcat4 = (get_magic_quotes_gpc()) ? $_POST['searchbox'] : addslashes($_POST['searchbox']);
    $colname3_subcat4 = "-1";
    if (isset($_POST['searchbox'])) {
      $colname3_subcat4 = (get_magic_quotes_gpc()) ? $_POST['searchbox'] : addslashes($_POST['searchbox']);
    $colname4_subcat4 = "-1";
    if (isset($_POST['searchbox'])) {
      $colname4_subcat4 = (get_magic_quotes_gpc()) ? $_POST['searchbox'] : addslashes($_POST['searchbox']);
    $colname5_subcat4 = "-1";
    if (isset($_POST['searchbox'])) {
      $colname5_subcat4 = (get_magic_quotes_gpc()) ? $_POST['searchbox'] : addslashes($_POST['searchbox']);
    mysql_select_db($database_forms, $forms);
    $query_subcat4 = sprintf("SELECT * FROM `forms` WHERE Title LIKE CONCAT('%%', %s, '%%') or Description LIKE CONCAT('%%', %s, '%%') or Category LIKE CONCAT('%%', %s, '%%') or SubCat1 LIKE CONCAT('%%', %s, '%%') or SubCat2 LIKE CONCAT('%%', %s, '%%') or SubCat3 LIKE CONCAT('%%', %s, '%%') or Keywords LIKE CONCAT('%%', %s, '%%') ORDER BY Description ASC", GetSQLValueString($colname_subcat4, "text"),GetSQLValueString($colname1_subcat4, "text"),GetSQLValueString($colname2_subcat4, "text"),GetSQLValueString($colname3_subcat4, "text"),GetSQLValueString($colname4_subcat4, "text"),GetSQLValueString($colname5_subcat4, "text"),GetSQLValueString($colname6_subcat4, "text"));
    $subcat4 = mysql_query($query_subcat4, $forms) or die(mysql_error());
    $row_subcat4 = mysql_fetch_assoc($subcat4);
    $totalRows_subcat4 = mysql_num_rows($subcat4);
    // date format function
    function makeStamp($theString) {
      if (ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})", $theString, $strReg)) {
        $theStamp = mktime($strReg[4],$strReg[5],$strReg[6],$strReg[2],$strReg[3],$strReg[1]);
      } else if (ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $theString, $strReg)) {
        $theStamp = mktime(0,0,0,$strReg[2],$strReg[3],$strReg[1]);
      } else if (ereg("([0-9]{2}):([0-9]{2}):([0-9]{2})", $theString, $strReg)) {
        $theStamp = mktime($strReg[1],$strReg[2],$strReg[3],0,0,0);
      return $theStamp;
    function makeDateTime($theString, $theFormat) {
      $theDate=date($theFormat, makeStamp($theString));
      return $theDate;
    // end date format function
    ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <?php include('inc_titleia.php') ?>
    <link href="styles.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <div id="banneria"></div>
    <div id="container">
        <div id="left">
    <?php include('inc_formselectoria.php') ?>
        </div> <!-- end left -->
        <div id="right">
    <?php if ($totalRows_subcat4 == 0) { // Show if recordset empty ?>
      <p class="largebold">Sorry.Not found.</p>
    <?php } // Show if recordset empty ?>
    <?php if ($totalRows_subcat4 > 0) { // Show if recordset not empty ?>
      <p class="largebold"></p>
          <?php do { ?>
    <a href="../members/uploads/<?php echo $row_subcat4['File']; ?>">        <div id="subleft">Download <br>
      <br>
    </div>
                <div id="subcenter"><?php echo $row_subcat4['Title']; ?><br>
                  <?php echo $row_subcat4['Description']; ?></div>
                <div id="subright">Updated <?php echo makeDateTime($row_subcat4['Date'], 'm/d/Y'); ?></div>        </a>    <div id="clear">        </div>
            <hr><?php } while ($row_subcat4 = mysql_fetch_assoc($subcat4)); ?>
      <?php } // Show if recordset not empty ?>
          </div><!-- end right -->
      <div id="clear">        </div>
    </div><!-- end container -->
    </body>
    </html>
    <?php
    mysql_free_result($subcat3);
    mysql_free_result($category);
    mysql_free_result($subcat1);
    mysql_free_result($subcat2);
    mysql_free_result($subcat4);
    ?>

    >The search box being used allows the users to enter any phrase and the
    >search script searches against all these tables for keywords, form numbers, names, etc
    Does the form have a single search field?
    >My problem is. Lets say I am logged in using the state IA...
    Assuming that the 'form' table has a state field, you just need to include that in the WHERE clause. You can either get that when you log in, by retrieving it from the user table, or, by joining the two tables together in the query. The latter assumes that there is a relationship between user and form.
    But again, I suggest as a first step to clean up the mess that you already have. The person that created this did not understand what they were doing.

  • Trying to pass array to stored procedure in a loop using bind variable

    All,
    I'm having trouble figuring out if I can do the following:
    I have a stored procedure as follows:
    create procedure enque_f826_utility_q (inpayload IN f826_utility_payload, msgid out RAW) is
    enqopt dbms_aq.enqueue_options_t;
    mprop dbms_aq.message_properties_t;
    begin
    dbms_aq.enqueue(queue_name=>'f826_utility_queue',
    enqueue_options=>enqopt,
    message_properties=>mprop,
    payload=>inpayload,
    msgid=>msgid);
    end;
    The above compiles cleanly.
    The first parameter "inpayload" a database type something like the following:
    create or replace type f826_utility_payload as object
    2 (
    3 YEAR NUMBER(4,0),
    4 MONTH NUMBER(2,0),
    83 MUSTHAVE CHAR(1)
    84 );
    I'd like to call the stored procedure enque_f826_utility_q in a loop passing to it
    each time, new values in the inpayload parameter.
    My questions are:
    First, I'm not sure in php, how to construct the first parameter which is a database type.
    Can I just make an associative array variable with the keys of the array the same as the columns of the database type shown above and then pass that array to the stored procedure?
    Second, is it possible to parse a statement that calls the enque_f826_utility_q procedure using bind variables and then execute the call to the stored procedure in a loop passing new bind variables each time?
    I've tried something like the following but it's not working:
    $conn = oci_pconnect (....);
    $stmt = "select * from f826_utility";
    $stid = oci_parse($conn, $sqlstmt);
    $r = oci_execute($stid, OCI_DEFAULT);
    $row = array();
    $msgid = "";
    $enqstmt = "call enque_f826_utility_q(:RID,:MID)";
    $enqstid = oci_parse($conn, $sqlstmt);
    oci_bind_by_name($enqstid, ":RID", $row); /* line 57 */
    oci_bind_by_name($enqstid, ":MID", $msgid);
    while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC))
    ++$rowcnt;
    if (! oci_execute($enqstid)) /* line 65 */
    echo "Error";
    exit;
    When I run this, I get the following:
    PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
    ine 57
    Entering loop to process records from F826_UTIITY table
    PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
    ine 65
    PHP Warning: oci_execute(): ORA-06553: PLS-306: wrong number or types of argume
    nts in call to 'ENQUE_F826_UTILITY_Q' in C:\Temp\enqueue_f826_utility.php on lin
    e 65
    PHP Notice: Undefined variable: msgnum in C:\Temp\enqueue_f826_utility.php on l
    ine 68
    Error during oci_execute of statement select * from F826_UTILITY
    Exiting!

    Thanks for the reply.
    I took a look at this article. What it appears to describe is
    a calling a stored procedure that takes a collection type which is an array.
    Does anyone from Oracle know if I can pass other database type definitions to a stored procedure from PHP?
    I have a type defined in my database similar to the following which is not
    an array but a record of various fields. This type corresponds to a payload
    of an advanced queue payload type. I have a stored procedure which will take as it's input, a payload type of this structure and then enqueue it to a queue.
    So I want to be able to pass a database type similar to the following type definition from within PHP. Can anyone from Oracle verify whether or not this is possible?
    create or replace type f826_utility_payload as object
    YEAR NUMBER(4,0),
    MONTH NUMBER(2,0),
    UTILITY_ID NUMBER(10,0),
    SUBMIT_FAIL_BY VARCHAR2(30),
    MUSTHAVE CHAR(1)
    );

Maybe you are looking for