#16
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    typo?


    In reference to http://www.devshed.com/Server_Side/PHP/Class/page4.html

    toward the end of Example 8 and at the begining of the while loop declaration..

    <!-- Code -->
    <p><pre><font color=#000000><xmp>
    <?php while($db-<next_record()): ?>
    </xmp></font></pre><p>
    <!-- Code -->

    shouldn't that be (-> instead of -<):

    <!-- Code -->
    <p><pre><font color=#000000><xmp>
    <?php while($db->next_record()): ?>
    </xmp></font></pre><p>
    <!-- Code -->
  2. #17
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Fixed


    Thanks for the notice.

    That error has been fixed.
  4. #18
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Limiting the amount of records


    maybe you use a wrong syntax. try
    <br>
    select ... LIMIT $start, $rows
    <br>
    <br>
    where $rows is the amount of rows you want to get after startingpoint $start.
    <br>
    <br>
    i use it and it works.
    <br>
    good luck
  6. #19
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: shed


    Hell no! This can't be true! :^)
    <br>
    <br>
    This aint no steenkin Ebay or something!
  8. #20
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    run this sample


    I think this article is very useful for my work.

    I tried to run with

    <!-- Code -->
    <p><pre><font color=#000000><xmp>
    <?php
    require("db_sql.inc");
    require("db_bdgeo.inc");
    $db = new DB_BDGEO;
    $db->connect();
    ?>
    </xmp></font></pre><p>
    <!-- Code -->

    but the server not translate the commands in the include files.

    In the browser I see:

    <!-- Code -->
    <p><pre><font color=#000000><xmp>
    class DB_Sql { // Definicion de Clase para conexion var $Host = "";
    // Hostname of our MySQL server. var $Database = "";
    // Logical database name on that server. var $User = "";
    // User und Password for login. var $Password = "";
    var $Link_ID = 0;
    // Result of mysql_connect().
    var $Query_ID = 0;
    // Result of most recent mysql_query().
    var $Record = array();
    // current mysql_fetch_array()-result.
    var $Row; // current row number.
    var $Errno = 0;
    // error state of query...
    var $Error = "";
    // insert functions here.
    function halt($msg) {
    printf("Database error: %s\n", $msg);
    printf("SQL Error: %s (%s)\n", $this->Errno, $this->Error);
    die("Session halted.");
    }
    function connect() { if ( 0 == $this->Link_ID ) {
    $this->Link_ID=mysql_connect($this->Host, $this->User, $this->Password);
    if (!$this->Link_ID) {
    $this->halt("Link-ID == false, connect failed"); }
    if (!mysql_query(sprintf("use %s",$this->Database),$this->Link_ID)) {
    $this->halt("cannot use database ".$this->Database);
    }
    }
    }
    }
    class DB_BDGEO extends DB_Sql { // Definicion de Clase para conexion
    var $Host = "localhost"; // Hostname of our MySQL server.
    var $Database = "bdgeo"; // Logical database name on that server.
    var $User = "bdgeo"; // User und Password for login.
    var $Password = "ubdgeo";
    }
    </xmp></font></pre><p>
    <!-- Code -->

    Fatal error: DB_BDGEO is not a class in /disk2/bdgeo/php3/index.php3 on line 4


    I need the server interprets the class definition and not display the statments in the browser?

    Can somebody tell me, how to obtain this?
    What I need to do?
    Also I like install the PHPLIB for sybase conection, żI Need compile the module?, How?
    or only use the include apropiate?

    Thank You

    Luis A. Gonzalez

    PS : I have installed apache_1.3.4
    and php-3.0.11
  10. #21
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: run this sample


    Please remember that include files are
    <br>
    being read in HTML mode, so that you have
    <br>
    to switch to PHP again, even if require()
    <br>
    and include() are PHP commands.
    <br>
    <br>
    Also, PHP is an interpreted language, there
    <br>
    is no need to compile.
    <br>
  12. #22
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    errors


    How does $errno and $error in class db_sql get assigned values in function halt
  14. #23
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    accessing oracle database?


    HI,

    i hav encountered a prob with accessing the oracle database, ora_open() function cant seem to work, i keep gettin the error of

    (Fatal error: Call to unsupported or undefined function ora_logon() in /usr/local/apache/htdocs/test.php3 on line 6)

    Can somebody help? Thanks!


  16. #24
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Would we still need to call mysql_close()?


    Hi all,

    Then how would u close persistent links...
    Or is it closed when the server times out after the user's request.


    Thanks in advance,
    ed
  18. #25
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Please, help! (a bit offtopic)


    Hello,
    I've got a question abt PHP3 upload...
    My HTML form works correct (data fields are added to PGSQL DB), and the browser sends the attached file, BUT: the temporary file shown as something like /tmp/upload/phpFGreHJ does NOT exist! I'm running PHP3, Apache1.3 on RedHat 5.2.2.
    If anyone knows - please email me: mailto:thistle@ok.ru
    And that's that. Thank you a priori!
    =Ilia=
  20. #26
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Please, help! (a bit offtopic)


    <P>Are you trying to upload the data directly into the DB or into a directory?</P>

    <P>If you're uploading into a directory this is what I use:</P>


    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    $attach_name=strtolower($attach_name);
    copy($attach, "../attach/$attach_name");
    chmod( "../attach/$attach_name", 0777 );
    unlink($attach);
    </xmp></font></pre><p>
    <!-- Code -->


    <P>Remember that while the file itself is, in this case $attach, the file name is referenced as $attach_name</P>

    <P>Hope this helps if it makes any sense to you :)</P>

    <P>Stephen</P>
  22. #27
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Thank you, Stephen


    Hello Stephen,
    Thank you it helped!
    Good Luck!
    =Thistle=
  24. #28
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: accessing oracle database?


    Hi,
    You have not compiled php with oracle , just compile php with oracle support.
    priyal
  26. #29
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Would class make the code slow?


    hi all,
    <br>
    <br>
    just wondering, would writing PHP with classes make it slower than straight PHP?
    <br>
    <br>
    thx
    <br>
    <br>
    herbert
  28. #30
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    complex objects


    i am having difficulties in adding an object to an array of objects and then viewing the value of a property. At first it works but then it doesn\'t. these first four lines create, add, set and get work but when I continue thru the following loop the first 6 iterations (there are already 6 objects in this array) go fine but the final iteration (the newly added object) I get a Call to a member function on a non-object

    $ppm = new providerPayment ;

    $ppm = $business_entity->provider_payment_list->childAdd($pm_id) ;

    $business_entity->provider_payment_list->active_list[$c]->setPaymentTypeOID($pm_id);

    $f=$business_entity->provider_payment_list->active_list[$c]->getPaymentTypeOID();

    /* for loop */

    for ($y = 0; $y < count($business_entity->provider_payment_list->active_list); $y++)

    {
    $z = $business_entity->provider_payment_list->active_list[$y]->getPaymentTypeOID();

    }

IMN logo majestic logo threadwatch logo seochat tools logo