[PHP] sorting via PHP or MySQL?

2007-05-10 Thread James Tu
(I've cross posted at the MySQL list as well) Here's an example with a simple table: describe collection; +--+-+--+- +-++ | Field| Type| Null | Key | Default | Extra

Re: [PHP] finding a particular record within a MySQL result set

2007-04-04 Thread James Tu
I've looked at those, but both approaches requires traversing through the entire mysql result set to create another array ( could be memory intensive if the result set is large...100,000 ? ) -James On Apr 4, 2007, at 1:39 PM, Jim Moseby wrote: You will probably get a better approach from

[PHP] finding a particular record within a MySQL result set

2007-04-04 Thread James Tu
I've cross posted this to the MySQL list... Here's my original post. Is there some quick way to do the following in MySQL? (I know I can use PHP to search through the result set, but I wanted to see if there's a quick way using some sort of query) Let's say I know that Joe is from Maine.

[PHP] reversing utf-8 string

2007-02-21 Thread James Tu
There doesn't seem to be a multibyte equivalent of strrev(). Is there an easy way to reverse the order of "characters" in a string w/o traversing the "characters" backwards and creating a new string by concatenating the "characters"? -James -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] backing up a database

2006-11-28 Thread James Tu
Thanks Brad: I'm just surprised that when people mention mysqldump, most of the time they don't talk about locking the tables at all. I'm curious why this is the case. -James Does one need to lock(?) MySQL before running mysqldump? Or will the mysqldump command wait for any pending operat

Re: [PHP] backing up a database

2006-11-28 Thread James Tu
Does one need to lock(?) MySQL before running mysqldump? Or will the mysqldump command wait for any pending operations to finish, lock the tables for dumping and once finished release the lock? -James On Nov 27, 2006, at 2:21 AM, David Robley wrote: Sumeet wrote: Brad Fuller wrote: $com

Re: [PHP] Looping through array

2006-11-16 Thread James Tu
$arr = array(...); $first_row = ''; $second_row = ''; for ($i=4; $i>=0; $i--){ $first_row = $first_row . "{$arr[$x]}"; $second_row = $second_row . "{$arr[$x + 5]}"; } print '' . $first_row . '/'; print '' . $second_row . '/'; On Nov 16, 2006, at 3:19 PM, Ashley M. Kirchner wrote

Re: [PHP] php cli and mysql

2006-11-14 Thread James Tu
Thanks everyone! On Nov 14, 2006, at 3:20 PM, [EMAIL PROTECTED] wrote: You could make a new php.ini for flexibility like Jochem stated. To make things easy, just copy the file over: cp /usr/local/php5/lib/php.ini /etc/php.ini And that should do it. James Tu wrote: Please see below On

Re: [PHP] php cli and mysql

2006-11-14 Thread James Tu
for the CLI version. Enjoy. James Tu wrote: ok. so the location of mysql.sock is a problem. I found it at /tmp/mysql.sock Why is the CLI looking for it at /var/myslq/mysql.sock? Now the question is... Do I change the mysql settings so that mysql.sock is at /tmp/mysql.sock? (If I do, will the

Re: [PHP] php cli and mysql

2006-11-14 Thread James Tu
Do I change where the CLI is looking for mysql.sock? -James On Nov 14, 2006, at 1:17 PM, cajbecu wrote: touch /var/mysql/mysql.sock chmod 777 /var/mysql/mysql.sock On 11/14/06, James Tu <[EMAIL PROTECTED]> wrote: I'm running a php script from the command line (I'm on OS X)

[PHP] php cli and mysql

2006-11-14 Thread James Tu
I'm running a php script from the command line (I'm on OS X) and I'm getting ... Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) Here's the script (this just tests a connection and a query...the actual script imports data from text

Re: [PHP] php.ini and .htaccess not working for php parameters

2006-11-08 Thread James Tu
en I started to comment out stuff in my .htaccess and it turns out that the culprit for now displaying errors was: php_value error_reporting E_ALL When I commented that out, PHP reported the errors. ugh! Can I set that parameter in .htaccess? -James On Nov 8, 2006, at 5:14 PM, James Tu wrote: I

[PHP] php.ini and .htaccess not working for php parameters

2006-11-08 Thread James Tu
I've setup a few directories under my dev server's webroot...one for each project. Under each project directory, I put php.ini files to set parameters such as include_path. For some reason they are not taking effect. Do I have to enable them somehow? phpinfo() tells me that Server API is Apa

Re: [PHP] list of countries

2006-11-07 Thread James Tu
://dev.mysql.com/doc/world-setup/en/world-setup.html where as people on this are less likely to. On 11/7/06, James Tu <[EMAIL PROTECTED]> wrote: Does anyone have a list of countries in a handy format for importing into MySQL? I just really need a list. Wikipedia has a nice list, but it's

Re: [PHP] list of countries

2006-11-07 Thread James Tu
Thanks everyone for the helpful links and suggestions! Any people here with access to a country list in Arabic or Chinese? -James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] list of countries

2006-11-07 Thread James Tu
Does anyone have a list of countries in a handy format for importing into MySQL? I just really need a list. Wikipedia has a nice list, but it's muddled by HTML tags. If you also have them in Chinese and Arabic that would be even better. -James -- PHP General Mailing List (http://www.php.n

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread James Tu
I've never tried this myself, but how about having the cron job kick off a script which will run script A and script B Script A runs right away, and script B runs after a delay of 30 seconds ( usleep(30* 100) )? -James On Oct 30, 2006, at 12:29 PM, Ahmad Al-Twaijiry wrote: Hi everyone,

Re: [PHP] Re: Most stable combination of AMP?

2006-09-20 Thread James Tu
I was thinking more along the lines of what version of Apache, MySQL and PHP I should install... -James On Sep 20, 2006, at 12:06 PM, Pawel Miroslawski wrote: On 9/20/06, Kae Verens <[EMAIL PROTECTED]> wrote: James Tu wrote: > Hi: > > I'm trying to setup a dev envi

[PHP] Most stable combination of AMP?

2006-09-20 Thread James Tu
Hi: I'm trying to setup a dev environment using Apache, MySQL and PHP...to develop an application that will go to production. What is the most stable versions of the AMP components should I can install? The production environment will most likely live on a Linux machine. My dev environme

[PHP] are these db stats normal?

2006-01-03 Thread James Tu
I used phpMyAdmin to look at the stats for this mysql server. http://www.2-bit-toys.com/db_info/server_status.html What concerns me mainly are the stats at the top-right...'Failed attempts' and 'Aborted.' When would these situations occur? Is it normal to see these? I'm using PHP's mysql_pc

[PHP] PHP inside .htacess protected file

2005-04-05 Thread james tu
I have this dilemma...I know this is more of an apache question than a PHP questions, but I thought that it's partially related. We have a webserver that we want to turn on/off access. We were thinking of using simple HTTP authentication to protect the main webserver directory. We have Flash mo

[PHP] POST variables from a link...and popup new window

2005-03-29 Thread james tu
Hi: I have a link that, when clicked on, pops up a new window. I want to use the POST method in order to pass information. Right now I'm appending the parameters to the URL of the link and using GET to retrieve the name/value pairs. Is there a way to do this? -- -James -- PHP General Mailing Lis

[PHP] PHP MYSQL table locking

2005-03-24 Thread james tu
, but I'm curious if there is anything I can do to mitigate this situation. -- -James Tu --- ESI Design 111 Fifth Avenue 12th floor New York, NY 10003 (212) 989-3993 ext. 357 (212) 673-4061 (fax) --- -- PHP General Mailing List