OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Sat Oct 19 2002 - 21:19:30 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 20 Oct 2002 02:19:30 -0000 Issue 1654

    Topics (messages 120600 through 120649):

    Re: Enum table entry
            120600 by: John W. Holmes

    GD Library
            120601 by: Gabe
            120603 by: Rasmus Lerdorf
            120604 by: Gabe
            120605 by: Rasmus Lerdorf

    Working with frames ...
            120602 by: Jean-Marc Godart
            120606 by: Maurits Lawende

    Appropriation / Manipulation / Stipulation
            120607 by: Anthony Ritter
            120608 by: Rasmus Lerdorf
            120609 by: Anthony Ritter
            120610 by: Rasmus Lerdorf

    Re: filemtime problem
            120611 by: Todd Cary

    Duplicating a Record in MySQL
            120612 by: Roger Lewis
            120613 by: . Edwin
            120614 by: John W. Holmes
            120620 by: Roger Lewis
            120621 by: John W. Holmes
            120630 by: Roger Lewis
            120645 by: David McInnis

    Upload Script Problem
            120615 by: tony.tabzilla.com
            120617 by: John W. Holmes

    problems with odbc fuctions
            120616 by: Jeff Bluemel

    odbc_num_rows always returnes -1
            120618 by: Jeff Bluemel
            120619 by: John W. Holmes

    Not a Valid MySQL-Link Resource
            120622 by: Stephen
            120623 by: John Nichel
            120624 by: Stephen
            120625 by: Sascha Cunz
            120626 by: Stephen
            120627 by: John Nichel
            120628 by: Sascha Cunz
            120629 by: Stephen
            120631 by: Sascha Cunz
            120632 by: Stephen

    Re: URL Opening
            120633 by: Steve Yates

    Re: php/frontpage
            120634 by: Steve Yates

    Re: Newbie NN4 help...
            120635 by: Stephanie Sullivan
            120636 by: Stephanie Sullivan
            120637 by: Stephanie Sullivan

    Regex help
            120638 by: Gerard Samuel
            120639 by: Joona Kulmala

    MySQL Insert Select statement
            120640 by: dwalker

    Re: [PHP-DB] MySQL Insert Select statement
            120641 by: John W. Holmes
            120642 by: dwalker
            120643 by: Jeffrey_N_Dyke.Keane.com

    time stamps
            120644 by: Philip J. Newman
            120646 by: Marco Tabini
            120647 by: Philip J. Newman

    PHP CGI
            120648 by: .: B i g D o g :.

    String extraction from blobs. Extracted string to be placed into field within another table.
            120649 by: dwalker

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    There should really be another table for all of this information. Say
    you're tracking school information for a specific person. That person
    would have an ID number and you'd store the school information in a
    separate table that stores the user's ID and the school ID. You could
    even expand this to track other items by adding a third column that says
    the item being tracked is a school, spell, item, etc. This may seem like
    a pain now, but it's going to be the most scalable solution. Using
    serialize, what happens when someone has all 40 schools and it's over
    255 characters? Do you make them all text columns?

    An ideal solution would involve a variety of tables. Table 1: Users.
    This would store user information such as name, rank, etc, and assign
    each one a unique ID. Table 2: Schools. This would list all of the
    possible schools that someone can take and assign each one a unique ID.
    Table 3: Spells. This would list all of the possible spells and assign
    each one a unique ID. Table 4: Call it what you want but this table is
    going to link the user IDs to school and magic IDs. If a user
    (User_ID=1) has schools abjuration (ID=2) and conjuration (ID=5), then
    you'd have two rows in this linking table, 1-2 and 1-5.

    Okay... I've blabbered enough.

    ---John Holmes...

    > -----Original Message-----
    > From: Shiloh Madsen [mailto:shiloh_madsennsc-support.com]
    > Sent: Saturday, October 19, 2002 12:48 AM
    > To: php-dblists.php.net
    > Cc: php-generallists.php.net
    > Subject: [PHP] Enum table entry
    >
    > Have a question that im trying to figure out how to resolve. I have a
    > field type in mysql that is of the enum type. Unless youre familiar
    with
    > Dungeons and Dragons, you wont get what the values mean, but hopefully
    > youll get the gist anyway. I have a column labelled school which holds
    an
    > enum data type comprised of the values 1 through 40. From the website
    > front end, where the data is being entered, i want to display, ideally
    a
    > series of checkboxes, otherwise a list which would allow a user to
    select
    > multiple items in that will translate into this enum field. For
    instance,
    > a series of checkboxes with items such as abjuration, conjuration,
    > divination, and others, which will all have a numeric value which gets
    > plugged into the enum field. for instance, if a user selected
    abjuration,
    > and divination, it would be plugged into sql as 1, 3 (or however enum
    data
    > is input into its column). That being the case how do i utilize php to
    get
    > this to work? what kind of form elements etc... The problem im seeing
    with
    > checkboxes are that they are discreet and dont group together, so i
    cant
    > get all the data to go into one column in mysql. Hopefully i havent
    > horribly confused the issue and some kind soul out there can tell me
    how
    > to send this data across. As a double nice thing...how would you write
    it
    > to pull the data back out...ie, convert 1, 3 to show abjuration,
    > divination? Thanks for the help in advance.

    attached mail follows:


    Is there any way that I could run the GD library as a cgi? If so could
    anyone point me to a good resource on how to set it up?

    Thanks

    attached mail follows:


    Uh? You mean run PHP as a CGI linked against GD? Sure, just compile the
    CGI version of PHP with the same flags as your Apache module version and
    remove the --with-apxs.

    -Rasmus

    On Sat, 19 Oct 2002, Gabe wrote:

    >
    > Is there any way that I could run the GD library as a cgi? If so could
    > anyone point me to a good resource on how to set it up?
    >
    > Thanks
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >

    attached mail follows:


    I was thinking maybe that GD could run as a stand-alone thing.

    Rasmus Lerdorf wrote:

    >Uh? You mean run PHP as a CGI linked against GD? Sure, just compile the
    >CGI version of PHP with the same flags as your Apache module version and
    >remove the --with-apxs.
    >
    >-Rasmus
    >
    >On Sat, 19 Oct 2002, Gabe wrote:
    >
    >
    >
    >>Is there any way that I could run the GD library as a cgi? If so could
    >>anyone point me to a good resource on how to set it up?
    >>
    >>Thanks
    >>
    >>
    >>--
    >>PHP General Mailing List (http://www.php.net/)
    >>To unsubscribe, visit: http://www.php.net/unsub.php
    >>
    >>
    >>
    >
    >
    >

    attached mail follows:


    Nope. GD is just an image library. It needs something around it.

    On Sat, 19 Oct 2002, Gabe wrote:

    > I was thinking maybe that GD could run as a stand-alone thing.
    >
    > Rasmus Lerdorf wrote:
    >
    > >Uh? You mean run PHP as a CGI linked against GD? Sure, just compile the
    > >CGI version of PHP with the same flags as your Apache module version and
    > >remove the --with-apxs.
    > >
    > >-Rasmus
    > >
    > >On Sat, 19 Oct 2002, Gabe wrote:
    > >
    > >
    > >
    > >>Is there any way that I could run the GD library as a cgi? If so could
    > >>anyone point me to a good resource on how to set it up?
    > >>
    > >>Thanks
    > >>
    > >>
    > >>--
    > >>PHP General Mailing List (http://www.php.net/)
    > >>To unsubscribe, visit: http://www.php.net/unsub.php
    > >>
    > >>
    > >>
    > >
    > >
    > >
    >
    >

    attached mail follows:


    Hello,

    Not really a question about PHP but I am sure you will not mind helping me
    ...

    To avoid the URL of the pages to appear in the address bar, I would like to
    work with frames. Though, what happens then if the user wants to put the
    site in his favorites ? Which page (frame or frame content ?) is stored in
    the favorites ? How can I control this ?

    By advance, thank you for your help.

    Regards,

                    Jean-Marc

    attached mail follows:


    Hi,

    This depents on the visitor's browser, mostly the url of the frameset
    and the url's of all frames are stored, but in some browsers only the
    url of the frameset is stored. You can't handle this from the web-page.

    Yours,
    Maurits Lawende

    Jean-Marc Godart wrote:

    >Hello,
    >
    >Not really a question about PHP but I am sure you will not mind helping me
    >...
    >
    >To avoid the URL of the pages to appear in the address bar, I would like to
    >work with frames. Though, what happens then if the user wants to put the
    >site in his favorites ? Which page (frame or frame content ?) is stored in
    >the favorites ? How can I control this ?
    >
    >By advance, thank you for your help.
    >
    >Regards,
    >
    > Jean-Marc
    >
    >
    >
    >
    >
    >

    attached mail follows:


    After one appropriates an image - let's say a .jpg file - from another URL
    using a PHP function like fopen(),etc., can one then manipulate that file?

    In this case - resize that .jpg file to a different size for output?

    Thank you.
    Tony Ritter

    attached mail follows:


    Open it with the image functions, then you can.

    On Sat, 19 Oct 2002, Anthony Ritter wrote:

    > After one appropriates an image - let's say a .jpg file - from another URL
    > using a PHP function like fopen(),etc., can one then manipulate that file?
    >
    > In this case - resize that .jpg file to a different size for output?
    >
    > Thank you.
    > Tony Ritter
    >
    >
    >
    >
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >

    attached mail follows:


    Man, that was quick.

    Thanks Rasmus.

    Under five seconds for a response.

    Do you have any URL's that I could take a look at?

    TR

    attached mail follows:


    php.net/image

    On Sat, 19 Oct 2002, Anthony Ritter wrote:

    > Man, that was quick.
    >
    > Thanks Rasmus.
    >
    > Under five seconds for a response.
    >
    > Do you have any URL's that I could take a look at?
    >
    > TR
    >
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >

    attached mail follows:


    Right on!! Thanks!

    Design and parsing question:

    I need to keep the latest five files in a directory, so my design is to
    read in the file names with the date time as a prefix separated by a "|"
    (e.g. "2002 10 20 | myfile.txt") and put these into an array. Then I'll
    sort the array in decending order and delete all of the files but the
    top five. Is this a good design?

    If it is, I always get confused with the powerful string manipulation in
    PHP (I come from a Delphi background). How do I get the file name
    string from the concatenated string?

    Todd

    -- 
    Ariste Software, Petaluma, CA 94952
    

    attached mail follows:


    It's not strictly php, but does anyone know an easy way to duplicate a record in MySQL. It would be nice if you could write something like:

    COPY * from table WHERE id = 6;

    and have it insert a new record into the table with the next id number.

    Roger Lewis

    attached mail follows:


    Seems like there's no easy way...

    http://www.mysql.com/doc/en/INSERT_SELECT.html

    - E

    On Sunday, October 20, 2002 2:04 AM Roger Lewis wrote:

    > It's not strictly php, but does anyone know an easy way to duplicate a > record in MySQL. It would be nice if you could write something like: > > COPY * from table WHERE id = 6; > > and have it insert a new record into the table with the next id number. > > Roger Lewis > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > It's not strictly php, but does anyone know an easy way to duplicate a > record in MySQL. It would be nice if you could write something like: > > COPY * from table WHERE id = 6; > > and have it insert a new record into the table with the next id number.

    I think that if you have to do this, you've got design issues. Why not just keep a "count" column in the row and increment that, instead of duplicating the row.

    ---John Holmes...

    attached mail follows:


    >> It's not strictly php, but does anyone know an easy way to duplicate a >> record in MySQL. It would be nice if you could write something like: >> >> COPY * from table WHERE id = 6; >> >> and have it insert a new record into the table with the next id >>number.

    >I think that if you have to do this, you've got design issues. Why not >just keep a "count" column in the row and increment that, instead of >duplicating the row.

    >---John Holmes... John, Here's the application: I'm creating a daily report online, eg. with Title, Report no., Date, Author, Subject Headings, Text, etc., etc.. The report is stored in a MySQL table. When it comes time to write a new report, I would like to be able to call up an existing report, upon which to base the new one, and copy the record. Then make changes where necessary and update the record. Roger

    attached mail follows:


    > >> It's not strictly php, but does anyone know an easy way to duplicate a > >> record in MySQL. It would be nice if you could write something like: > >> > >> COPY * from table WHERE id = 6; > >> > >> and have it insert a new record into the table with the next id > >>number. > > >I think that if you have to do this, you've got design issues. Why not > >just keep a "count" column in the row and increment that, instead of > >duplicating the row. > > >---John Holmes... > John, > Here's the application: I'm creating a daily report online, eg. with > Title, > Report no., Date, Author, Subject Headings, Text, etc., etc.. The report > is > stored in a MySQL table. When it comes time to write a new report, I > would > like to be able to call up an existing report, upon which to base the new > one, and copy the record. Then make changes where necessary and update > the > record.

    So have PHP select out the row you want to "copy", make your changes to it with PHP or a form, then have PHP insert a new row into the database. Why copy data when you're going to change it.

    ---John Holmes...

    attached mail follows:


    -----Original Message----- From: John W. Holmes [mailto:holmes072000charter.net] Sent: Saturday, October 19, 2002 12:52 PM To: 'Roger Lewis'; 'Php-General' Subject: RE: [PHP] Duplicating a Record in MySQL

    * >> It's not strictly php, but does anyone know an easy way to duplicate a > >> record in MySQL. It would be nice if you could write something like: > >> > >> COPY * from table WHERE id = 6; > >> > >> and have it insert a new record into the table with the next id > >>number. > > >I think that if you have to do this, you've got design issues. Why not > >just keep a "count" column in the row and increment that, instead of > >duplicating the row. > > >---John Holmes... > John, > Here's the application: I'm creating a daily report online, eg. with > Title, > Report no., Date, Author, Subject Headings, Text, etc., etc.. The report > is > stored in a MySQL table. When it comes time to write a new report, I > would > like to be able to call up an existing report, upon which to base the new > one, and copy the record. Then make changes where necessary and update > the > record.

    So have PHP select out the row you want to "copy", make your changes to it with PHP or a form, then have PHP insert a new row into the database. Why copy data when you're going to change it.

    ---John Holmes... Well, you're probably right. I've been working with Adobe GoLive, and have been using the CopyFormData command, so that's where I got the idea. I ran into trouble with GoLive when I complicated my report form by adding file attachments. Anyway, here's a condensed version of code base on what Stephen Knight suggested. (Thanks, Stephen). I'll work on this to try and avoid the copying step as you are suggesting.

    $sql = "select * from daily_reports where report_no = '$report_no' "; $result = mysql_query($sql); $x = mysql_fetch_row($result); $fields = "report_no, order_no, report_date, project_no, project_name, client, title, subtitle, author, company, summary_heading, summary, section1_heading, section1"; $values = " '$x[1]', '$x[2]', '$x[3]', '$x[4]', '$x[5]', '$x[6]', '$x[7]', '$x[8]', '$x[9]', '$x[10]', '$x[11]', '$x[12]', '$x[13]', '$x[14]' "; // Note: There must be a way to have PHP generate the previous line, but I don't know how. $sql = "INSERT INTO daily_reports ($fields) VALUES ($values)"; mysql_query($sql);

    Thanks, Roger

    attached mail follows:


    Well, I confess that I have not read the entire thread. But MySQL does provide a INSERT from SELECT syntax which I have used often.

    David

    ----- Original Message ----- From: "Roger Lewis" <re.lewisattbi.com> To: <holmes072000charter.net>; "'Php-General'" <php-generallists.php.net> Sent: Saturday, October 19, 2002 1:45 PM Subject: RE: [PHP] Duplicating a Record in MySQL

    > > > -----Original Message----- > From: John W. Holmes [mailto:holmes072000charter.net] > Sent: Saturday, October 19, 2002 12:52 PM > To: 'Roger Lewis'; 'Php-General' > Subject: RE: [PHP] Duplicating a Record in MySQL > > * >> It's not strictly php, but does anyone know an easy way to > duplicate a > > >> record in MySQL. It would be nice if you could write something > like: > > >> > > >> COPY * from table WHERE id = 6; > > >> > > >> and have it insert a new record into the table with the next id > > >>number. > > > > >I think that if you have to do this, you've got design issues. Why > not > > >just keep a "count" column in the row and increment that, instead of > > >duplicating the row. > > > > >---John Holmes... > > John, > > Here's the application: I'm creating a daily report online, eg. with > > Title, > > Report no., Date, Author, Subject Headings, Text, etc., etc.. The > report > > is > > stored in a MySQL table. When it comes time to write a new report, I > > would > > like to be able to call up an existing report, upon which to base the > new > > one, and copy the record. Then make changes where necessary and > update > > the > > record. > > So have PHP select out the row you want to "copy", make your changes to > it with PHP or a form, then have PHP insert a new row into the database. > Why copy data when you're going to change it. > > ---John Holmes... > Well, you're probably right. I've been working with Adobe GoLive, and have > been using the CopyFormData command, so that's where I got the idea. I ran > into trouble with GoLive when I complicated my report form by adding file > attachments. Anyway, here's a condensed version of code base on what > Stephen Knight suggested. (Thanks, Stephen). I'll work on this to try and > avoid the copying step as you are suggesting. > > $sql = "select * from daily_reports where report_no = '$report_no' "; > $result = mysql_query($sql); > $x = mysql_fetch_row($result); > $fields = "report_no, order_no, report_date, project_no, project_name, > client, title, subtitle, author, company, summary_heading, > summary, section1_heading, section1"; > $values = " '$x[1]', '$x[2]', '$x[3]', '$x[4]', '$x[5]', '$x[6]', '$x[7]', > '$x[8]', > '$x[9]', '$x[10]', '$x[11]', '$x[12]', '$x[13]', '$x[14]' "; > // Note: There must be a way to have PHP generate the previous line, but I > don't know how. > $sql = "INSERT INTO daily_reports ($fields) VALUES ($values)"; > mysql_query($sql); > > Thanks, Roger > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    I have a bug in my file upload script, the error i get returned is:

    Warning: Unable to open '/home/tabzilla/public_html/phpvj2Bg5' for reading: No such file or directory in /home/tabzilla/public_html/doadd.php on line 9 failed to copy file

    when trying to upload a file called SLIME.TXT.

    Here is the form code:

    <form action="doadd.php" enctype="multipart/form-data" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="10000"><input type="File" name="userfile" size="30" maxlength="255"> <input type="submit" name="submit" value="Add Tab/Lyric"> </form>

    Here is the action script to handle uploading the file...

    <?php require("settings.php"); require("common.php");

    function do_upload($filename,$newname) { $file = basename($filename); $tmp_upload_path = "/home/tabzilla/public_html/"; $new_file_name = "/home/tabzilla/public_html/" . $newname; if (!copy($tmp_upload_path.$file, $new_file_name)) { echo "failed to copy file<br>\n"; exit(); } }

    $newname = "upload.txt"; do_upload($userfile, $newname); $fp = fopen("upload.txt", "r"); $content = fread($fp, 10240); fclose($fp); unlink("upload.txt"); ?>

    If anyone has any ideas i would love to hear them. Thankyou.

    attached mail follows:


    > I have a bug in my file upload script, the error i get returned is: > > Warning: Unable to open '/home/tabzilla/public_html/phpvj2Bg5' for > reading: > No such file or directory in /home/tabzilla/public_html/doadd.php on line > 9 > failed to copy file > > when trying to upload a file called SLIME.TXT. > > Here is the form code: > > <form action="doadd.php" enctype="multipart/form-data" method="POST"> > <input type="hidden" name="MAX_FILE_SIZE" value="10000"><input type="File" > name="userfile" size="30" maxlength="255"> > <input type="submit" name="submit" value="Add Tab/Lyric"> > </form> > > Here is the action script to handle uploading the file... > > <?php > require("settings.php"); > require("common.php"); > > function do_upload($filename,$newname) { > $file = basename($filename); > $tmp_upload_path = "/home/tabzilla/public_html/"; > $new_file_name = "/home/tabzilla/public_html/" . $newname; > if (!copy($tmp_upload_path.$file, $new_file_name)) { echo "failed to

    Try copy($filename,$new_file_name)

    The file is uploaded to the system temp directory, not /home/tabzilla/public_html/ more than likely.

    You might want to look at the move_uploaded_file() function, too.

    ---John Holmes...

    attached mail follows:


    I recompiled php 4.2.3 using (copied from phpinfo()) '--with-unixODBC' . However, I am able to use some of the odbc functions like odbc_connect or odbc_pconnect, odbc_num_rows.

    however, some factions like odbc_fetch_array give me errors. it believe it's missing some components, but I'm not sure what components.

    Jeff

    attached mail follows:


    I've got the following code, and regardless if it finds something or not odbc_num_rows returns -1 as the value? curious what I should I use to test whether or not something was found? (the database I am connecting to is Informix running on a different server)

    $sql = odbc_exec($$ntslink,"SELECT lot_card_num_k AS pin, current_balance AS balance, first_use_date AS first, lot_num_f AS batch, status_flag AS status, zombie_date AS expired, sequence_number AS serial, zombie_method AS reason FROM lot_card WHERE lot_card_num_k = '$pin';") or die("Invalid ODBCQuery"); $numrows = odbc_num_rows($sql) if ($numrows <= 0 )

    attached mail follows:


    > I've got the following code, and regardless if it finds something or not > odbc_num_rows returns -1 as the value? curious what I should I use to > test > whether or not something was found? (the database I am connecting to is > Informix running on a different server) > > $sql = odbc_exec($$ntslink,"SELECT lot_card_num_k AS pin, current_balance > AS > balance, first_use_date AS first, lot_num_f AS batch, status_flag AS > status, > zombie_date AS expired, sequence_number AS serial, zombie_method AS reason > FROM lot_card WHERE lot_card_num_k = '$pin';") or > die("Invalid ODBCQuery"); > $numrows = odbc_num_rows($sql) if ($numrows <= 0 )

    Maybe something like this?

    if($row = odbc_fetch_array($sql)) { do{ //process rows }while($row = odbc_fetch_array($sql)); } else { echo "no rows returned"; }

    ---John Holmes...

    attached mail follows:


    Hello,

    I'm having some trouble understanding this error I'm getting. Here's the error:

    Warning: mysql_query(): supplied resource is not a valid MySQL-Link resource in c:\phpdev5\www\newsletter\index.php on line 38

    Now here's the block of code that goes into the query:

    $key = $HTTP_GET_VARS['key']; $email = $HTTP_GET_VARS['email']; $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; $query = mysql_query($sql, $main);

    Please help!

    Thanks, Stephen Craton http://www.melchior.us http://php.melchior.us

    attached mail follows:


    What's $main? What does you connection string look like?

    Stephen wrote: > Hello, > > I'm having some trouble understanding this error I'm getting. Here's the error: > > Warning: mysql_query(): supplied resource is not a valid MySQL-Link resource in c:\phpdev5\www\newsletter\index.php on line 38 > > Now here's the block of code that goes into the query: > > $key = $HTTP_GET_VARS['key']; > $email = $HTTP_GET_VARS['email']; > $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; > $query = mysql_query($sql, $main); > > Please help! > > > Thanks, > Stephen Craton > http://www.melchior.us > http://php.melchior.us

    attached mail follows:


    Here's $main:

    $main = mysql_pconnect($hostname_main, $username_main, $password_main) or die(mysql_error());

    I won't give the user, host, pass, etc for obvious reasons. I'm connecting to the database jsut fine though.

    ----- Original Message ----- From: "John Nichel" <jnichelby-tor.com> To: "Stephen" <webmastermelchior.us> Cc: "PHP List" <php-generallists.php.net> Sent: Saturday, October 19, 2002 3:33 PM Subject: Re: [PHP] Not a Valid MySQL-Link Resource

    > What's $main? What does you connection string look like? > > Stephen wrote: > > Hello, > > > > I'm having some trouble understanding this error I'm getting. Here's the error: > > > > Warning: mysql_query(): supplied resource is not a valid MySQL-Link resource in c:\phpdev5\www\newsletter\index.php on line 38 > > > > Now here's the block of code that goes into the query: > > > > $key = $HTTP_GET_VARS['key']; > > $email = $HTTP_GET_VARS['email']; > > $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; > > $query = mysql_query($sql, $main); > > > > Please help! > > > > > > Thanks, > > Stephen Craton > > http://www.melchior.us > > http://php.melchior.us > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    At the point, where you get the obvious error, $main might not be set correctly; this is just, what PHP complains about.

    Sascha

    Am Samstag, 19. Oktober 2002 22:33 schrieb Stephen: > Here's $main: > > $main = mysql_pconnect($hostname_main, $username_main, $password_main) or > die(mysql_error()); > > I won't give the user, host, pass, etc for obvious reasons. I'm connecting > to the database jsut fine though. > > ----- Original Message ----- > From: "John Nichel" <jnichelby-tor.com> > To: "Stephen" <webmastermelchior.us> > Cc: "PHP List" <php-generallists.php.net> > Sent: Saturday, October 19, 2002 3:33 PM > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > What's $main? What does you connection string look like? > > > > Stephen wrote: > > > Hello, > > > > > > I'm having some trouble understanding this error I'm getting. Here's > > > the > > error: > > > Warning: mysql_query(): supplied resource is not a valid MySQL-Link > > resource in c:\phpdev5\www\newsletter\index.php on line 38 > > > > Now here's the block of code that goes into the query: > > > > > > $key = $HTTP_GET_VARS['key']; > > > $email = $HTTP_GET_VARS['email']; > > > $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; > > > $query = mysql_query($sql, $main); > > > > > > Please help! > > > > > > > > > Thanks, > > > Stephen Craton > > > http://www.melchior.us > > > http://php.melchior.us > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I'm using $main to get other database information, though, and that it's getting that just fine...

    ----- Original Message ----- From: "Sascha Cunz" <SaschaGaNoAn.org> To: "Stephen" <webmastermelchior.us>; "PHP List" <php-generallists.php.net> Sent: Saturday, October 19, 2002 3:41 PM Subject: Re: [PHP] Not a Valid MySQL-Link Resource

    At the point, where you get the obvious error, $main might not be set correctly; this is just, what PHP complains about.

    Sascha

    Am Samstag, 19. Oktober 2002 22:33 schrieb Stephen: > Here's $main: > > $main = mysql_pconnect($hostname_main, $username_main, $password_main) or > die(mysql_error()); > > I won't give the user, host, pass, etc for obvious reasons. I'm connecting > to the database jsut fine though. > > ----- Original Message ----- > From: "John Nichel" <jnichelby-tor.com> > To: "Stephen" <webmastermelchior.us> > Cc: "PHP List" <php-generallists.php.net> > Sent: Saturday, October 19, 2002 3:33 PM > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > What's $main? What does you connection string look like? > > > > Stephen wrote: > > > Hello, > > > > > > I'm having some trouble understanding this error I'm getting. Here's > > > the > > error: > > > Warning: mysql_query(): supplied resource is not a valid MySQL-Link > > resource in c:\phpdev5\www\newsletter\index.php on line 38 > > > > Now here's the block of code that goes into the query: > > > > > > $key = $HTTP_GET_VARS['key']; > > > $email = $HTTP_GET_VARS['email']; > > > $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; > > > $query = mysql_query($sql, $main); > > > > > > Please help! > > > > > > > > > Thanks, > > > Stephen Craton > > > http://www.melchior.us > > > http://php.melchior.us > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

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

    attached mail follows:


    Try this...

    Before you run the query....

    mysql_select_db ( "database_the_table_is_in" );

    or change your query to read....

    "SELECT * FROM database_the_table_is_in.users WHERE key='$key' AND email='$email'";

    Stephen wrote: > Here's $main: > > $main = mysql_pconnect($hostname_main, $username_main, $password_main) or > die(mysql_error()); > > I won't give the user, host, pass, etc for obvious reasons. I'm connecting > to the database jsut fine though. > > ----- Original Message ----- > From: "John Nichel" <jnichelby-tor.com> > To: "Stephen" <webmastermelchior.us> > Cc: "PHP List" <php-generallists.php.net> > Sent: Saturday, October 19, 2002 3:33 PM > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > >>What's $main? What does you connection string look like? >> >>Stephen wrote: >> >>>Hello, >>> >>>I'm having some trouble understanding this error I'm getting. Here's the >> > error: > >>>Warning: mysql_query(): supplied resource is not a valid MySQL-Link >> > resource in c:\phpdev5\www\newsletter\index.php on line 38 > >>>Now here's the block of code that goes into the query: >>> >>> $key = $HTTP_GET_VARS['key']; >>> $email = $HTTP_GET_VARS['email']; >>> $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; >>> $query = mysql_query($sql, $main); >>> >>>Please help! >>> >>> >>>Thanks, >>>Stephen Craton >>>http://www.melchior.us >>>http://php.melchior.us >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > >

    attached mail follows:


    Well, there are a 10000 conditions where this could happen.

    Are you in a function and have to do: global $main; ? Is some other part overwriting $main?

    What says print_r($main); directly before calling that mysql_query-statement?

    Sascha

    Am Samstag, 19. Oktober 2002 22:37 schrieb Stephen: > I'm using $main to get other database information, though, and that it's > getting that just fine... > > > ----- Original Message ----- > From: "Sascha Cunz" <SaschaGaNoAn.org> > To: "Stephen" <webmastermelchior.us>; "PHP List" > <php-generallists.php.net> > Sent: Saturday, October 19, 2002 3:41 PM > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > At the point, where you get the obvious error, $main might not be set > correctly; this is just, what PHP complains about. > > Sascha > > Am Samstag, 19. Oktober 2002 22:33 schrieb Stephen: > > Here's $main: > > > > $main = mysql_pconnect($hostname_main, $username_main, $password_main) or > > die(mysql_error()); > > > > I won't give the user, host, pass, etc for obvious reasons. I'm > > connecting to the database jsut fine though. > > > > ----- Original Message ----- > > From: "John Nichel" <jnichelby-tor.com> > > To: "Stephen" <webmastermelchior.us> > > Cc: "PHP List" <php-generallists.php.net> > > Sent: Saturday, October 19, 2002 3:33 PM > > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > > > What's $main? What does you connection string look like? > > > > > > Stephen wrote: > > > > Hello, > > > > > > > > I'm having some trouble understanding this error I'm getting. Here's > > > > the > > > > error: > > > > Warning: mysql_query(): supplied resource is not a valid MySQL-Link > > > > resource in c:\phpdev5\www\newsletter\index.php on line 38 > > > > > > Now here's the block of code that goes into the query: > > > > > > > > $key = $HTTP_GET_VARS['key']; > > > > $email = $HTTP_GET_VARS['email']; > > > > $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; > > > > $query = mysql_query($sql, $main); > > > > > > > > Please help! > > > > > > > > > > > > Thanks, > > > > Stephen Craton > > > > http://www.melchior.us > > > > http://php.melchior.us > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I'm not in a function though I tried the global anyway, same error.

    Nothing is overwriting $main and when I put print_r($main), nothing showed.

    ----- Original Message ----- From: "Sascha Cunz" <SaschaGaNoAn.org> To: "Stephen" <webmastermelchior.us>; "PHP List" <php-generallists.php.net> Sent: Saturday, October 19, 2002 3:45 PM Subject: Re: [PHP] Not a Valid MySQL-Link Resource

    Well, there are a 10000 conditions where this could happen.

    Are you in a function and have to do: global $main; ? Is some other part overwriting $main?

    What says print_r($main); directly before calling that mysql_query-statement?

    Sascha

    Am Samstag, 19. Oktober 2002 22:37 schrieb Stephen: > I'm using $main to get other database information, though, and that it's > getting that just fine... > > > ----- Original Message ----- > From: "Sascha Cunz" <SaschaGaNoAn.org> > To: "Stephen" <webmastermelchior.us>; "PHP List" > <php-generallists.php.net> > Sent: Saturday, October 19, 2002 3:41 PM > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > At the point, where you get the obvious error, $main might not be set > correctly; this is just, what PHP complains about. > > Sascha > > Am Samstag, 19. Oktober 2002 22:33 schrieb Stephen: > > Here's $main: > > > > $main = mysql_pconnect($hostname_main, $username_main, $password_main) or > > die(mysql_error()); > > > > I won't give the user, host, pass, etc for obvious reasons. I'm > > connecting to the database jsut fine though. > > > > ----- Original Message ----- > > From: "John Nichel" <jnichelby-tor.com> > > To: "Stephen" <webmastermelchior.us> > > Cc: "PHP List" <php-generallists.php.net> > > Sent: Saturday, October 19, 2002 3:33 PM > > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > > > What's $main? What does you connection string look like? > > > > > > Stephen wrote: > > > > Hello, > > > > > > > > I'm having some trouble understanding this error I'm getting. Here's > > > > the > > > > error: > > > > Warning: mysql_query(): supplied resource is not a valid MySQL-Link > > > > resource in c:\phpdev5\www\newsletter\index.php on line 38 > > > > > > Now here's the block of code that goes into the query: > > > > > > > > $key = $HTTP_GET_VARS['key']; > > > > $email = $HTTP_GET_VARS['email']; > > > > $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; > > > > $query = mysql_query($sql, $main); > > > > > > > > Please help! > > > > > > > > > > > > Thanks, > > > > Stephen Craton > > > > http://www.melchior.us > > > > http://php.melchior.us > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php

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

    attached mail follows:


    Does print_r($main); show anything directly after your mysql_connect?

    $main must get lost somewhere on the way, i think - but this seems strange.

    Sascha

    Am Samstag, 19. Oktober 2002 22:44 schrieb Stephen: > I'm not in a function though I tried the global anyway, same error. > > Nothing is overwriting $main and when I put print_r($main), nothing showed. > > > ----- Original Message ----- > From: "Sascha Cunz" <SaschaGaNoAn.org> > To: "Stephen" <webmastermelchior.us>; "PHP List" > <php-generallists.php.net> > Sent: Saturday, October 19, 2002 3:45 PM > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > Well, there are a 10000 conditions where this could happen. > > Are you in a function and have to do: global $main; ? > Is some other part overwriting $main? > > What says print_r($main); directly before calling that > mysql_query-statement? > > Sascha > > Am Samstag, 19. Oktober 2002 22:37 schrieb Stephen: > > I'm using $main to get other database information, though, and that it's > > getting that just fine... > > > > > > ----- Original Message ----- > > From: "Sascha Cunz" <SaschaGaNoAn.org> > > To: "Stephen" <webmastermelchior.us>; "PHP List" > > <php-generallists.php.net> > > Sent: Saturday, October 19, 2002 3:41 PM > > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > > > > At the point, where you get the obvious error, $main might not be set > > correctly; this is just, what PHP complains about. > > > > Sascha > > > > Am Samstag, 19. Oktober 2002 22:33 schrieb Stephen: > > > Here's $main: > > > > > > $main = mysql_pconnect($hostname_main, $username_main, $password_main) > > or > > > > die(mysql_error()); > > > > > > I won't give the user, host, pass, etc for obvious reasons. I'm > > > connecting to the database jsut fine though. > > > > > > ----- Original Message ----- > > > From: "John Nichel" <jnichelby-tor.com> > > > To: "Stephen" <webmastermelchior.us> > > > Cc: "PHP List" <php-generallists.php.net> > > > Sent: Saturday, October 19, 2002 3:33 PM > > > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > > > > > What's $main? What does you connection string look like? > > > > > > > > Stephen wrote: > > > > > Hello, > > > > > > > > > > I'm having some trouble understanding this error I'm getting. > > > > > Here's the > > > > > > error: > > > > > Warning: mysql_query(): supplied resource is not a valid MySQL-Link > > > > > > resource in c:\phpdev5\www\newsletter\index.php on line 38 > > > > > > > > Now here's the block of code that goes into the query: > > > > > > > > > > $key = $HTTP_GET_VARS['key']; > > > > > $email = $HTTP_GET_VARS['email']; > > > > > $sql = "SELECT * FROM users WHERE key='$key' AND > > email='$email'"; > > > > > > $query = mysql_query($sql, $main); > > > > > > > > > > Please help! > > > > > > > > > > > > > > > Thanks, > > > > > Stephen Craton > > > > > http://www.melchior.us > > > > > http://php.melchior.us > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    No, but I have fixed it. I created a function to connect to the db instead of connecting to it each time using mysql_pconnect(). Thanks for your help!

    ----- Original Message ----- From: "John Nichel" <jnichelby-tor.com> To: "Stephen" <webmastermelchior.us> Sent: Saturday, October 19, 2002 3:50 PM Subject: Re: [PHP] Not a Valid MySQL-Link Resource

    > Are you closing off the connection anywhere in the script? Possible > that it's getting closed prior to excuting the query? Have you tried it > without using a persistant connection, just mysql_connect()? > > Stephen wrote: > > Same error. I did put mysql_select_db() once before I sent the email and I > > got the same error but twice. > > > > > > ----- Original Message ----- > > From: "John Nichel" <jnichelby-tor.com> > > To: "Stephen" <webmastermelchior.us> > > Cc: "PHP List" <php-generallists.php.net> > > Sent: Saturday, October 19, 2002 3:41 PM > > Subject: Re: [PHP] Not a Valid MySQL-Link Resource > > > > > > > >>Try this... > >> > >>Before you run the query.... > >> > >>mysql_select_db ( "database_the_table_is_in" ); > >> > >>or change your query to read.... > >> > >>"SELECT * FROM database_the_table_is_in.users WHERE key='$key' AND > >>email='$email'"; > >> > >>Stephen wrote: > >> > >>>Here's $main: > >>> > >>>$main = mysql_pconnect($hostname_main, $username_main, $password_main) > >> > > or > > > >>>die(mysql_error()); > >>> > >>>I won't give the user, host, pass, etc for obvious reasons. I'm > >> > > connecting > > > >>>to the database jsut fine though. > >>> > >>>----- Original Message ----- > >>>From: "John Nichel" <jnichelby-tor.com> > >>>To: "Stephen" <webmastermelchior.us> > >>>Cc: "PHP List" <php-generallists.php.net> > >>>Sent: Saturday, October 19, 2002 3:33 PM > >>>Subject: Re: [PHP] Not a Valid MySQL-Link Resource > >>> > >>> > >>> > >>> > >>>>What's $main? What does you connection string look like? > >>>> > >>>>Stephen wrote: > >>>> > >>>> > >>>>>Hello, > >>>>> > >>>>>I'm having some trouble understanding this error I'm getting. Here's > >>>> > > the > > > >>>error: > >>> > >>> > >>>>>Warning: mysql_query(): supplied resource is not a valid MySQL-Link > >>>> > >>>resource in c:\phpdev5\www\newsletter\index.php on line 38 > >>> > >>> > >>>>>Now here's the block of code that goes into the query: > >>>>> > >>>>> $key = $HTTP_GET_VARS['key']; > >>>>> $email = $HTTP_GET_VARS['email']; > >>>>> $sql = "SELECT * FROM users WHERE key='$key' AND email='$email'"; > >>>>> $query = mysql_query($sql, $main); > >>>>> > >>>>>Please help! > >>>>> > >>>>> > >>>>>Thanks, > >>>>>Stephen Craton > >>>>>http://www.melchior.us > >>>>>http://php.melchior.us > >>>> > >>>> > >>>> > >>>>-- > >>>>PHP General Mailing List (http://www.php.net/) > >>>>To unsubscribe, visit: http://www.php.net/unsub.php > >>>> > >>>> > >>> > >>> > >>> > >> > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > > > > > > > > > > > >

    attached mail follows:


    "Vivek" <deadghostsify.com> wrote in message news:3DB117A6.4B3B988sify.com... > wish is when a user is found Valid my script should open a page in the > browser without showing its URL in the address bar. E.g. If user is > authenticated he should be sent to "http://callmgmt.org/menu.htm" and if > he is not a valid user then he should be redirected to > "http://callmgmt.org/login.htm" without showing menu.htm or login.htm

    Another approach might be to have the same .php page be the login, validation, and menu page. Pseudocode for index.php:

    if (logged in) show menu page else show login page (form posts to index.php) end

    - Steve Yates - Why do lemmings always jump to conclusions?

    ~ Do you like my taglines? Add them to your messages and ~ laugh through hundreds more by downloading Taglinator ~ at www.srtware.com today!

    attached mail follows:


    "Timothy Hitchens" <timhitcho.com.au> wrote in message news:3DB0F497.5080000hitcho.com.au... > Frontpage doesn't recognise <?php so I would suggest the following that does work: > > <script language="php"> > echo 'Hello'; > </script>

    Duh, guess it's been a while since I used FrontPage. :)

    - Steve Yates - If at first you don't succeed, the heck with it.

    ~ Do you like my taglines? Add them to your messages and ~ laugh through hundreds more by downloading Taglinator ~ at www.srtware.com today!

    attached mail follows:


    on 10/19/02 1:48 AM, Edwin at copperwallshotmail.com wrote:

    > [snip] >> NN4 doesn't want to play nice... I already know how to serve one > stylesheet to NN and another to >> newer browsers... > [/snip] > > ...then it seems like your problem has nothing to do with PHP.

    Why is that? I have no problem with NN4 SEEING and SHOWING my CSS correctly... My problem lies with SWITCHING to another style sheet using my PHP switcher... And it works in every other browser I tried which is why I thought asking you PHP experts might tell me why there might be a problem with NN4 and some of the PHP coding... I am DEFINITELY NOT a PHP expert... Nor do I know much about it...

    But I do know how to write clean code that works cross browser... And I've done that... Thus my reason for asking about the switcher here. :) > > Remember, NN might not even understand the CSS you are using. So, it's like > making the <blink> tag work in IE...

    It understands... There's no problem with the INITIAL load... Just the switch... > > Also, you might want to check your (strict) DTD and see whether it is > causing any problem with NN.

    Nope... Used it before without a problem... :)

    Thanks...

    Stephanie Sullivan VioletSky Design http://www.violetsky.net

    "Hide not your talents. They for use were made. What's a sundial in the shade." -- Benjamin Franklin

    attached mail follows:


    on 10/18/02 9:54 PM, Chase Urich at chasekc5mpk.com wrote:

    > Why not simply specify them as alternate style sheets as per W3C > recommendations? Check out http://www.alistapart.com/stories/alternate/ > for some great help.

    Because that solution uses javascript (and other than that I HAVE used the alternate stylesheet code that Mozilla reads)... My client has requested I use server side code rather than client-side in case someone is surfing with JS turned off...

    Thus the attempted PHP solution...

    Stephanie Sullivan VioletSky Design http://www.violetsky.net

    "Opportunity is missed by most people because it is dressed in overalls and looks like work." -- Thomas A. Edison

    attached mail follows:


    on 10/18/02 6:00 PM, Kevin Stone at kevinhelpelf.com wrote:

    > Who is shutting who out? Upgrade. That's the clients job, not ours. The > idea that being 100% compatible adds value to your service is a myth..

    Well, though I don't disagree with your premise overall, I must disagree for this particular site... This site is for a psychologist who has a myriad of accessibility requirements which include supporting EVERY version browser (at least by degrading well)... As well as blind, people that can't use a mouse, etc... Yes, it's been quite an ordeal building this site in some ways... And very interesting in others...

    So whether it's a myth or not, that's what he hired me to do. And I will be including a "gentle statement" on why/how to upgrade with a link to the browser upgrade initiative... However, though I hate to admit it, there are many people, my parents included, that have NO CLUE how to download and install ANY kind of software... Hard to understand to us techie people... But the facts... :-/

    Stephanie Sullivan VioletSky Design http://www.violetsky.net

    ³I am always doing that which I can not do, in order that I may learn how to do it." -Picasso

    attached mail follows:


    I have a quoted string, like so -> "test" Since the string may contain multiple words, Im using regex. Im trying -> $search_words = preg_replace('/\"(\w+|\s+)\"/', '$1', $keywords);

    It works great for one word. Using multiple words like -> "this is a test" fails.

    Any ideas??? Thanks

    -- 
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    On Sat, Oct 19, 2002 at 06:55:43PM -0400, Gerard Samuel wrote: > I have a quoted string, like so -> > "test" > Since the string may contain multiple words, Im using regex. > Im trying -> > $search_words = preg_replace('/\"(\w+|\s+)\"/', '$1', $keywords);

    > It works great for one word. Using multiple words like -> > "this is a test" fails.

    This might be the regexp you are looking for.

    $search_words = preg_replace("/\"([^\"]+)\"/", "$1", $keywords);

    So now it matches anything but " between those quotes.

    --
    Joona Kulmala
    joonaphpfi.org
    

    attached mail follows:


    While reading the MySQL manual for INSERT SELECT, I was not able to determine how to include all 5 fields of one table into another table (containing 100 fields) into SPECIFIC data fields. Do I need to explicitly list all the fields within the table of 5 fields? If so, would the statement be:

    INSERT INTO Products (ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName) SELECT(kalproduct.Product, kalproduct.size, kalproduct.SRP, kalproduct.Cat, kalproduct.manname) FROM kalproduct ;

    Thanking you in advance.

    P.S. I'd give it a try, but I'm trying to move 500 partial records into a table containing at least 2000 records -- didn't want to start from scratch.

    This email message and all attachments transmitted herewith are trade secret and/or confidential information intended only for the viewing and use of addressee. If the reader of this message is not the intended recipient, you are hereby notified that any review, use, communication, dissemination, distribution or copying of this communication is prohibited. If you have received this communication is error, please notify the sender immediately by telephone or electronic mail, and delete this message and all copies and backups thereof.

    Thank you for your cooperation.

    attached mail follows:


    That's how you do it. Hopefully you've figured it out already.

    ---John Holmes.

    -----Original Message----- From: dwalker [mailto:dwalkerhealthyproductsplus.com] Sent: Saturday, October 19, 2002 7:51 PM To: professional php; php-dblists.php.net; php-generallists.php.net Subject: [PHP-DB] MySQL Insert Select statement

    While reading the MySQL manual for INSERT SELECT, I was not able to determine how to include all 5 fields of one table into another table (containing 100 fields) into SPECIFIC data fields. Do I need to explicitly list all the fields within the table of 5 fields? If so, would the statement be:

    INSERT INTO Products (ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName)

    SELECT(kalproduct.Product, kalproduct.size, kalproduct.SRP, kalproduct.Cat, kalproduct.manname)

    FROM kalproduct

    ;

    Thanking you in advance.

    P.S. I'd give it a try, but I'm trying to move 500 partial records into a table containing at least 2000 records -- didn't want to start from scratch.

    This email message and all attachments transmitted herewith are trade secret and/or confidential information intended only for the viewing and use of addressee. If the reader of this message is not the intended recipient, you are hereby notified that any review, use, communication, dissemination, distribution or copying of this communication is prohibited. If you have received this communication is error, please notify the sender immediately by telephone or electronic mail, and delete this message and all copies and backups thereof.

    Thank you for your cooperation.

    attached mail follows:


    For some reason the Insert Select statement returned an ERROR and I had to resort to

    INSERT INTO Products (ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName)

    SELECT *

    FROM kalproduct ;

    Is there a noticeable reason why:

    INSERT INTO Products (ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName)

    SELECT(kalproduct.Product, kalproduct.size, kalproduct.SRP, kalproduct.Cat, kalproduct.manname)

    FROM kalproduct ;

    would have returned an error message?? I don't want to have to create multiple tables for the purpose of inserting into others.

    -----Original Message----- From: John W. Holmes <holmes072000charter.net> To: 'dwalker' <dwalkerhealthyproductsplus.com>; 'professional php' <pro_phpp2p.wrox.com>; php-dblists.php.net <php-dblists.php.net>; php-generallists.php.net <php-generallists.php.net> Date: Saturday, October 19, 2002 7:24 PM Subject: RE: [PHP-DB] MySQL Insert Select statement

    >That's how you do it. Hopefully you've figured it out already. > > > >---John Holmes. > > > >-----Original Message----- >From: dwalker [mailto:dwalkerhealthyproductsplus.com] >Sent: Saturday, October 19, 2002 7:51 PM >To: professional php; php-dblists.php.net; php-generallists.php.net >Subject: [PHP-DB] MySQL Insert Select statement > > > >While reading the MySQL manual for INSERT SELECT, I was not able to >determine how to include all 5 fields of one table into another table >(containing 100 fields) into SPECIFIC data fields. Do I need to >explicitly list all the fields within the table of 5 fields? If so, >would the statement be: > > > >INSERT INTO Products >(ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName) > >SELECT(kalproduct.Product, kalproduct.size, kalproduct.SRP, >kalproduct.Cat, kalproduct.manname) > >FROM kalproduct > >; > > > > > > > >Thanking you in advance. > > > >P.S. I'd give it a try, but I'm trying to move 500 partial records into >a table containing at least 2000 records -- didn't want to start from >scratch. > > > > > > > > > > > > > > > > > > > > > >This email message and all attachments transmitted herewith are trade >secret and/or confidential information intended only for the > viewing and use of addressee. If the reader of this message > is not the intended recipient, you are hereby notified that >any review, use, communication, dissemination, distribution >or copying of this communication is prohibited. If you have >received this communication is error, please notify the sender >immediately by telephone or electronic mail, and delete this >message and all copies and backups thereof. > > > >Thank you for your cooperation. > >

    attached mail follows:


    what was the error?

    "dwalker" <dwalkerhealthyproduct To: <holmes072000charter.net>, "'professional php'" splus.com> <pro_phpp2p.wrox.com>, <php-dblists.php.net>, <php-generallists.php.net> 10/19/2002 08:32 PM cc: Please respond to Subject: Re: [PHP-DB] MySQL Insert Select statement "dwalker"

    For some reason the Insert Select statement returned an ERROR and I had to resort to

    INSERT INTO Products (ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName)

    SELECT *

    FROM kalproduct ;

    Is there a noticeable reason why:

    INSERT INTO Products (ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName)

    SELECT(kalproduct.Product, kalproduct.size, kalproduct.SRP, kalproduct.Cat, kalproduct.manname)

    FROM kalproduct ;

    would have returned an error message?? I don't want to have to create multiple tables for the purpose of inserting into others.

    -----Original Message----- From: John W. Holmes <holmes072000charter.net> To: 'dwalker' <dwalkerhealthyproductsplus.com>; 'professional php' <pro_phpp2p.wrox.com>; php-dblists.php.net <php-dblists.php.net>; php-generallists.php.net <php-generallists.php.net> Date: Saturday, October 19, 2002 7:24 PM Subject: RE: [PHP-DB] MySQL Insert Select statement

    >That's how you do it. Hopefully you've figured it out already. > > > >---John Holmes. > > > >-----Original Message----- >From: dwalker [mailto:dwalkerhealthyproductsplus.com] >Sent: Saturday, October 19, 2002 7:51 PM >To: professional php; php-dblists.php.net; php-generallists.php.net >Subject: [PHP-DB] MySQL Insert Select statement > > > >While reading the MySQL manual for INSERT SELECT, I was not able to >determine how to include all 5 fields of one table into another table >(containing 100 fields) into SPECIFIC data fields. Do I need to >explicitly list all the fields within the table of 5 fields? If so, >would the statement be: > > > >INSERT INTO Products >(ProductName,Size,SuggestedRetailPrice,ProductCategory,ManufacturerName) > >SELECT(kalproduct.Product, kalproduct.size, kalproduct.SRP, >kalproduct.Cat, kalproduct.manname) > >FROM kalproduct > >; > > > > > > > >Thanking you in advance. > > > >P.S. I'd give it a try, but I'm trying to move 500 partial records into >a table containing at least 2000 records -- didn't want to start from >scratch. > > > > > > > > > > > > > > > > > > > > > >This email message and all attachments transmitted herewith are trade >secret and/or confidential information intended only for the > viewing and use of addressee. If the reader of this message > is not the intended recipient, you are hereby notified that >any review, use, communication, dissemination, distribution >or copying of this communication is prohibited. If you have >received this communication is error, please notify the sender >immediately by telephone or electronic mail, and delete this >message and all copies and backups thereof. > > > >Thank you for your cooperation. > >

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

    attached mail follows:


    Ok the server that i run my site on is in some american time and most of the users are in new zealand, how can i make the time stamp ADD +16 Hours.

    Any ideas

    ---
    Philip J. Newman.
    Head Developer.
    PhilipNZ.com New Zealand Ltd.
    http://www.philipnz.com/
    infophilipnz.com
    

    Mob: +64 (25) 6144012. Tele: +64 (9) 5769491.

    Family Site: Philip J. Newman Internet Developer http://www.newman.net.nz/ infonewman.net.nz

    ***************************** Friends are like Stars, You can't always see them, But you know they are there.

    *****************************

    attached mail follows:


    If I'm not mistaken, it should be enough to use date as follows:

    $date = strtotime ("now +16 hours");

    On Sat, 2002-10-19 at 21:03, Philip J. Newman wrote: > Ok the server that i run my site on is in some american time and most of the > users are in new zealand, how can i make the time stamp ADD +16 Hours. > > Any ideas > > --- > Philip J. Newman. > Head Developer. > PhilipNZ.com New Zealand Ltd. > http://www.philipnz.com/ > infophilipnz.com > > Mob: +64 (25) 6144012. > Tele: +64 (9) 5769491. > > Family Site: > Philip J. Newman > Internet Developer > http://www.newman.net.nz/ > infonewman.net.nz > > ***************************** > Friends are like Stars, > You can't always see them, > But you know they are there. > > ***************************** > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    thanks man (o; I'll look into it

    ----- Original Message ----- From: "Marco Tabini" <marcottabini.ca> To: "Philip J. Newman" <newmanpjphilipnz.com> Cc: <php-generallists.php.net> Sent: Sunday, October 20, 2002 2:21 PM Subject: Re: [PHP] time stamps

    > If I'm not mistaken, it should be enough to use date as follows: > > $date = strtotime ("now +16 hours"); > > > > > On Sat, 2002-10-19 at 21:03, Philip J. Newman wrote: > > Ok the server that i run my site on is in some american time and most of the > > users are in new zealand, how can i make the time stamp ADD +16 Hours. > > > > Any ideas > > > > --- > > Philip J. Newman. > > Head Developer. > > PhilipNZ.com New Zealand Ltd. > > http://www.philipnz.com/ > > infophilipnz.com > > > > Mob: +64 (25) 6144012. > > Tele: +64 (9) 5769491. > > > > Family Site: > > Philip J. Newman > > Internet Developer > > http://www.newman.net.nz/ > > infonewman.net.nz > > > > ***************************** > > Friends are like Stars, > > You can't always see them, > > But you know they are there. > > > > ***************************** > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >

    attached mail follows:


    I am trying to set up PHP to run as CGI under apache....

    I have my binary /usr/bin/php

    When i run this file (/cgi-bin/test.cgi):

    #!/usr/bin/php <?php

    echo "Test...working";

    ?>

    My result is:

    No input file specified.

    Does anyone know how to get this working?

    -- 
    .: B i g D o g :.
    

    attached mail follows:


    What is the most effective method of extracting from a blob specified text to be placed into another table field.

    This email message and all attachments transmitted herewith are trade secret and/or confidential information intended only for the viewing and use of addressee. If the reader of this message is not the intended recipient, you are hereby notified that any review, use, communication, dissemination, distribution or copying of this communication is prohibited. If you have received this communication is error, please notify the sender immediately by telephone or electronic mail, and delete this message and all copies and backups thereof.

    Thank you for your cooperation.