SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: mySQL class

  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am looking for a mySQL class to use with scripts to make doing sql a bit less time consuming, especially important is the automatic return of error messages if there is a problem with a query.

    Has anyone got any suggestions?

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHPLIB

    http://phplib.netuse.de

    Don't be overwhelmed by it, just grab the file called db_mysql.inc from the distro. Copy it to your folder where you want to use, eidt it and put your host info in and include it into your script like this

    PHP Code:
    include("db_mysql.inc");
    $db = new DB_Sql;
    $db->query("SELECT * from table_name");
    while(
    $db->next_record()) {
    print 
    $db->f(fieldname)."<br>";

    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you. A guess i have a bit of learning to do here....

    of to try and find a script that uses the module.

    is this a "standard" in mysql classes or a personal choice sort of thing?

    thanks.

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is a fairly standard library, in fact the whole PEAR db class is based on phplib. Instead of trying to find a script that uses it, I would suggest just looking at the class and use my example and just write some basic scripts, ones that show data from a table.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, been working through it very useful.

    One thing, not sure if you know the answer to this, i am planning on build a commerical script and might want to use this but the license had my head going round in circles. I want to be able to include the class in my script and of course anyone could use the class and re-distribute but not re-distribute the source code to my program. I think the license allows this but i am really not sure. If you know i would be grateful for a reassurance, or not as the case maybe.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •