From owner-freebsd-questions@FreeBSD.ORG Thu Feb 23 21:02:36 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55D4916A420 for ; Thu, 23 Feb 2006 21:02:36 +0000 (GMT) (envelope-from duane@greenmeadow.ca) Received: from smtpout.eastlink.ca (smtpout.eastlink.ca [24.222.0.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F4CE43D4C for ; Thu, 23 Feb 2006 21:02:35 +0000 (GMT) (envelope-from duane@greenmeadow.ca) Received: from ip03.eastlink.ca ([24.222.10.15]) by mta01.eastlink.ca (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0IV5002C4RQ52LD1@mta01.eastlink.ca> for freebsd-questions@freebsd.org; Thu, 23 Feb 2006 17:01:17 -0400 (AST) Received: from blk-224-199-230.eastlink.ca (HELO [192.168.0.103]) ([24.224.199.230]) by ip03.eastlink.ca with ESMTP; Thu, 23 Feb 2006 17:02:17 -0400 Date: Thu, 23 Feb 2006 17:01:54 -0400 From: Duane Whitty In-reply-to: <50888.207.70.139.52.1140669118.squirrel@www.compedgeracing.com> To: FreeBSD Questions Message-id: <43FE22C2.4000307@greenmeadow.ca> MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_SE6Zgks3qNORMkf/rm7mOQ)" X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAQAAA+k= References: <50888.207.70.139.52.1140669118.squirrel@www.compedgeracing.com> User-Agent: Thunderbird 1.5 (X11/20060205) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: fbsd_user@a1poweruser.com Subject: Re: Looking for a mentor on php/mysql X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2006 21:02:36 -0000 This is a multi-part message in MIME format. --Boundary_(ID_SE6Zgks3qNORMkf/rm7mOQ) Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT Robert Uzzi wrote: >> I am trying to teach my self php/mysql/html programming. >> I have done native static html web sites before. >> Running FreeBSD 6.0 with apache13, php, and mysql all installed and >> working. >> >> Have read a few php books and searched the web for code snippets. >> Have been on some of the php forum sites, but responses are not forth >> coming. >> >> Looking for a mentor to guide me with puting all the pieces together. >> I have a working panel for registering a user that writes to a flat >> text file. >> Need guidance in changing this to use mysql. Would email you direct >> outside of the questions list. >> >> >> > > While I don't consider myself knowledgable enough to help you with php I > have found this site helpful when I am looking for code ideas. > http://www.tutorialized.com/tutorials/PHP/1 > > Hi, I'm not experienced enough in PHP to be a mentor in it but from one beginner to another maybe this will be useful. Here is a link to a resource I used to get myself up-and-running with PHP. http://www.hudzilla.org/phpbook/index.php I wrote the attached code when I playing around with the example from the MySQL manual. It's just play code bu maybe it can point you to the name of functions (methods) to investigate. Hth, --Duane --Boundary_(ID_SE6Zgks3qNORMkf/rm7mOQ) Content-transfer-encoding: 7BIT Content-disposition: inline; filename=database.php MIME-Version: 1.0 Content-Type: text/plain; name="database.php" Accessing a MySQL Database Using PHP Starting PHP script '; ?> host_info); echo ' '; printf("Server info: %s\n", $mysqli->server_info); echo ' '; $query = "SELECT CURRENT_USER();"; $query .= "SELECT name FROM pet"; /* execute multi query */ if ($mysqli->multi_query($query)) { do { /* store first result set */ if ($result = $mysqli->store_result()) { while ($row = $result->fetch_row()) { printf("%s ", $row[0]); } $result->close(); } /* print divider */ if ($mysqli->more_results()) { printf("----------------- "); } } while ($mysqli->next_result()); } /* close connection */ $mysqli->close(); ?> --Boundary_(ID_SE6Zgks3qNORMkf/rm7mOQ)--