[PHP] usort inside a class

2008-05-09 Thread It Maq
Hi, i'm trying to build a class that sorts a multidimensional array. I'm using the php function usort. I declared the comparision function as a method of my class but i'm unable to give it as argument to the function usort. this usort($this-arr, $this-cmpi) gaves the following error: usort()

[PHP] adding the results of mysql_query

2008-05-06 Thread It Maq
Hi, I need to add the result of 4 calls to mysql_query (4 different queries) to the same object so that i can mysql_fetch_object in the same loop. Is that possible? otherwise is there any other alternative? Thank you

[PHP] XHTML Validation problem

2008-05-02 Thread It Maq
Hi, I have a page that displays data entered by the user. There is one user that entered the character inside the text he typed. For this case the xhtml validation fails and gives me the following error: character is the first character of a delimiter but occurred as data. I'm wondering if

[PHP] How to write simpleXML object to a file

2008-04-04 Thread It Maq
Hi, I am reading an xml file. After that i modify one node. IN the xml object that i'm handling it is modified but not in the original file. Can you tell me how i can make the modification to an xml file or how to write an xml object to a file? Thank you

[PHP] convert associative array to ordinary array

2008-03-28 Thread It Maq
Hi, i have an associative array and i want to use it as an ordinary array, is that possible? what i mean is instead of $arr['fruit'] i want to call it by its position in the array $arr[3] thanks

Re: [PHP] convert associative array to ordinary array

2008-03-28 Thread It Maq
thank you, it works! --- Casey [EMAIL PROTECTED] wrote: On Fri, Mar 28, 2008 at 10:33 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Fri, Mar 28, 2008 at 2:27 PM, It Maq [EMAIL PROTECTED] wrote: Hi, i have an associative array and i want to use it as an ordinary array

[PHP] algorithm of pages beaking

2008-03-19 Thread It Maq
Hi, I am working in page breaking (dividing the result of a select query in multiple pages). Now my problem is not with the php code, but with the algorithm that organize the links to the pages. I want to do something like google, the pages numbers at the bottom of the page must not exceed a

Re: [PHP] Fastest way to get table records' number

2008-03-19 Thread It Maq
Hi, did you try mysql_num_rows ? --- Andrew Ballard [EMAIL PROTECTED] wrote: On Wed, Mar 19, 2008 at 1:04 PM, TG [EMAIL PROTECTED] wrote: It seems that count(*) pulls all the data from the row then performs a count increment whereas count(did) only pulls the 'did' column. Again,

Re: [PHP] How to get error context

2008-03-14 Thread It Maq
('error_handler'); mysql_connect(localhost, admin, admin); mysql_select_db(wrongdb) or trigger_error(wrong database); ? --- Jim Lucas [EMAIL PROTECTED] wrote: It Maq wrote: Hi, i need help because I'm unable to retrieve error's context. Below is the code that is working perfectly except

Re: [PHP] How to get error context

2008-03-14 Thread It Maq
throwing do you mean that i can catch the error without throwing it myself? --- Zoltán Németh [EMAIL PROTECTED] wrote: 2008. 03. 14, péntek keltezéssel 07.20-kor It Maq ezt írta: So i'm wondering if there are some rules that can help me know if an error will be reported automatically

Re: [PHP] How to get error context

2008-03-14 Thread It Maq
It Maq ezt írta: For example mysql_connect reprted automatically the error but in the manual http://us3.php.net/manual/en/function.mysql-connect.php all they give as information is the return: Returns a MySQL link identifier on success, or FALSE on failure., where can i see

[PHP] Intercepting errors

2008-03-13 Thread It Maq
Hi, Now i know how to create errors with trigger_error, but i am wondering how can I make my error handling class intercept any kind of error although i'm not aware about it and i don't know if it will happen. Is this possible? Thank you

Re: [PHP] Intercepting errors

2008-03-13 Thread It Maq
[EMAIL PROTECTED] To: It Maq [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Thursday, March 13, 2008 10:36:20 AM Subject: Re: [PHP] Intercepting errors Now i know how to create errors with trigger_error, but i am wondering how can I make my error handling class intercept any kind of error

Re: [PHP] Intercepting errors

2008-03-13 Thread It Maq
); trigger_error(The string for testing the error, E_USER_ERROR); ? - Original Message From: Richard Heyes [EMAIL PROTECTED] To: It Maq [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Thursday, March 13, 2008 11:00:30 AM Subject: Re: [PHP] Intercepting errors I'am already using

Re: [PHP] Intercepting errors (skip)

2008-03-13 Thread It Maq
sorry i just forgot to print the results. It 's my mistake - Original Message From: It Maq [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, March 13, 2008 11:22:36 AM Subject: Re: [PHP] Intercepting errors I already read th page of the manual, but i still don't understand

[PHP] How to get error context

2008-03-13 Thread It Maq
Hi, i need help because I'm unable to retrieve error's context. Below is the code that is working perfectly except the context that is not displayed: ?php function error_handler($errno, $errstr, $filename, $lineno, $errcontext) { $str = ; $str .=

[PHP] best practices in error handling in PHP

2008-03-12 Thread It Maq
Hi, I want to know what is the best solution for handling errors. After reading some documents dealing with the subject, i have three options: * Using a class for error handling * Using PEAR error object * Using try and catch exceptions The error handling i want to implement will be done in a

Re: [PHP] best practices in error handling in PHP

2008-03-12 Thread It Maq
Yes you are right i can use trigger_error that will use the function that handles errors from my class. Thanks - Original Message From: Christoph Boget [EMAIL PROTECTED] To: It Maq [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Wednesday, March 12, 2008 10:31:07 AM Subject: Re

Re: [PHP] best practices in error handling in PHP

2008-03-12 Thread It Maq
I mean using calling trigger_error from the catch{} Yes you are right i can use trigger_error that will use the function that handles errors from my class. Thanks - Original Message From: Christoph Boget [EMAIL PROTECTED] To: It Maq [EMAIL PROTECTED] Cc

[PHP] Error handling

2008-03-11 Thread It Maq
Hi, I need help with a simple script that i made for handling errors. The problem is that the script displays the same message several times while i want it displayed just one time. He is the code: ?php function error_handler($errno, $errstr, $filename, $lineno, $context) { if ($errno ==

Re: [PHP] Error handling (skip this message my mistake)

2008-03-11 Thread It Maq
Sorry, i found the error. it was my mistake - Original Message From: It Maq [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, March 11, 2008 11:38:10 AM Subject: [PHP] Error handling Hi, I need help with a simple script that i made for handling errors. The problem

Re: [PHP] regular expressions question

2008-03-05 Thread It Maq
Hi, I am using that right now and i have don't know how to include blank fields. For example if a user does not fill a field in a form i want to accept it. I tried the code you posted, for now it is blocking blank fields. Thank you - Original Message From: Richard Lynch [EMAIL