php-general Digest 30 Apr 2007 07:13:42 -0000 Issue 4764

Topics (messages 254113 through 254136):

single signon Solution php and .net
        254113 by: Murtaza Chang
        254114 by: Buesching, Logan J

Re: ${}
        254115 by: Daniel Bächtle

uploads
        254116 by: jekillen
        254117 by: Tijnema !

Re: phpbb / sessionid nightmare
        254118 by: Chris
        254125 by: Brad Sumrall
        254126 by: Brad Sumrall
        254129 by: Chris
        254131 by: Brad Sumrall
        254132 by: Brad Sumrall
        254133 by: Brad Sumrall

Re: I really need help
        254119 by: Stephen Hernandez
        254120 by: Tijnema !
        254121 by: Buesching, Logan J
        254122 by: Robert Cummings

Re: Name Capitalization
        254123 by: Leonard Burton

Re: Help me put this into phpinesse!
        254124 by: Brad Sumrall

Re: Running processes in windows
        254127 by: Chris

Delete first line of a csv file if it is the headers
        254128 by: Richard Kurth
        254130 by: Chris

Re: Changing Session Timeout
        254134 by: Aaron Axelsen

PHP & MySQL -> Field Title
        254135 by: Christian Haensel
        254136 by: Auto-Deppe, C. Haensel

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi, me and my fellow developer have built two applications that need to
authenticate users using LDAP, we have successfully accomplished it, but the
problem is his application is in .net and mine is in php, my php app needs
to call secure pages of .net and vice versa, now when the user is logged
onto let say my php app he is logged and his session is created and when I
redirect him to .net app he again sees a login form because the session isnt
created in .net app.
I need some single sign on solution I found lots of APIs and libraries for
java but have no idea what can I use for php and .net, kindly experience
programmers guide me.
Thankyou

--
Murtaza Chang
http://flickr.com/photos/blackstallion/

--- End Message ---
--- Begin Message ---
The first thing that comes to my mind is to use a database to handle
session data as defined by: 
http://us2.php.net/manual/en/function.session-set-save-handler.php.  You
can then, when attempting to authenticate, pass the session ID back and
forth through your applications.  There may be similar things for .Net,
but I as I am not a .Net web developer, I can't help you out in that
area.

-Logan

> -----Original Message-----
> From: Murtaza Chang [mailto:[EMAIL PROTECTED]
> Sent: Sunday, April 29, 2007 3:13 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] single signon Solution php and .net
> 
> Hi, me and my fellow developer have built two applications that need
to
> authenticate users using LDAP, we have successfully accomplished it,
> but the
> problem is his application is in .net and mine is in php, my php app
> needs
> to call secure pages of .net and vice versa, now when the user is
> logged
> onto let say my php app he is logged and his session is created and
> when I
> redirect him to .net app he again sees a login form because the
session
> isnt
> created in .net app.
> I need some single sign on solution I found lots of APIs and libraries
> for
> java but have no idea what can I use for php and .net, kindly
> experience
> programmers guide me.
> Thankyou
> 
> --
> Murtaza Chang
> http://flickr.com/photos/blackstallion/

--- End Message ---
--- Begin Message ---

where can I find the documentation about this "symbol"?

http://www.php.net/string#language.types.string.substr

--- End Message ---
--- Begin Message ---
Hello again;
can someone point me to a system for cleaning
uploaded files; embedded php scripts in image
files, viruses etc, shell escape chars, anything
that would be hazardous?
The idea is when a file is uploaded, as soon
as it gets to the server it is inspected, cleaned/rejected
before it is used or sent anywhere else on the server.
I am using php to upload anything that would be sent
in an e-mail attachment. Once the files have been
'sanitized' they would be made available for display.
Thanks in advance;
Jeff k

--- End Message ---
--- Begin Message ---
On 4/29/07, jekillen <[EMAIL PROTECTED]> wrote:
Hello again;
can someone point me to a system for cleaning
uploaded files; embedded php scripts in image
files, viruses etc, shell escape chars, anything
that would be hazardous?
The idea is when a file is uploaded, as soon
as it gets to the server it is inspected, cleaned/rejected
before it is used or sent anywhere else on the server.
I am using php to upload anything that would be sent
in an e-mail attachment. Once the files have been
'sanitized' they would be made available for display.
Thanks in advance;
Jeff k


What's your platform? Windows or Linux?

Tijnema

--- End Message ---
--- Begin Message ---
Brad Sumrall wrote:
The cookie it's self says PHPSESSID=26b7974a5d71c7d0bfebbf71750dac7b
Path=/
Host=www.domain.com

When I go to the jacked up page, I pickup this one
PHPSESSID=a787e077dd18ed18cb824f664d38315d
Path=/
Host=domain.com

That will be your problem. A cookie created on domain.com is ONLY readable by domain.com (unless you make it '.domain.com' which is technically different to 'domain.com').

Check out 'session.cookie_domain', you can set it with an ini_set call:

ini_set('session.cookie_domain', '.domain.com');

See http://www.php.net/manual/en/ref.session.php

and http://www.php.net/setcookie for more info about how cookie domains work.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
You might be hitting the nail on the head.
That is why I am trying to get crafty and look for two sessions.
But, give me a sec and follow your lead!
I am back on this project now and finishing laundry at the same time.

Thank you sir!

Brad

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Sunday, April 29, 2007 6:45 PM
To: Brad Sumrall
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] phpbb / sessionid nightmare

Brad Sumrall wrote:
> The cookie it's self says 
> PHPSESSID=26b7974a5d71c7d0bfebbf71750dac7b
> Path=/
> Host=www.domain.com
> 
> When I go to the jacked up page, I pickup this one
> PHPSESSID=a787e077dd18ed18cb824f664d38315d
> Path=/
> Host=domain.com

That will be your problem. A cookie created on domain.com is ONLY 
readable by domain.com (unless you make it '.domain.com' which is 
technically different to 'domain.com').

Check out 'session.cookie_domain', you can set it with an ini_set call:

ini_set('session.cookie_domain', '.domain.com');

See http://www.php.net/manual/en/ref.session.php

and http://www.php.net/setcookie for more info about how cookie domains 
work.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
The cookie domain in phpbb is already set at ./domain.com

??????

I think I need to go back to my little hack?

Opinions?

Brad

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Sunday, April 29, 2007 6:45 PM
To: Brad Sumrall
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] phpbb / sessionid nightmare

Brad Sumrall wrote:
> The cookie it's self says 
> PHPSESSID=26b7974a5d71c7d0bfebbf71750dac7b
> Path=/
> Host=www.domain.com
> 
> When I go to the jacked up page, I pickup this one
> PHPSESSID=a787e077dd18ed18cb824f664d38315d
> Path=/
> Host=domain.com

That will be your problem. A cookie created on domain.com is ONLY 
readable by domain.com (unless you make it '.domain.com' which is 
technically different to 'domain.com').

Check out 'session.cookie_domain', you can set it with an ini_set call:

ini_set('session.cookie_domain', '.domain.com');

See http://www.php.net/manual/en/ref.session.php

and http://www.php.net/setcookie for more info about how cookie domains 
work.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Brad Sumrall wrote:
The cookie domain in phpbb is already set at ./domain.com

I doubt it's set to ./domain.com

What about your session (ie NOT phpbb) ?

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Wait, you might be on to something!
Phpbb is set to ./domain
But, on the page I find nothing related to domain
This is a new page.
Think about it as a blank .php page first.

Now, where would you point me now?

Brad

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 30, 2007 12:18 AM
To: Brad Sumrall
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] phpbb / sessionid nightmare

Brad Sumrall wrote:
> The cookie domain in phpbb is already set at ./domain.com

I doubt it's set to ./domain.com

What about your session (ie NOT phpbb) ?

-- 
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Login page is located in /phpbb/login.php

New page is /login.php

A test echo page reviles NOTHING!
Login ID does not echo.

If I login @   /index.php, the echo test passes!

Brad

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 30, 2007 12:18 AM
To: Brad Sumrall
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] phpbb / sessionid nightmare

Brad Sumrall wrote:
> The cookie domain in phpbb is already set at ./domain.com

I doubt it's set to ./domain.com

What about your session (ie NOT phpbb) ?

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
I have reached the point that I have ripped the entire page out and trying
to just get an echo test to work.
The help files in phpbb are not helping/working.

Brad

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 30, 2007 12:18 AM
To: Brad Sumrall
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] phpbb / sessionid nightmare

Brad Sumrall wrote:
> The cookie domain in phpbb is already set at ./domain.com

I doubt it's set to ./domain.com

What about your session (ie NOT phpbb) ?

-- 
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I have literally just started using php and my sql so I really hope
somebody can help me and I am addressing the right people as I don't
want to be a pain in the neck. I have tested whether PHP is installed
and running on the remote web server that hosts my website and it is
running ok.
Next I wanted to see if I could access MySQL using PHP.  I downloaded a
file from a Web site at janet.valade.com called mysql_up.php as it comes
from a book she has written called PHP & MySQL for Dummies which is the
book I am using to learn - as you can tell I am right at the beginning
:-) .
I get an error message which relates  to lines 9, 10 and 11 of the
program which are:
$host="host";
$user="mysqlaccount";
$password="mysqlpassword";
 
These were the values I had to change which I guess is where the problem
is. I was supposed to change host to the name of the computer where
MySQL is installed. But I do not know what name I should put, the name
of my site is spanishbyproz.com. In the example Janet uses she puts
datebasehost.mycompany.com . What should I write for host ?
 
I would really appreciate any advice and am sorry it is such a basic
question.
 
Many thanks in advance,
 
Steve

--- End Message ---
--- Begin Message ---
On 4/30/07, Stephen Hernandez <[EMAIL PROTECTED]> wrote:
I have literally just started using php and my sql so I really hope
somebody can help me and I am addressing the right people as I don't
want to be a pain in the neck. I have tested whether PHP is installed
and running on the remote web server that hosts my website and it is
running ok.
Next I wanted to see if I could access MySQL using PHP.  I downloaded a
file from a Web site at janet.valade.com called mysql_up.php as it comes
from a book she has written called PHP & MySQL for Dummies which is the
book I am using to learn - as you can tell I am right at the beginning
:-) .
I get an error message which relates  to lines 9, 10 and 11 of the
program which are:
$host="host";
$user="mysqlaccount";
$password="mysqlpassword";

These were the values I had to change which I guess is where the problem
is. I was supposed to change host to the name of the computer where
MySQL is installed. But I do not know what name I should put, the name
of my site is spanishbyproz.com. In the example Janet uses she puts
datebasehost.mycompany.com . What should I write for host ?

I would really appreciate any advice and am sorry it is such a basic
question.

Many thanks in advance,

Steve

In 99% of the cases is MySQL running on the same host, and you should
fill in "localhost"

Tijnema


--- End Message ---
--- Begin Message ---
You will have to find that information out through whoever your host is.
There is no one configuration for that.  

The first question to ask is did you create a MySQL database?  If you
did, then find out whatever the host was for doing that.  Many times,
your host will put it at mysql.___domainname___.com, so since you have
"spanishbyproz.com", you can probably try mysql.spanishbyproz.com.

-Logan 

> -----Original Message-----
> From: Stephen Hernandez [mailto:[EMAIL PROTECTED]
> Sent: Sunday, April 29, 2007 7:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] FW: I really need help
> 
> I have literally just started using php and my sql so I really hope
> somebody can help me and I am addressing the right people as I don't
> want to be a pain in the neck. I have tested whether PHP is installed
> and running on the remote web server that hosts my website and it is
> running ok.
> Next I wanted to see if I could access MySQL using PHP.  I downloaded
a
> file from a Web site at janet.valade.com called mysql_up.php as it
> comes
> from a book she has written called PHP & MySQL for Dummies which is
the
> book I am using to learn - as you can tell I am right at the beginning
> :-) .
> I get an error message which relates  to lines 9, 10 and 11 of the
> program which are:
> $host="host";
> $user="mysqlaccount";
> $password="mysqlpassword";
> 
> These were the values I had to change which I guess is where the
> problem
> is. I was supposed to change host to the name of the computer where
> MySQL is installed. But I do not know what name I should put, the name
> of my site is spanishbyproz.com. In the example Janet uses she puts
> datebasehost.mycompany.com . What should I write for host ?
> 
> I would really appreciate any advice and am sorry it is such a basic
> question.
> 
> Many thanks in advance,
> 
> Steve

--- End Message ---
--- Begin Message ---
On Mon, 2007-04-30 at 00:29 +0100, Stephen Hernandez wrote:
> I have literally just started using php and my sql so I really hope
> somebody can help me and I am addressing the right people as I don't
> want to be a pain in the neck. I have tested whether PHP is installed
> and running on the remote web server that hosts my website and it is
> running ok.
> Next I wanted to see if I could access MySQL using PHP.  I downloaded a
> file from a Web site at janet.valade.com called mysql_up.php as it comes
> from a book she has written called PHP & MySQL for Dummies which is the
> book I am using to learn - as you can tell I am right at the beginning
> :-) .
> I get an error message which relates  to lines 9, 10 and 11 of the
> program which are:
> $host="host";
> $user="mysqlaccount";
> $password="mysqlpassword";
>  
> These were the values I had to change which I guess is where the problem
> is. I was supposed to change host to the name of the computer where
> MySQL is installed. But I do not know what name I should put, the name
> of my site is spanishbyproz.com. In the example Janet uses she puts
> datebasehost.mycompany.com . What should I write for host ?
>  
> I would really appreciate any advice and am sorry it is such a basic
> question.

Try using:

$host = 'localhost';

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hi Paul,

[comments below inline]

On 3/19/07, Paul Novitski <[EMAIL PROTECTED]> wrote:
At 3/19/2007 07:17 PM, Leonard Burton wrote:
>What my case is that I have came across a list of names that I need to
>use and all of the names were in caps.  From there anything is a step
>in the right direction.
>
>As you know, anytime you parse anything in bulk there will be
>exceptions to the rule.
>
>My goal would be to just pick the most common usage.  If von Dielengan
>is supposed to be VonDielengan in one case or Von Dielengan in another
>is ok, it can be manually retouched later.
>
>The CPAN class that someone posted earlier has some good points except
>its not in PHP.
>
>I will be working on some code sometime over the next 3 to 5 days and
>might send it to you if you are willing to look at it.


Sure, it sounds like fun.  I've written de-cap routines before for
whole addresses, names included.  It's an amusing challenge to
whittle down the error rate.

I'll be interested to compare notes on strategies for implementing
this efficiently in PHP.

I have set up a Google Code Page for this project.
http://code.google.com/p/lastname

Initially I had a coder translate the project to PHP.

What do you think of how it is implemented?

Would you still like to help work on it?

Thanks and take care,

--
Leonard Burton, N9URK
http://www.jiffyslides.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]

"The prolonged evacuation would have dramatically affected the
survivability of the occupants."

--- End Message ---
--- Begin Message ---
When the page opens, connect to server (this works fine).
Look for session, if no session is found, look for phpbb session (two
different session possibilities)

Reading through the phpbb site, it say I must have the code that is in
include './phpbb/login_global.php'

Brad

-----Original Message-----
From: Tijnema ! [mailto:[EMAIL PROTECTED] 
Sent: Sunday, April 29, 2007 5:03 AM
To: Brad Sumrall
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Help me put this into phpinesse!

On 4/29/07, Brad Sumrall <[EMAIL PROTECTED]> wrote:
> <?php
>
>            ob_start();
>
>            session_start();
>
>            header("Cache-control: private");
>
>            require("includes/configure.php");
>
>
> $conn=mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD);
>
>            mysql_select_db(DB_DATABASE) or die(mysql_error().": database
> not available");
>
>            $show="no";
>
>            isset($_SESSION['userid']);

What's the sense of above line?
isset is a function, that returns true or false.
>
>                        if $SESSION=NULL
>
>                        include './phpbb/login_global.php'
>
>
>
>            $show="yes";
>
> ?>
>
>
>
> What am I missing?
>
>
>
> Brad

There's no concrete question what you want here. So i guess that is missing.

Tijnema
>
>

--- End Message ---
--- Begin Message ---
Nathan Wallis wrote:
Howdy.

I have an application in windows that I am running with a PHP page using
exec  ("start......

I am wondering as to the efficiency of such a statement and how taxing it is
on the server.  If multiple people access a page with such a statement, what
toll does it take on the server and is there a better way to manage calls to
the server side executable?  When this statement is called a command prompt
window appears for the duration of the execution.  I am guessing it would be
possible to crash the server if thousands of these processes we created at
around the same time....just anyone experience would be greatly appreciated.

I think you can probably stop that from happening (no idea how - maybe ask the php-windows list), but it depends on what happens in that command prompt.

If you're doing a simple thing, then it won't do much. If you're doing a database dump or something else I/O and/or processor intensive, of course it's going to take a toll on the server (regardless of the operating system).

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
     The below script will parse a csv file to a database I need to remove
the first line because it is the header files and I don't need them. How can
I test for that and remove them.
 
 $file = fopen($_POST['copy'], 'r') or $message .= "Could not open" .
$_POST[copy] . "for reading.<BR>\n";
                while (!feof($file)){
                    # We could easily be importing 10,000 records.  Give us
some time here, okay?
                    set_time_limit(30);
                    $fields = fgetcsv($file, 1000000);
   
                    if ($fields && count($fields)){
                        $recordcount++;
 
                        # Wipe out every possible field, in case they have
some missing:
                        reset($possiblefields);
                        while (list(,$fieldname) = each($possiblefields)){
                            $$fieldname = '';
                        }
 
                        reset($_POST['fieldorder']);
                        $fieldcount = 0;
                        $notes = '';
                        while (list(,$field) = each($fields)){
                            $fieldname =
$_POST['fieldorder'][$fieldcount++];
                            if ($fieldname == 'notes'){
                                $notes .= addslashes("$field\n");
                            }
                            elseif ($fieldname == '-- ignore --'){
                                # ignore it
                            }
                            else{
                                # Note that file data is not Magic-Quoted:
                                $$fieldname = addslashes($field);
                            }
                        }
                          require 'importinsert.php';
                    }

--- End Message ---
--- Begin Message ---
Richard Kurth wrote:
     The below script will parse a csv file to a database I need to remove
the first line because it is the header files and I don't need them. How can
I test for that and remove them.
$file = fopen($_POST['copy'], 'r') or $message .= "Could not open" .
$_POST[copy] . "for reading.<BR>\n";

                while (!feof($file)){

You don't need this loop. fgetcsv will do it for you (see the example at http://php.net/fgetcsv

                    # We could easily be importing 10,000 records.  Give us
some time here, okay?
                    set_time_limit(30);

and you're setting this with every line in the file.. probably not what you intended.


From the php page but slightly modified:

$row = 0;
$handle = fopen("test.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $row++;
    if ($row == 1) {
        echo "Found headers, skipping\n";
        continue;
    }
    $num = count($data);
    echo "<p> $num fields in line $row: <br />\n";
}


<snip>

                            if ($fieldname == 'notes'){
                                $notes .= addslashes("$field\n");

If you're putting this into a database you should look to use the relevant _escape_string functions (eg mysql_real_escape_string or pg_escape_string) because they handle quotes & character sets a lot smarter than addslashes does.

                                # Note that file data is not Magic-Quoted:
                                $$fieldname = addslashes($field);

Same here.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
I did some more investigating, and tracked down the problem. 
Apparently, even though i was setting a separate save_path inside the
default save path the garbage collector was still picking up the
sessions in that directory.

I moved the session save_path dir to a separate location and the
sessions were removed according to the ini settings.  The 1 weird thing
I noticed is that the session cookie on the client PC is not getting set
properly.  I am trying to set a session timeout of 3 hours, the server
is set to GMT time, and the client PC is set to CST time.  The cookie on
the client PC reports that it has an expiration time of 1.5 hours
instead of 3.  Does anyone have any ideas why thats happening?

Aaron Axelsen wrote:
> Everything i've read in the documentation states to call session_start
> after you have changed your necessary settings.  Do you have a working
> example using session cookies I can compare this with?
>
> Richard Lynch wrote:
> > On Fri, April 27, 2007 1:37 pm, tedd wrote:
> >> At 12:26 PM -0500 4/27/07, Aaron Axelsen wrote:
> >>> With the following set, its still timing me out.  I logged in
> >>> and waited about 40 minutes, and it was timed out by then. This
> >>> is getting very confusing, what else could it be that is
> >>> causing this to not work?
> >>>
> >>> session_name('myapp');
> >>>
> >>> $mytimeout = 180 * 60; // minutes * 60
> >>>
> >>> session_set_cookie_params($mytimeout);
> >>>
> >>> $sessdir = ini_get('session.save_path')."/myapp"; if
> >>> (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
> >>> ini_set('session.save_path', $sessdir);
> >>>
> >>> // New Attempt session_cache_limiter();
> >>> session_cache_expire($mytimeout / 60);
> >>> ini_set('session.gc_maxlifetime', $mytimeout);
> >>> #ini_set('session.gc_probability',1);
> >>> #ini_set('session.gc_divisor',1);
> >>>
> >>> session_start();
> >>>
> >> The above is not the order of your code, is it?
> >>
> >> If so, move session_start(); to the top, namely the first line of
> >>  code.
>
> > I don't think you want to do that...
>
> > You want all those settings to take effect BEFORE you actually
> > start the session which sends out the headers.
>
>

-- 
Aaron Axelsen
Technical Director
Modevia Web Services LLC

1-866-451-9198 x802
[EMAIL PROTECTED]
www.modevia.com

-- 
Aaron Axelsen
[EMAIL PROTECTED]

Great hosting, low prices.  Modevia Web Services LLC -- http://www.modevia.com

--- End Message ---
--- Begin Message ---
Good Morning guys and girls

As I am rather lazy, I don't wanna do a data readout on my MySQL table in the following way with mysql_fetch_assoc()

$data_item1    =    $data['xitem1'];
$data_item2    =    $data['yitem2];
....

I am trying to do the following:

I have the correct number of fields in the table, which is 116. Now I want to use a for-loop and read teh data into a string, then shove it into another table, which has the exact same layout. I was thinking about something like

for($i=0; $i<= 115; $i++) {
   $data_item[$i]    =    $data[$i];
}

but now I have the problem with the field names and all... can someone point me into the right direction? All I have to so is move the contents of one field to the second database wich has the same layout as the first DB.

Would be thankful for any help :o)

Cheers!

Chris
--- End Message ---
--- Begin Message ---
nevermind, I made it :o) RTFM sometimes works even for me :O))

Have a great day :o)

Chris

----- Original Message ----- From: "Christian Haensel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 30, 2007 7:47 AM
Subject: [PHP] PHP & MySQL -> Field Title


Good Morning guys and girls

As I am rather lazy, I don't wanna do a data readout on my MySQL table in the following way with mysql_fetch_assoc()

$data_item1    =    $data['xitem1'];
$data_item2    =    $data['yitem2];
....

I am trying to do the following:

I have the correct number of fields in the table, which is 116. Now I want to use a for-loop and read teh data into a string, then shove it into another table, which has the exact same layout. I was thinking about something like

for($i=0; $i<= 115; $i++) {
   $data_item[$i]    =    $data[$i];
}

but now I have the problem with the field names and all... can someone point me into the right direction? All I have to so is move the contents of one field to the second database wich has the same layout as the first DB.

Would be thankful for any help :o)

Cheers!

Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---

Reply via email to