RE: [PHP] searching multiple fields

2005-07-15 Thread yanghshiqi
Yes, hope you are using the MyISAM, full-text index is much better than 'LIKE'. If you use the way like 'name like '$name%' or org like '$name'', it will cost lots of your time... Best regards, Shiqi Yang -Original Message- From: Amir Mohammad Saied [mailto:[EMAIL PROTECTED] Sent:

RE: [PHP] cannot connect to MySQL server and not sure why

2005-07-14 Thread yanghshiqi
Make sure that your ip is granted too. Best regards, Shiqi Yang -Original Message- From: Bruce Gilbert [mailto:[EMAIL PROTECTED] Sent: Thursday, July 14, 2005 11:27 PM To: php-general@lists.php.net Subject: [PHP] cannot connect to MySQL server and not sure why I am having trouble

RE: [PHP] Re: Echo array string index?

2005-07-14 Thread yanghshiqi
Yeah, you can use foreach. But *may be* you just find sth called array_keys(). Best regards, Shiqi Yang -Original Message- From: Joe Harman [mailto:[EMAIL PROTECTED] Sent: Thursday, July 14, 2005 4:45 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: Echo array string index?

RE: [PHP] Arrays

2005-07-12 Thread yanghshiqi
I guess your purpose is to just save the row data from the mysql to the array each unit. So may be the result that you expected is sth like: $product[0] = 1; $product[1] = 2; $product[2] = 3; .. If you just loop for each new value in the loop and to destroy the array, you second example is okey.

RE: [PHP] back slashes

2005-07-12 Thread yanghshiqi
Yeah, mysql_escape_string() will help you. Best regards, Shiqi Yang -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, July 11, 2005 9:42 AM To: Daniel Baughman Cc: php-general@lists.php.net Subject: RE: [PHP] back slashes On Fri, July 8, 2005 12:48

RE: [PHP] how to get time cost for MySQL query

2005-07-12 Thread yanghshiqi
Yes, mysql will cache your same query every time. So what you need is to just test the microtime before and after your query script. If you just want to know how about the efficiency about your sql script, you can use the mysql_command line and explain it. Otherwise, I think trying to catch the

RE: [PHP] How to read PHP variables.

2005-07-12 Thread yanghshiqi
Firstly, I don't know why you want to change your configuration in real time? Then if you just keep your configuration in an array, then when you want to change and use it in your script, you can just $vars['varname'] = sth else. So pls give us more detail. Best regards, Shiqi Yang

RE: [PHP] Number of users

2005-07-12 Thread yanghshiqi
The current users' num is actually not exactly and it's just an estimated one. You can save your users' data in an array, and every time receive a request from a browser you should modify your array and then you can get how many users are online. And also there need another function to clean up

RE: [PHP] Plz, help

2005-07-12 Thread yanghshiqi
You can use select u.a as u.a, v.a as v.a .. Best regards, Shiqi Yang -Original Message- From: adolfas [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 12, 2005 2:42 PM To: php-general@lists.php.net Subject: [PHP] Plz, help Hi, I have a line: $sql=select u.*, p.name_lt as pareiga

RE: [PHP] alternative to empty

2005-07-07 Thread yanghshiqi
May be you can try (string)$string or (int)$string (seemed a little strange). Any way Ross, we need to see ur code to determine your problem. Best regards, Shiqi Yang -Original Message- From: Philip Hallstrom [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 12:15 AM To: Dan

RE: [PHP] foreach in php4

2005-07-05 Thread yanghshiqi
Try this: function mul($value){ $value = $value * 2; } $arr = array(a = 1, b = 2, c = 3, d = 4); array_walk($arr, 'mul'); var_dump($arr); Best regards, Shiqi Yang -Original Message- From: Dotan Cohen [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 05, 2005 1:40 PM To: PHP