From owner-freebsd-questions Wed Jan 15 23:55:47 2003 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 01FB837B401 for ; Wed, 15 Jan 2003 23:55:46 -0800 (PST) Received: from cwe.compwest.com.au (compwest.com.au [202.72.147.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83A4743F18 for ; Wed, 15 Jan 2003 23:55:44 -0800 (PST) (envelope-from paul@compwest.com.au) Received: from wks (ant.parkview.compwest.com.au [202.72.147.43]) by cwe.compwest.com.au (8.11.6/8.11.6) with SMTP id h0G7tdr23852 for ; Thu, 16 Jan 2003 15:55:39 +0800 (WST) (envelope-from paul@compwest.com.au) From: "Paul Hamilton" To: Subject: How can data be inserted into a MySQL DB using C code? Date: Thu, 16 Jan 2003 15:56:48 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 In-Reply-To: <20030115112042.GA26041@gothmog.gr> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi All, Step one was collecting the data, Step two is to somehow get the info into a MySQL DB. I am monitoring a serial port's CTS line, and need to get the fact that it's changed state logged into the DB. I can use C and/or PHP. Perl is beyond me :-( (I have trouble enough just trying to add Perl modules). The C program runs continuously, monitoring the CTS bit, so I thought it would be nice to dump the info straight into the MySQL DB. As a backup, I suppose, I could dump the 'date/time' and 'CTS-Open-Closed' into a text file, then once a day, run a PHP script to import the files contents into the MySQL DB. However, that means I wouldn't get any live data. I know there is the MySQL++ project, but I had problems trying to get that to function, and my C++ knowledge is negligible. Any help, or tips would be grateful. Cheers, Paul Hamilton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message