| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
|
On 14 Jun 2007, at 07:14, Håvard Graudo wrote:
Hmmmm... You could use PHP from the command line, couldn't you? Here's an extremely basic bit of PHP I use to return a list of user names from one of my mySQL databases (early days for me with both PHP and mySQL so experts will probably scream in horror at this - it does the job I want it to though!). I save the following in a file called userlist.php #!/bin/php <?php $con = mysql_connect("myipddress","myusername","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } // choose the database to use mysql_select_db("mydatabasename", $con); $theQueryResults=mysql_query("select * from users"); while($theRow = mysql_fetch_array($theQueryResults)) { echo $theRow['forename'] . " " . $theRow['surname'] . "\n"; } mysql_close($con); ?> ...and run it from the command line with; php userlist.php ...like I said, there are probably more elegant solutions, but that does the job for me. Hope that's of some help and I look forward to others' suggestions. Rob Important: This message is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination or copying of the communication is strictly prohibited. If you have received this communication in error, please notify the writer immediately by telephone and return the original message via postal service to the writer's attention at the above address. Thank you. Watt Gilchrist Limited. Albion Mills, Albion Road. Bradford, BD10 9TQ Registered in England 873405 |
_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
| References: | |
| >talking to external MySQL servers (From: Håvard Graudo <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.