RE: [PHP-DB] Decrypting PASSWORD() from MySQL
I would go for the generate new random password approach - email the new random password to the registered email address, then they can log in using it and reset it to whatever they want. probably easier than using lots of code encrypting and decrypting things? Let me know what you decide on, and if you do enc/decrypt stuff, i'd be interested in seeing the code for a similar thing myself! Matt -Original Message- From: Zach Curtis [mailto:[EMAIL PROTECTED]] Sent: 19 December 2001 20:27 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Thanks for the suggestions. I guess I can try to: A) Store the password in plaintext if I need to retrieve the password. B) Store the password using PASSWORD() and then generate a new random password if needed, replacing the old password. C) Look into mcrypt, ENCODE()/DECODE(), encipher/decipher Thanks, Zach -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 12:56 PM To: Zach Curtis Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Yet another example of ted's out-to-lunchness... Use the mcrypt functions on the password... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Function OCILogon().
Dear all, I used PHP 4.1.0 and Oracle 9i running on RedHat-7.2. I have question about Oracle function OCILogon(). I have problem about my source below. ?php $db = ; $c1 = ocilogon(scott,tiger,$db); $c2 = ocilogon(scott,tiger,$db); ? When run this source on browser, it has messages below. Warning: _oci_open_server: Error while trying to retrieve text for error ORA-12545 in /usr/local/apache/htdocs/registra/oracle2mysql/a.php on line 3 Warning: _oci_open_server: Error while trying to retrieve text for error ORA-12545 in /usr/local/apache/htdocs/registra/oracle2mysql/a.php on line 4 Please let me know how to solve this problem. thank you very much. regards, Somsak. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: PHP Extensions
Hi, I need dbase.so I don`t have it. I download php`s .tgz to compile Is dbase actional supported and produced for it? I know this as an old database. Regards, Ruprecht -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: PHP Extensions
Well, only i need open .dbf files from linux, .dbf files are Visual fox pro files [EMAIL PROTECTED] wrote: Hi, I need dbase.so I don`t have it. I download php`s .tgz to compile Is dbase actional supported and produced for it? I know this as an old database. Regards, Ruprecht -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Decrypting PASSWORD() from MySQL
This is how I'm going to work things. Store the password using PASSWORD() in the table. Allow user to request their forgotten username and/or password. If the password is requested, I will reset the password to a random value and store this in the table using PASSWORD(). The username and/or password will then be emailed to the user. I will also provide a location where the user can change their password once they are authenticated in the members area. I think this approach allows the password to maintain a certain level of security and give the user the greatest flexibility on maintaining their password. Zach -Original Message- From: matt stewart [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 2:19 AM To: 'Zach Curtis'; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL I would go for the generate new random password approach - email the new random password to the registered email address, then they can log in using it and reset it to whatever they want. probably easier than using lots of code encrypting and decrypting things? Let me know what you decide on, and if you do enc/decrypt stuff, i'd be interested in seeing the code for a similar thing myself! Matt -Original Message- From: Zach Curtis [mailto:[EMAIL PROTECTED]] Sent: 19 December 2001 20:27 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Thanks for the suggestions. I guess I can try to: A) Store the password in plaintext if I need to retrieve the password. B) Store the password using PASSWORD() and then generate a new random password if needed, replacing the old password. C) Look into mcrypt, ENCODE()/DECODE(), encipher/decipher Thanks, Zach -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 12:56 PM To: Zach Curtis Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Yet another example of ted's out-to-lunchness... Use the mcrypt functions on the password... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: PHP Extensions
[EMAIL PROTECTED] wrote: Thanks to reply my message. I need dbase.so I don`t have it. I download php`s .tgz to compile how i can to compile dbase module? i do next cd php-4.0.4 cd ext cd dbase phpize ./configure make make install and i have dbase.so, but in the momento to run my program i have next error Warning: Invalid library (maybe not a PHP library) 'dbase.so' in /home/www/html/ggcargo/datatest/test.php on line 3 This means dbase.so does not have zend_get_module() function in the so file. Strange, since it is in source. Which PHP version are you using? Try 4.1.0 or 4.2.0-dev see if it helps. -- Yasuo Ohgaki _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Decrypting PASSWORD() from MySQL
Or what may be even better at that point (to keep someone from pestering another user and changing their password. Email them a randomly generated string based on their username, store that in a database, then send them to a page to enter the string (or pass it through the url.) IE. I'm Joe, I lost my password, I click Lost Password. It emails me this: http://this.domain.com/passwordreset.php?un=joegen=2lkfh4j2lk34klb25bmn425k l23k5b Then it will change my password to a randomly generated string and email it to me. After that, it will allow me to change my password. That way you don't have a schmuck in there guessing usernames, or pestering people they don't like by clicking Lost Password. If someone doesn't check their mail quite frequently, they'll just get Incorrect Password and be emailing you for support every 5 minutes. Ryan Marrs Web Developer Sandler and Travis Trade Advisory Services, Inc. 248.474.7200 x 183 http://www.strtrade.com -Original Message- From: Zach Curtis [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:15 AM To: matt stewart Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL This is how I'm going to work things. Store the password using PASSWORD() in the table. Allow user to request their forgotten username and/or password. If the password is requested, I will reset the password to a random value and store this in the table using PASSWORD(). The username and/or password will then be emailed to the user. I will also provide a location where the user can change their password once they are authenticated in the members area. I think this approach allows the password to maintain a certain level of security and give the user the greatest flexibility on maintaining their password. Zach -Original Message- From: matt stewart [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 2:19 AM To: 'Zach Curtis'; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL I would go for the generate new random password approach - email the new random password to the registered email address, then they can log in using it and reset it to whatever they want. probably easier than using lots of code encrypting and decrypting things? Let me know what you decide on, and if you do enc/decrypt stuff, i'd be interested in seeing the code for a similar thing myself! Matt -Original Message- From: Zach Curtis [mailto:[EMAIL PROTECTED]] Sent: 19 December 2001 20:27 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Thanks for the suggestions. I guess I can try to: A) Store the password in plaintext if I need to retrieve the password. B) Store the password using PASSWORD() and then generate a new random password if needed, replacing the old password. C) Look into mcrypt, ENCODE()/DECODE(), encipher/decipher Thanks, Zach -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 12:56 PM To: Zach Curtis Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Yet another example of ted's out-to-lunchness... Use the mcrypt functions on the password... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Decrypting PASSWORD() from MySQL
good point well made. this system has pretty much everything we need - thanks! -Original Message- From: Ryan Marrs [mailto:[EMAIL PROTECTED]] Sent: 20 December 2001 16:17 To: 'Zach Curtis'; matt stewart Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Or what may be even better at that point (to keep someone from pestering another user and changing their password. Email them a randomly generated string based on their username, store that in a database, then send them to a page to enter the string (or pass it through the url.) IE. I'm Joe, I lost my password, I click Lost Password. It emails me this: http://this.domain.com/passwordreset.php?un=joegen=2lkfh4j2lk34klb25bmn425k l23k5b Then it will change my password to a randomly generated string and email it to me. After that, it will allow me to change my password. That way you don't have a schmuck in there guessing usernames, or pestering people they don't like by clicking Lost Password. If someone doesn't check their mail quite frequently, they'll just get Incorrect Password and be emailing you for support every 5 minutes. Ryan Marrs Web Developer Sandler and Travis Trade Advisory Services, Inc. 248.474.7200 x 183 http://www.strtrade.com -Original Message- From: Zach Curtis [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:15 AM To: matt stewart Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL This is how I'm going to work things. Store the password using PASSWORD() in the table. Allow user to request their forgotten username and/or password. If the password is requested, I will reset the password to a random value and store this in the table using PASSWORD(). The username and/or password will then be emailed to the user. I will also provide a location where the user can change their password once they are authenticated in the members area. I think this approach allows the password to maintain a certain level of security and give the user the greatest flexibility on maintaining their password. Zach -Original Message- From: matt stewart [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 2:19 AM To: 'Zach Curtis'; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL I would go for the generate new random password approach - email the new random password to the registered email address, then they can log in using it and reset it to whatever they want. probably easier than using lots of code encrypting and decrypting things? Let me know what you decide on, and if you do enc/decrypt stuff, i'd be interested in seeing the code for a similar thing myself! Matt -Original Message- From: Zach Curtis [mailto:[EMAIL PROTECTED]] Sent: 19 December 2001 20:27 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Thanks for the suggestions. I guess I can try to: A) Store the password in plaintext if I need to retrieve the password. B) Store the password using PASSWORD() and then generate a new random password if needed, replacing the old password. C) Look into mcrypt, ENCODE()/DECODE(), encipher/decipher Thanks, Zach -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 12:56 PM To: Zach Curtis Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL Yet another example of ted's out-to-lunchness... Use the mcrypt functions on the password... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL
[PHP-DB] Checkboxes, PHP, and MySQL
I've looked around in a few of the PHP lists for an answer to this, but can't come up with one. Here's what I am doing: I have a form with a few checkboxes. When the information as to whether the checkboxes are checked or not is 'saved' into the MySQL table, they are represented by a value of '1' - fine. When I want to edit this information, in the form of a similar form with checkboxes, the boxes are not checked off if they were before. What I am stuck on is how a checkbox can get checked off when pulling information from the MySQL as an array. Here's a line of code showing my array coming out. input type=checkbox name=firstvalue value='$result[32]' $result is the array. I guess what I am asking is that if a checkbox is assigned a value of one, why doesn't it appear as already checked off? Thanks, -Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Checkboxes, PHP, and MySQL
On Thu, Dec 20, 2001 at 11:40:14AM -0500, SpyProductions Support Team wrote: I've looked around in a few of the PHP lists for an answer to this, but can't come up with one. On this question, you'd be better off just reading an HTML reference. It doesn't matter what the value of a checkbox is. If you want it to appear checked when the browser displays it, you should supply a checked attribute: input type=checkbox name=firstvalue value=$result[32] checked Here's what I am doing: I have a form with a few checkboxes. When the information as to whether the checkboxes are checked or not is 'saved' into the MySQL table, they are represented by a value of '1' - fine. When I want to edit this information, in the form of a similar form with checkboxes, the boxes are not checked off if they were before. What I am stuck on is how a checkbox can get checked off when pulling information from the MySQL as an array. Here's a line of code showing my array coming out. input type=checkbox name=firstvalue value='$result[32]' $result is the array. I guess what I am asking is that if a checkbox is assigned a value of one, why doesn't it appear as already checked off? Thanks, -Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Checkboxes, PHP, and MySQL
It's not the checkbox's VALUE attribute that determines whether it is checked or not. If you add the empty attribute CHECKED, then the checkbox will be checked. Example: INPUT TYPE='Checkbox' NAME='VarCheck1' VALUE='Good' CHECKED INPUT TYPE='Checkbox' NAME='VarCheck2' VALUE='Good' VarCheck1 will be checked, and VarCheck2 will not be checked. A checkbox will only have a value on submission IF IT IS CHECKED. So if the above two boxes were submitted and VarCheck1 was checked and VarCheck2 was not checked, the new page would have the variable VarCheck1 containing Good, while VarCheck2 would be empty/non-existent. - Jonathan -Original Message- From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 8:40 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Checkboxes, PHP, and MySQL I've looked around in a few of the PHP lists for an answer to this, but can't come up with one. Here's what I am doing: I have a form with a few checkboxes. When the information as to whether the checkboxes are checked or not is 'saved' into the MySQL table, they are represented by a value of '1' - fine. When I want to edit this information, in the form of a similar form with checkboxes, the boxes are not checked off if they were before. What I am stuck on is how a checkbox can get checked off when pulling information from the MySQL as an array. Here's a line of code showing my array coming out. input type=checkbox name=firstvalue value='$result[32]' $result is the array. I guess what I am asking is that if a checkbox is assigned a value of one, why doesn't it appear as already checked off? Thanks, -Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Checkboxes, PHP, and MySQL
the value doesn't determine whether it's checked or not - it determines the value passed WHEN it's checked. try the lines below: echoinput type=/checkbox/ name=/firstvalue/ value=/1/; if ($result[32] == 1){ echo checked; }else{ echo; } or something along these lines. -Original Message- From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]] Sent: 20 December 2001 16:40 To: [EMAIL PROTECTED] Subject: [PHP-DB] Checkboxes, PHP, and MySQL I've looked around in a few of the PHP lists for an answer to this, but can't come up with one. Here's what I am doing: I have a form with a few checkboxes. When the information as to whether the checkboxes are checked or not is 'saved' into the MySQL table, they are represented by a value of '1' - fine. When I want to edit this information, in the form of a similar form with checkboxes, the boxes are not checked off if they were before. What I am stuck on is how a checkbox can get checked off when pulling information from the MySQL as an array. Here's a line of code showing my array coming out. input type=checkbox name=firstvalue value='$result[32]' $result is the array. I guess what I am asking is that if a checkbox is assigned a value of one, why doesn't it appear as already checked off? Thanks, -Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Checkboxes, PHP, and MySQL
On Friday 21 December 2001 00:40, SpyProductions Support Team wrote: I've looked around in a few of the PHP lists for an answer to this, but can't come up with one. Here's what I am doing: I have a form with a few checkboxes. When the information as to whether the checkboxes are checked or not is 'saved' into the MySQL table, they are represented by a value of '1' - fine. When I want to edit this information, in the form of a similar form with checkboxes, the boxes are not checked off if they were before. What I am stuck on is how a checkbox can get checked off when pulling information from the MySQL as an array. Here's a line of code showing my array coming out. input type=checkbox name=firstvalue value='$result[32]' $result is the array. I guess what I am asking is that if a checkbox is assigned a value of one, why doesn't it appear as already checked off? value='XXX' only specifies what the value would be *if* the checkbox was checked. To actually *set* the checkbox you need: input type=checkbox name=firstvalue value='$result[32]' checked hth -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Always there remain portions of our heart into which no one is able to enter, invite them as we may. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Checkboxes, PHP, and MySQL
Or a better, more-visual way might be: ? if($result[32] == 1) $Checked = CHECKED; else $Checked = ; print INPUT TYPE='Checkbox' NAME='firstvalue' VALUE='1' $Checked; ? - Jonathan -Original Message- From: matt stewart [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 8:45 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Checkboxes, PHP, and MySQL the value doesn't determine whether it's checked or not - it determines the value passed WHEN it's checked. try the lines below: echoinput type=/checkbox/ name=/firstvalue/ value=/1/; if ($result[32] == 1){ echo checked; }else{ echo; } or something along these lines. -Original Message- From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]] Sent: 20 December 2001 16:40 To: [EMAIL PROTECTED] Subject: [PHP-DB] Checkboxes, PHP, and MySQL I've looked around in a few of the PHP lists for an answer to this, but can't come up with one. Here's what I am doing: I have a form with a few checkboxes. When the information as to whether the checkboxes are checked or not is 'saved' into the MySQL table, they are represented by a value of '1' - fine. When I want to edit this information, in the form of a similar form with checkboxes, the boxes are not checked off if they were before. What I am stuck on is how a checkbox can get checked off when pulling information from the MySQL as an array. Here's a line of code showing my array coming out. input type=checkbox name=firstvalue value='$result[32]' $result is the array. I guess what I am asking is that if a checkbox is assigned a value of one, why doesn't it appear as already checked off? Thanks, -Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Multiple Image Display Problem
I am having problems displaying two different images on the same page. (stored as binary files in two different db tables) Instead of getting two different images, I am getting the first image twice, although the scripts are going to two different database tables to get the two images. Is there a way to get both images to display on this page? Any help would be much appreciated. Thank you. The main code is: ? if (count($result3) 0) { while ($result_array3 = mysql_fetch_array($result3, MYSQL_ASSOC)) { if ($result_array3[speaker_id] !== ) { echo pIMG SRC=\small_image.php?speaker_id= . $result_array[speaker_id] . \/p; } } } if (count($result4) 0) { while ($result_array4 = mysql_fetch_array($result4, MYSQL_ASSOC)) { if ($result_array4[speaker_id] !== ) { echo pIMG SRC=\large_image.php?speaker_id= . $result_array[speaker_id] . \/p; } } } ? - small_image.php: ? include(include.inc); $sql = SELECT bin_data, filetype, filename, filesize FROM smphoto_bin_data WHERE speaker_id=$speaker_id; // . $HTTP_SESSION_VARS[speaker_id]; $result = @mysql_query($sql); $data = @mysql_result($result, 0, bin_data); $name = @mysql_result($result, 0, filename); $size = @mysql_result($result, 0, filesize); $type = @mysql_result($result, 0, filetype); header(Content-type: $type); header(Content-length: $size); header(Content-Disposition: attachment; filename=$name); header(Content-Description: PHP Generated Data); echo $data; ? large_image.php: ? include(include.inc); $sql = SELECT bin_data, filetype, filename, filesize FROM lgphoto_bin_data WHERE speaker_id=$speaker_id; $result = @mysql_query($sql); $data = @mysql_result($result, 0, bin_data); $name = @mysql_result($result, 0, filename); $size = @mysql_result($result, 0, filesize); $type = @mysql_result($result, 0, filetype); header(Content-type: $type); header(Content-length: $size); header(Content-Disposition: attachment; filename=$name); header(Content-Description: PHP Generated Data); echo $data; ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Mysql result resource error
which one was giving you the problem? the first or second mysql try. if it was the second, try wrapping the $cattyname with single quotes like this Minor_Category = '$cattyname'. if the $cattyname var has anything but numbers, the statement won't work. Jim - Original Message - From: Shannon Doyle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 19, 2001 4:19 PM Subject: [PHP-DB] Mysql result resource error Hi People, I am getting a Not a valid Mysql result resource error with the following code, can someone take a look at this for me and see if there is anything that stands out Thanks, Shannon ? $cattyname = ; $sql = select Minor_Category main where Page = 'wines' order by Minor_Category; $dbh = @mysql_connect($dbhost,$dbuser,$dbpass); $results2 = mysql_db_query($db,$sql,$dbh); for($j = 0; $j mysql_num_rows($results2); $j++) { $array[$j] = mysql_fetch_array($results2); } mysql_close($dbh); for ($h = 0; $h count($array); $h++) { if ($array[$h][Minor_Category] != $cattyname) { $cattyname = $array[$h][Minor_Category]; echo trtd colspan='4'a name='.$cattyname.'/ab.$cattyname./b/td/td/tr; $catname = ; $sql = select Category,Code,Description,Pack,Unit,Price from main where Page = 'wines' Minor_Category = $cattyname order by Category; $dbh = @mysql_connect($dbhost,$dbuser,$dbpass); $results = mysql_db_query($db,$sql,$dbh); for($i = 0; $i mysql_num_rows($results); $i++) { $array[$i] = mysql_fetch_array($results); } mysql_close($dbh); for ($i = 0; $i count($array); $i++) { if ($array[$i][Category] != $catname) { $catname = $array[$i][Category]; echo trtd colspan='4'a name='.$catname.'/ab.$catname./b/tdtd align='center'pbCarton Size/b/p/tdtd align='center'pbUnit/b/p/tdtd align='right'pbPrice/b/p/tdtda href='#top'img src='images/arrow.gif' border='0'/a/td/tr; } echo trtd/tdtdpa href=javascript:order_now(quot;.$array[$i][Code].quot;)img src='images/order.gif' border='0'/a/tdtd/tdtd align='left'p.$array[$i][Description]./p/tdtd align='center'p.$array[$i][Pack]./p/tdtd align='center'p.$array[$i][Unit]./p/tdtd align='right'p$.$array[$i][Price]./p/td/tr\n; } } } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Checkboxes, PHP, and MySQL
Try this input type=checkbox name=firstvalue ?=($result[32]?checked:)? Jim - Original Message - From: SpyProductions Support Team [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 20, 2001 8:40 AM Subject: [PHP-DB] Checkboxes, PHP, and MySQL I've looked around in a few of the PHP lists for an answer to this, but can't come up with one. Here's what I am doing: I have a form with a few checkboxes. When the information as to whether the checkboxes are checked or not is 'saved' into the MySQL table, they are represented by a value of '1' - fine. When I want to edit this information, in the form of a similar form with checkboxes, the boxes are not checked off if they were before. What I am stuck on is how a checkbox can get checked off when pulling information from the MySQL as an array. Here's a line of code showing my array coming out. input type=checkbox name=firstvalue value='$result[32]' $result is the array. I guess what I am asking is that if a checkbox is assigned a value of one, why doesn't it appear as already checked off? Thanks, -Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL date formats
nautilis, Leave the date in the database in MySQL format (/MM/DD) and when you need to display the date on your page, just do this: ?php explode(/, $datearray); $date = $datearray[2].'/'.$datearray[1].'/'.$datearray[0]; ? That just splits up the three numbers, and rearranges them. Easy :) Chris }:) -Original Message- From: nautilis [SMTP:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 5:11 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL date formats Hi everyone! I have a little problem with my MySQL database in the way it stores dates. The only format i can have is /MM/DD, and when i request this date from my php page, this date is insertes in this format. As my website is going to be for spanish users, the correct format would be DD/MM/, but i have no idea about changing this, either on the database or when i process it with php. Thanks in advance for reading my post. I hope anyone can point me into the right direction. nautilis -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL date formats
Sorry, correction: ?php $datearray = explode(/, $mysqldate); $date = $datearray[2].'/'.$datearray[1].'/'.$datearray[0]; echo $date; ? -Original Message- From: Rosser, Chris Sent: Thursday, December 20, 2001 5:37 PM To: [EMAIL PROTECTED] Cc: 'nautilis' Subject: RE: [PHP-DB] MySQL date formats nautilis, Leave the date in the database in MySQL format (/MM/DD) and when you need to display the date on your page, just do this: ?php explode(/, $datearray); $date = $datearray[2].'/'.$datearray[1].'/'.$datearray[0]; ? That just splits up the three numbers, and rearranges them. Easy :) Chris }:) -Original Message- From: nautilis [SMTP:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 5:11 PM To: [EMAIL PROTECTED] Subject:[PHP-DB] MySQL date formats Hi everyone! I have a little problem with my MySQL database in the way it stores dates. The only format i can have is /MM/DD, and when i request this date from my php page, this date is insertes in this format. As my website is going to be for spanish users, the correct format would be DD/MM/, but i have no idea about changing this, either on the database or when i process it with php. Thanks in advance for reading my post. I hope anyone can point me into the right direction. nautilis -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL date formats
Try in PHP. This should take 12/25/2001 in $input_date and convert it to 20011225 in $db_date. Then write $db_date to mySQL database. Perform similar conversion when extracting from database. Or instruct your users to use MMDD. $thedate = explode(/,$input_date); //$thedate[0]=DD, $thedate[1]=MM, $thedate[2]= $db_date = date(Ymd, mktime(0,0,0,$thedate[1],$thedate[0],$thedate[2]) ); -Original Message- From: nautilis [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:11 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL date formats Hi everyone! I have a little problem with my MySQL database in the way it stores dates. The only format i can have is /MM/DD, and when i request this date from my php page, this date is insertes in this format. As my website is going to be for spanish users, the correct format would be DD/MM/, but i have no idea about changing this, either on the database or when i process it with php. Thanks in advance for reading my post. I hope anyone can point me into the right direction. nautilis -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Problem with PHP4 and dba_open
If you are using PostgreSQL module, do not use PostgreSQL for now. I'll work on conflict issue later, but I don't think it will be fixed any time soon No, I don't use PostgreSQL module.. so what's wrong? Sometimes, when I reboot machine, it works for a while..? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Run php page automatically
I would like to create a php page that would automatically run every 10 minutes or so to delete records from a table. This table has an expiration field and records r tested by comparing current date with the expiration date and record is deleted if expired. Is this possible. Help is greatly appreciated. I am using php for my application. I am working on a LInux server and using mysql as my database. regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Run php page automatically
I usually just create a cron job for this. Create your PHP script that will delete the matching records once. Then go into cron and have it run every 10 minutes. - Jonathan -Original Message- From: Harpreet [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:21 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Run php page automatically I would like to create a php page that would automatically run every 10 minutes or so to delete records from a table. This table has an expiration field and records r tested by comparing current date with the expiration date and record is deleted if expired. Is this possible. Help is greatly appreciated. I am using php for my application. I am working on a LInux server and using mysql as my database. regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Run php page automatically
do this (crontab file) 35 23 * * * root lynx http://www.host.com/dir/file.php -accept_all_cookies it's work! marco -Mensaje original- De: Harpreet [mailto:[EMAIL PROTECTED]] Enviado el: Jueves, 20 de Diciembre de 2001 02:21 p.m. Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Asunto: [PHP-DB] Run php page automatically I would like to create a php page that would automatically run every 10 minutes or so to delete records from a table. This table has an expiration field and records r tested by comparing current date with the expiration date and record is deleted if expired. Is this possible. Help is greatly appreciated. I am using php for my application. I am working on a LInux server and using mysql as my database. regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] mysql table layout help needed
Hi there everyone, This is probably a really simple problem but for the life of me I can't figure out what i'm doing wrong. My problem is I am getting 20+ results from a DB to display without any problems with the images etc . but they display one ontop of another (Of course with spacing underneath etc ...) The problem however is that when I try to format the layout in a table it screws up. I need the results to display 3 across and however many down as needed, but I can only get it to display either one ontop of the other or all of them going across the top of the screen which stretches the screen out unacceptably. Please help me, I need to know how the table code should be to allow me to display 2 or 3 items across and then down. Thank you all for your help and Merry Christmas :-) Chris
[PHP-DB] RE: [mysql-support] RE: [PHP-DB] Run php page automatically
In my opinion, PHP works fine with small scripts like this. True, it could be more efficient with Perl, but when you don't know Perl, or don't have DB perl modules installed, PHP scriptlets are a nice way to take care of small tasks. And PHP can just as easily run a system command and append text to a log file: system('echo A new message MyLogFile'); I used to think that PHP was only for the purpose of viewing through web pages, but I've since found that it really can make a handy system tool sometimes when Perl is a hassle. - Jonathan -Original Message- From: NiteHaqr [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 1:53 PM To: Jonathan Hilgeman; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [mysql-support] RE: [PHP-DB] Run php page automatically I would probably recommend AGAINST running this php script from cron. I have a similar script but I use a PERL version for auto-updates. PHP should only (IMHO) be used where someone will see some output on a webpage. Other advantage of using PERL is that you could easily create a log file by redirecting the output (or PRINT statements) to a file using simple redirection ( and ) instead of having to actually manipulate the file. Just my tuppenceworth. David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jonathan Hilgeman Sent: 20 December 2001 19:22 To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [mysql-support] RE: [PHP-DB] Run php page automatically I usually just create a cron job for this. Create your PHP script that will delete the matching records once. Then go into cron and have it run every 10 minutes. - Jonathan -Original Message- From: Harpreet [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:21 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Run php page automatically I would like to create a php page that would automatically run every 10 minutes or so to delete records from a table. This table has an expiration field and records r tested by comparing current date with the expiration date and record is deleted if expired. Is this possible. Help is greatly appreciated. I am using php for my application. I am working on a LInux server and using mysql as my database. regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ___ To unsubscribe yourself from this list please go to http://www.mysql.org/mailman/listinfo/support and read the unsubscription information. support mailing list [EMAIL PROTECTED] http://www.mysql.org/mailman/listinfo/support -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mysql table layout help needed
A sample of what you were trying would have been helpful... If I understood your problem right, the solution is a piece of code like this: ? echo(table\ntr\n); while ($myrow=mysql_fetch_row($result)) { $colcount++; if ($colcount==$desiredcolcount) { $colcount=0; } if (!$colcount) { echo(/tr\ntr\n); } echo(td[your output here]/td\n); } if ($colcount) { for (;$colcount$desiredcolcount;$colcount++) { echo(tdnbsp;/td\n); } } echo(/tr\n/table); ? Chris Payne wrote: Hi there everyone, This is probably a really simple problem but for the life of me I can't figure out what i'm doing wrong. My problem is I am getting 20+ results from a DB to display without any problems with the images etc . but they display one ontop of another (Of course with spacing underneath etc ...) The problem however is that when I try to format the layout in a table it screws up. I need the results to display 3 across and however many down as needed, but I can only get it to display either one ontop of the other or all of them going across the top of the screen which stretches the screen out unacceptably. Please help me, I need to know how the table code should be to allow me to display 2 or 3 items across and then down. Thank you all for your help and Merry Christmas :-) Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: [mysql-support] RE: [PHP-DB] Run php page automatically
What if you are on win2K? - Original Message - From: Jonathan Hilgeman [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, December 20, 2001 12:22 PM Subject: [mysql-support] RE: [PHP-DB] Run php page automatically I usually just create a cron job for this. Create your PHP script that will delete the matching records once. Then go into cron and have it run every 10 minutes. - Jonathan -Original Message- From: Harpreet [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:21 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Run php page automatically I would like to create a php page that would automatically run every 10 minutes or so to delete records from a table. This table has an expiration field and records r tested by comparing current date with the expiration date and record is deleted if expired. Is this possible. Help is greatly appreciated. I am using php for my application. I am working on a LInux server and using mysql as my database. regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ___ To unsubscribe yourself from this list please go to http://www.mysql.org/mailman/listinfo/support and read the unsubscription information. support mailing list [EMAIL PROTECTED] http://www.mysql.org/mailman/listinfo/support -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Re: [mysql-support] RE: [PHP-DB] Run php page automatically
task manager -Mensaje original- De: George Loch [mailto:[EMAIL PROTECTED]] Enviado el: Jueves, 20 de Diciembre de 2001 05:56 PM Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Asunto: [PHP-DB] Re: [mysql-support] RE: [PHP-DB] Run php page automatically What if you are on win2K? - Original Message - From: Jonathan Hilgeman [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, December 20, 2001 12:22 PM Subject: [mysql-support] RE: [PHP-DB] Run php page automatically I usually just create a cron job for this. Create your PHP script that will delete the matching records once. Then go into cron and have it run every 10 minutes. - Jonathan -Original Message- From: Harpreet [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:21 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Run php page automatically I would like to create a php page that would automatically run every 10 minutes or so to delete records from a table. This table has an expiration field and records r tested by comparing current date with the expiration date and record is deleted if expired. Is this possible. Help is greatly appreciated. I am using php for my application. I am working on a LInux server and using mysql as my database. regards, Harpreet Kaur Software Developer Crispin Corporations Inc. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ___ To unsubscribe yourself from this list please go to http://www.mysql.org/mailman/listinfo/support and read the unsubscription information. support mailing list [EMAIL PROTECTED] http://www.mysql.org/mailman/listinfo/support -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Mysql result resource error
Hi Jim, Ahh yes of courseI have corrected this. I am still getting the error on the first query...not sure why. And now I am getting a whole bunch of empty lines being output to the screen. Like there is supposed to be data in those lines, but nothing happening. Plus I am getting repeats of the same data. Its like it is doing each query three times or something. Don't know why it is doing that. - Shannon -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED]] Sent: Friday, 21 December 2001 03:52 AM To: Shannon Doyle; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Mysql result resource error which one was giving you the problem? the first or second mysql try. if it was the second, try wrapping the $cattyname with single quotes like this Minor_Category = '$cattyname'. if the $cattyname var has anything but numbers, the statement won't work. Jim - Original Message - From: Shannon Doyle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 19, 2001 4:19 PM Subject: [PHP-DB] Mysql result resource error Hi People, I am getting a Not a valid Mysql result resource error with the following code, can someone take a look at this for me and see if there is anything that stands out Thanks, Shannon ? $cattyname = ; $sql = select Minor_Category main where Page = 'wines' order by Minor_Category; $dbh = @mysql_connect($dbhost,$dbuser,$dbpass); $results2 = mysql_db_query($db,$sql,$dbh); for($j = 0; $j mysql_num_rows($results2); $j++) { $array[$j] = mysql_fetch_array($results2); } mysql_close($dbh); for ($h = 0; $h count($array); $h++) { if ($array[$h][Minor_Category] != $cattyname) { $cattyname = $array[$h][Minor_Category]; echo trtd colspan='4'a name='.$cattyname.'/ab.$cattyname./b/td/td/tr; $catname = ; $sql = select Category,Code,Description,Pack,Unit,Price from main where Page = 'wines' Minor_Category = $cattyname order by Category; $dbh = @mysql_connect($dbhost,$dbuser,$dbpass); $results = mysql_db_query($db,$sql,$dbh); for($i = 0; $i mysql_num_rows($results); $i++) { $array[$i] = mysql_fetch_array($results); } mysql_close($dbh); for ($i = 0; $i count($array); $i++) { if ($array[$i][Category] != $catname) { $catname = $array[$i][Category]; echo trtd colspan='4'a name='.$catname.'/ab.$catname./b/tdtd align='center'pbCarton Size/b/p/tdtd align='center'pbUnit/b/p/tdtd align='right'pbPrice/b/p/tdtda href='#top'img src='images/arrow.gif' border='0'/a/td/tr; } echo trtd/tdtdpa href=javascript:order_now(quot;.$array[$i][Code].quot;)img src='images/order.gif' border='0'/a/tdtd/tdtd align='left'p.$array[$i][Description]./p/tdtd align='center'p.$array[$i][Pack]./p/tdtd align='center'p.$array[$i][Unit]./p/tdtd align='right'p$.$array[$i][Price]./p/td/tr\n; } } } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] New Object Oriented Programming (OOP) mailing list for PHP programmers
Hello, Despite I already created this list a long time ago, only now I am announcing it as a general purpose forum for discussing matters related with Object Oriented Programming done in PHP. Everybody is invited and to join all you need to do is to send a message to [EMAIL PROTECTED] or go to the page http://groups.yahoo.com/group/php-objects/ . If you send the message to the above address I think you do not need to have a Yahoo account if you don't have one and don't want to subscribe to it. Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Run php page automatically
it's better to do something like 0,10,20,30,40,50* * * * /usr/bin/php -q /home/you/yourscript.php /dev/null since crontab actually stores the result of it's operations in a file (/home/you/Mailbox?) so you will bloat your server if you don't clear the output. alternatively, use yourscript.php /home/you/logfile and send the output to a text-based logfile for later analysis, then just make sure you aren't using b and stuff in the log :) HTH /beau // -Original Message- // From: Marco Eyzaguirre [mailto:[EMAIL PROTECTED]] // Sent: Friday, 21 December 2001 3:28 AM // To: [EMAIL PROTECTED] // Subject: RE: [PHP-DB] Run php page automatically // Importance: High // // // do this (crontab file) // // 35 23 * * * root lynx http://www.host.com/dir/file.php // -accept_all_cookies // // it's work! // marco // // -Mensaje original- // De: Harpreet [mailto:[EMAIL PROTECTED]] // Enviado el: Jueves, 20 de Diciembre de 2001 02:21 p.m. // Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] // Asunto: [PHP-DB] Run php page automatically // // // I would like to create a php page that would automatically // run every 10 // minutes or so to delete records from a table. This table has // an expiration // field and records r tested by comparing current date with // the expiration // date and record is deleted if expired. // // Is this possible. // // Help is greatly appreciated. // // I am using php for my application. I am working on a LInux // server and using // mysql as my database. // // regards, // Harpreet Kaur // Software Developer // Crispin Corporations Inc. // // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]