Re: [PHP] Function variables in classes

2007-11-02 Thread rohini
Hi paul, Why you are trying to use the scope resolution operator see you can use this way simply. Code: ** ?php class foobar { function bar2 () { echo Yep, in bar2() right now\n; } public function foo2 () { $a = bar2;// Experiment 0 $a();

Re: [PHP] Transfer query result to another script

2007-11-02 Thread rohini
Hi, How can you get the result in the reload.php file it is not possible . If you are using the include you can get the object $connect and you easily access the result. But you just send the header in the report.php you are connecting to the mysql. So you try to send the $connect, If there is

Re: [PHP] Transfer query result to another script

2007-11-02 Thread Jochem Maas
C.R.Vegelin wrote: ... Hi Jochem, The reason for a redirect is that Report.php has functionality such as sorting on report columns, checkboxes to make graphs etc. Suppose the following report columns: Country 06.Q1 06.Q2 06.Q3 06.Q4 07.Q1 07.Q2 1 Austria 1226 1211

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Daniel Brown
On 11/2/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote: On 11/2/07 8:26 AM, Jason Pruim [EMAIL PROTECTED] wrote: On Nov 1, 2007, at 5:54 PM, Jim Lucas wrote: Sounds like a clear case of Apache being chroot'ed. This is based off the BSD style setup I believe. Which I believe Mac

Re: [PHP] Function return

2007-11-02 Thread Daniel Brown
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote: TGIF!! I believe that's Copyright (C) TCompuserve. Careful you don't get tsued. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic

Re: [PHP] what is better way to write the query

2007-11-02 Thread afan pasalic
let me write the questions again: what is the difference between these two queries? is there any situation when it's better to use first vs. second solution? is there any suggestion for the process of inserting up to 5K records at the time or this number is so small to consider any optimization?

Re: [PHP] Function return

2007-11-02 Thread Nathan Nobbe
On 11/2/07, Stut [EMAIL PROTECTED] wrote: Dan Shirah wrote: That is correct, the due_date field should only accept a valid date format, such as MM/DD/. To bypass the need for a validation check for this field I simply set the text field to disabled and supplied the user with a

Re: [PHP] Function return

2007-11-02 Thread Stut
Dan Shirah wrote: That is correct, the due_date field should only accept a valid date format, such as MM/DD/. To bypass the need for a validation check for this field I simply set the text field to disabled and supplied the user with a javascript popup calendar that upon selection populates

[PHP] what is better way to write the query

2007-11-02 Thread afan pasalic
hi, it's maybe more question for mysql list, but since php is involved too... :-) I have php script that inserts into mysql table couple hundreds of records. usually, it looks like: ?php // 1st record $query = INSERT INTO table (col_11, col_12, ... col_1n) VALUES ($value_11, $value_12,...

Re: [PHP] Transfer query result to another script

2007-11-02 Thread C.R.Vegelin
- Original Message - From: Jochem Maas [EMAIL PROTECTED] To: C.R.Vegelin [EMAIL PROTECTED] Cc: David Giragosian [EMAIL PROTECTED]; php-general php-general@lists.php.net Sent: Friday, November 02, 2007 10:41 AM Subject: Re: [PHP] Transfer query result to another script C.R.Vegelin

Re: [PHP] Function return

2007-11-02 Thread Nathan Nobbe
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote: Ah, okay. So I could probably simplfy it more by trimming it from the start like this?? $due_date = trim($_POST['due_date']); that works; i personally prefer to initialize a variable then only set it if the user input meets some conditions;

Re: [PHP] Function return

2007-11-02 Thread Nathan Nobbe
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote: Okay, so instead I should probably use: if($due_date != ) $insert2.=, due_date='$due_date'; Instead of using empty() using emtpy is fine; just store the results of trim in a temporary variable: $trimmed = trim($due_date);

Re: [PHP] Function return

2007-11-02 Thread Dan Shirah
Okay, so instead I should probably use: if($due_date != ) $insert2.=, due_date='$due_date'; Instead of using empty() On 11/2/07, Nathan Nobbe [EMAIL PROTECTED] wrote: On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote: TGIF!! I have an insert statement that checks to see if a condition

Re: [PHP] Function return

2007-11-02 Thread Nathan Nobbe
On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote: TGIF!! I have an insert statement that checks to see if a condition is met. If it is, then it adds that value to the insert statement. However, when I try to run it I get the error: Can't use function return value in write context Below

[PHP] Function return

2007-11-02 Thread Dan Shirah
TGIF!! I have an insert statement that checks to see if a condition is met. If it is, then it adds that value to the insert statement. However, when I try to run it I get the error: Can't use function return value in write context Below is a sample of what I am using which gives me the

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Jason Pruim
On Nov 2, 2007, at 9:57 AM, Daniel Brown wrote: On 11/2/07, Jason Pruim [EMAIL PROTECTED] wrote: I have been a Mac user for my entire computing life Well, then way to chime in 14 hours late there, Pruim! ;-P What can I say? :) Better late then never :P -- Jason Pruim Raoset Inc.

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Jason Pruim
On Nov 2, 2007, at 10:18 AM, Daniel Brown wrote: On 11/2/07, Jason Pruim [EMAIL PROTECTED] wrote: On Nov 2, 2007, at 9:57 AM, Daniel Brown wrote: On 11/2/07, Jason Pruim [EMAIL PROTECTED] wrote: I have been a Mac user for my entire computing life Well, then way to chime in 14 hours

Re: [PHP] Function variables in classes

2007-11-02 Thread Nathan Nobbe
On 11/2/07, rohini [EMAIL PROTECTED] wrote: Hi paul, Why you are trying to use the scope resolution operator see you can use this way simply. Code: ** ?php class foobar { function bar2 () { echo Yep, in bar2() right now\n; } public function foo2 () {

Re: [PHP] Including GD inside HTML code

2007-11-02 Thread David Giragosian
On 11/1/07, Instruct ICC [EMAIL PROTECTED] wrote: Alberto García Gómez wrote: I trying to include some image generate for a function that use GD. eg.: function myfunct(){ [MY_CODE] } but when I call the function it generate me a lot of symbols, letters and

Re: [PHP] what is better way to write the query

2007-11-02 Thread Jim Lucas
afan pasalic wrote: hi, it's maybe more question for mysql list, but since php is involved too... :-) I have php script that inserts into mysql table couple hundreds of records. usually, it looks like: ?php // 1st record $query = INSERT INTO table (col_11, col_12, ... col_1n) VALUES ($value_11,

Re: [PHP] Transfer query result to another script

2007-11-02 Thread Jochem Maas
C.R.Vegelin wrote: - Original Message - From: Jochem Maas [EMAIL PROTECTED] To: C.R.Vegelin [EMAIL PROTECTED] Cc: David Giragosian [EMAIL PROTECTED]; php-general php-general@lists.php.net Sent: Friday, November 02, 2007 10:41 AM Subject: Re: [PHP] Transfer query result to another

Re: [PHP] Transfer query result to another script

2007-11-02 Thread Jim Lucas
C.R.Vegelin wrote: Hi All, Q: Is it possible to transfer a query result to another script ? For example with (fragments of) the following 2 scripts: Engine.php $result = mysqli_query($connect, $myquery); if (!$result) error ... if (mysqli_num_rows($result) == 0) error ...

Re: [PHP] what is better way to write the query

2007-11-02 Thread Stut
Jim Lucas wrote: afan pasalic wrote: hi, it's maybe more question for mysql list, but since php is involved too... :-) I have php script that inserts into mysql table couple hundreds of records. usually, it looks like: ?php // 1st record $query = INSERT INTO table (col_11, col_12, ... col_1n)

Re: [PHP] Function return

2007-11-02 Thread Dan Shirah
Ah, okay. So I could probably simplfy it more by trimming it from the start like this?? $due_date = trim($_POST['due_date']); On 11/2/07, Nathan Nobbe [EMAIL PROTECTED] wrote: On 11/2/07, Dan Shirah [EMAIL PROTECTED] wrote: Okay, so instead I should probably use: if($due_date != )

Re: [PHP] what is better way to write the query

2007-11-02 Thread Stut
afan pasalic wrote: Stut wrote: Jim Lucas wrote: afan pasalic wrote: hi, it's maybe more question for mysql list, but since php is involved too... :-) I have php script that inserts into mysql table couple hundreds of records. usually, it looks like: ?php // 1st record $query = INSERT INTO

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Rahul Sitaram Johari
On 11/2/07 11:12 AM, Daniel Brown [EMAIL PROTECTED] wrote: On 11/2/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote: That sounds like a good place to look. I actually did figure out a way to make this work. It appears that Apache Web Server did not have enough permissions to read files

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Jason Pruim
On Nov 1, 2007, at 5:54 PM, Jim Lucas wrote: Rahul Sitaram Johari wrote: Ave, Somehow my PHP won't access, won't even acknowledge the existence of a file that is outside the /Library/WebServer/Documents folder. This was never a a problem before in any Mac version - it just started with

Re: [PHP] what is better way to write the query

2007-11-02 Thread Andrew Ballard
On Nov 2, 2007 10:41 AM, afan pasalic [EMAIL PROTECTED] wrote: ...is there any suggestion for the process of inserting up to 5K records at the time ... Is it possible to save your data to a text file and then use one of MySQL's built-in import queries? (I know in some situations it isn't an

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Rahul Sitaram Johari
On 11/2/07 8:26 AM, Jason Pruim [EMAIL PROTECTED] wrote: On Nov 1, 2007, at 5:54 PM, Jim Lucas wrote: Sounds like a clear case of Apache being chroot'ed. This is based off the BSD style setup I believe. Which I believe Mac uses, So, I would check your startup line for Apache. I did

Re: [PHP] what is better way to write the query

2007-11-02 Thread Stut
afan pasalic wrote: Stut wrote: afan pasalic wrote: Stut wrote: Jim Lucas wrote: afan pasalic wrote: hi, it's maybe more question for mysql list, but since php is involved too... :-) I have php script that inserts into mysql table couple hundreds of records. usually, it looks like: ?php //

Re: [PHP] what is better way to write the query

2007-11-02 Thread afan pasalic
Stut wrote: afan pasalic wrote: Stut wrote: Jim Lucas wrote: afan pasalic wrote: hi, it's maybe more question for mysql list, but since php is involved too... :-) I have php script that inserts into mysql table couple hundreds of records. usually, it looks like: ?php // 1st record

RE: [PHP] Threads

2007-11-02 Thread Instruct ICC
Greetings everyone, I was wondering where I could find information on the status and possibilities of threads being included in PHP. Or if you are knowledge-able on the status of threads, if it is a planned addition or not and the reasons as such. I understand PHP is not thread safe,

Re: [PHP] Transfer query result to another script

2007-11-02 Thread Jochem Maas
C.R.Vegelin wrote: Hello David, Jim, Thanks for your response. Yes, I do have session_start() at the top of Report.php. The reason for having the query on a different page than the result is that the result may be sent to various output types / scripts. I will change my code as follows:

Re: [PHP] Function return

2007-11-02 Thread Dan Shirah
That is correct, the due_date field should only accept a valid date format, such as MM/DD/. To bypass the need for a validation check for this field I simply set the text field to disabled and supplied the user with a javascript popup calendar that upon selection populates the date in the

Re: [PHP] Re: Function variables in classes

2007-11-02 Thread Jochem Maas
Paul van Haren wrote: OK guys, thanks for all your inputs. Based on your guidance, I have tested the following code with a series of variations: class foobar { function bar2 () { echo Yep, in bar2() right now\n; }

Re: [PHP] Transfer query result to another script

2007-11-02 Thread C.R.Vegelin
Hello David, Jim, Thanks for your response. Yes, I do have session_start() at the top of Report.php. The reason for having the query on a different page than the result is that the result may be sent to various output types / scripts. I will change my code as follows: Engine.php -

Re: [PHP] Transfer query result to another script

2007-11-02 Thread C.R.Vegelin
- Original Message - From: Jochem Maas [EMAIL PROTECTED] To: C.R.Vegelin [EMAIL PROTECTED] Cc: David Giragosian [EMAIL PROTECTED]; php-general php-general@lists.php.net Sent: Friday, November 02, 2007 9:06 AM Subject: Re: [PHP] Transfer query result to another script C.R.Vegelin

Re: [PHP] what is better way to write the query

2007-11-02 Thread afan pasalic
Stut wrote: Jim Lucas wrote: afan pasalic wrote: hi, it's maybe more question for mysql list, but since php is involved too... :-) I have php script that inserts into mysql table couple hundreds of records. usually, it looks like: ?php // 1st record $query = INSERT INTO table (col_11,

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Daniel Brown
On 11/2/07, Jason Pruim [EMAIL PROTECTED] wrote: I have been a Mac user for my entire computing life Well, then way to chime in 14 hours late there, Pruim! ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then

Re: [PHP] PHP Won't Access Files Outside Web Root (Leopard/MacOS X 10.5)

2007-11-02 Thread Daniel Brown
On 11/2/07, Jason Pruim [EMAIL PROTECTED] wrote: On Nov 2, 2007, at 9:57 AM, Daniel Brown wrote: On 11/2/07, Jason Pruim [EMAIL PROTECTED] wrote: I have been a Mac user for my entire computing life Well, then way to chime in 14 hours late there, Pruim! ;-P What can I say? :)

Re: [PHP] Including GD inside HTML code

2007-11-02 Thread Jim Lucas
David Giragosian wrote: On 11/1/07, Instruct ICC [EMAIL PROTECTED] wrote: Alberto García Gómez wrote: I trying to include some image generate for a function that use GD. eg.: function myfunct(){ [MY_CODE] } but when I call the function it generate me a lot of symbols, letters and

[PHP] mail and quotes

2007-11-02 Thread Stefano Esposito
Hi all, when i send a mail using mail(), every quote and double quote in the subject and in the body of the mail get escaped. Since this is somewhat ugly, especially in languages which widely uses the single quotes (as italian does), i am wandering if there is someway to avoid this. Thanks for

Re: [PHP] crop an image

2007-11-02 Thread Chris Bruce
What was the solution here? I am trying to crop but am getting a black bar the same height as the crop at top. For this image I want to crop 40 pixels off of the top: $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($jpegpath); imagecopyresampled($image_p,

Re: [PHP] mail and quotes

2007-11-02 Thread Jim Lucas
Stefano Esposito wrote: Hi all, when i send a mail using mail(), every quote and double quote in the subject and in the body of the mail get escaped. Since this is somewhat ugly, especially in languages which widely uses the single quotes (as italian does), i am wandering if there is someway to

Re: [PHP] Function return

2007-11-02 Thread Dan
I know that while you should be doing proper validation on the server side and everything, you could somewhat diminish the risk of someone building their own form and just posting. If you were to check the referring site which made the post then you could be pretty sure someone didn't make

[PHP] mysql_fetch_array

2007-11-02 Thread Eduardo Vizcarra
I have a WHILE sentence to retrieve all records from a SELECT query in a database and am using mysql_fetch_array to store them in a matrix, the sentence is like this: while($row=mysql_fetch_array($fotos)) { $fotos_mostrar[] = $row; } $fotos contains all records found in a db table, the

Re: [PHP] mysql_fetch_array

2007-11-02 Thread Cristian Vrabie
this is most peculiar. your code should do exactly what you expect. have you initialized the $fotos_mostrar array before the while loop? $fotos_mostrar = array(); Eduardo Vizcarra wrote: I have a WHILE sentence to retrieve all records from a SELECT query in a database and am using

Re: [PHP] mysql_fetch_array

2007-11-02 Thread Eduardo Vizcarra
Yes, matrix has been defined just before this WHILE sentence Cristian Vrabie [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] this is most peculiar. your code should do exactly what you expect. have you initialized the $fotos_mostrar array before the while loop? $fotos_mostrar

Re: [PHP] mysql_fetch_array

2007-11-02 Thread Richard S. Crawford
On Friday 02 November 2007 18:23:03 Eduardo Vizcarra wrote:   while($row=mysql_fetch_array($fotos))   {    $fotos_mostrar[] = $row;   } $fotos contains all records found in a db table, the SELECT statement is retrieving 2 columns from a table, how do I store all records in a 2 dimention