RE: [PHP-DB] accessing two databases within one script

2004-10-05 Thread Oscar Rylin
Of course you can $whatever_db_linkid = mysql_connect($connectiondetails_for_whatever_db); if(is_resource($whatever_db_linkid)) { mysql_select_db('whatever_db', $whatever_db_linkid); } $someother_db_linkid = mysql_connect($connectiondetails_for_someother_db);

RE: [PHP-DB] Mail Header Redirect

2004-10-05 Thread Bastien Koert
if you echo $Sent, what do you get? bastien From: Valerie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] Mail Header Redirect Date: Tue, 5 Oct 2004 08:24:26 -0400 I have an email that is sent upon submission of a form. I need to redirect to a confirmation page if email is sent

RE: [PHP-DB] Dynamic pull down menus with PHP/Mysql

2004-10-05 Thread Graham Cossey
Remember that PHP is server-side, so if you want PHP to do anything you'll have to send a request back to the server (reload the page). To handle things client side will require the likes of javascript, exactly how is beyond me I'm afraid but I'm sure you could do something like load all values

RE: [PHP-DB] accessing two databases within one script

2004-10-05 Thread Graham Cossey
I have several databases running on the same MySQL server and one application needs to run queries over two DBs at the same time. All I do is specify one connect (to the primary DB) and then specify the secondary DB within my queries. This seems to work fine, but not sure if it's discouraged for

RE: [PHP-DB] Dynamic pull down menus with PHP/Mysql

2004-10-05 Thread Ed Lazor
-Original Message- This may be a more javascript related topic, but it's also php/mysql. Apologies in advance if this is too far off topic. I'm trying to pull data from MySQL using PHP to sort the results into a form with a pull down menu. That works fine; I can do that. But I

Re: [PHP-DB] Safe / Secure Login Script

2004-10-05 Thread Brian
You should definately not set a cooking containing the encrypted password, anyone that's able to grab that cookie can set to work brute forcing the password. On Sun, 3 Oct 2004 13:11:00 -0700, Wendell Frohwein [EMAIL PROTECTED] wrote: I have been writing php code for about 2 years now. I have a

[PHP-DB] Multi Page Form

2004-10-05 Thread Jensen, Kimberlee
Hidden fields are preferred to visible fields and far preferred to query string data, but hidden fields can still be modified. The user can save the form page on their desktop, modify the html source (and include the full http path in the form action) then use their browser to send the modified

Re: [PHP-DB] Mail Header Redirect

2004-10-05 Thread Valerie
When I echo $sent, it returns 1. Thanks, Valerie - Original Message - From: Bastien Koert [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 10:03 AM Subject: RE: [PHP-DB] Mail Header Redirect if you echo $Sent, what do you get? bastien From:

[PHP-DB] Ascending and Descending records

2004-10-05 Thread Aaron Todd
I have a page that shows data from a MySQL database in a table form. I'd like to give this page the ability to be able to sort a column when the user clicks on the header cell that contains the name of the column. I'd also like the ability to do both Ascending and Descending with the same

[PHP-DB] Auto-increment questions...

2004-10-05 Thread NIPP, SCOTT V \(SBCSI\)
I am working on a database application for Unix user accounts. I want to be able to have a system that will provide me the next available numeric user ID. I have created a 2 column index table that simply includes UID and user name. This field is autoincrement and the primary key for the

RE: [PHP-DB] Ascending and Descending records

2004-10-05 Thread Bastien Koert
include a link(s) at the top of the column(asc/desc) and pass that value back to the server. then use that value to sort the column link = a href='?=$_SERVER['PHP_SELF']??col=colnamesort=asc'Asc/a then on the server $col = $_REQUEST['col']; $sort= $_REQUEST['sort']; sql= select * from tableName

RE: [PHP-DB] Auto-increment questions...

2004-10-05 Thread NIPP, SCOTT V \(SBCSI\)
OK. The problem is I don't want the next highest number. There are gaps in the UID sequence. I need to find the next UNUSED number in the sequence which is rarely the highest number. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com

RE: [PHP-DB] Auto-increment questions...

2004-10-05 Thread Hutchins, Richard
As a record ID, you shouldn't really worry about the numbers being sequential without gaps - they're just a way of assigning a unique number to a record in the db. However, if you need the record's id to be sequential because you're going to use it as a piece of actual data to be displayed to your

Re: [PHP-DB] Auto-increment questions...

2004-10-05 Thread Daniel Brunner
What determines the gaps??? On Oct 5, 2004, at 12:59 PM, [EMAIL PROTECTED] wrote: OK. The problem is I don't want the next highest number. There are gaps in the UID sequence. I need to find the next UNUSED number in the sequence which is rarely the highest number. Scott Nipp Phone:

[PHP-DB] Re: Mail Header Redirect

2004-10-05 Thread Amit Arora
Please note that HTTP headers are case sensitive. You should use: ?php function mailsent() { header(Location: http://www.justustwo.com/vals/thankyou.html;); exit(); } ? The 'L' of location should be in upper case. Amit www.digitalamit.com Valerie wrote: I have an email that is sent upon

Re: [PHP-DB] Mail Header Redirect

2004-10-05 Thread Bastien Koert
can you put some output in the function itself to see if its the function that blowing up and or if its the mail call... bastien From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Bastien Koert [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Mail Header Redirect Date: Tue,

[PHP-DB] Re: Safe / Secure Login Script

2004-10-05 Thread Mike Morris
These are not PHP specific suggestions, but I see two big problems: 5.) Password is then encrypted using base64_encode() 6.) You've confused encryption and encoding. Base64 encoding is trivial to decode, and fairly obvious to spot as well. All this achieves is that someone can't

[PHP-DB] SSL connection between PHP4 PostgreSQL ???

2004-10-05 Thread Mike Morris
Hi, I've setup a postgres server (7.4) and confirmed that SSL is enabled - I can successfully connect via tcp socket over SSL using the psql client. From PHP4, how can I get the pg_connect function to negotiate an SSL connection? I gather from researching the issue that pg_connect uses the

Re: [PHP-DB] Re: Safe / Secure Login Script

2004-10-05 Thread Dylan Barber
I was doing something similar but I moved to using the session in PHP. Is that wrong? What would be a good login/security script/class to use? -Original Message- From: Mike Morris [EMAIL PROTECTED] Sent: Oct 5, 2004 3:05 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Safe / Secure

Re: [PHP-DB] accessing two databases within one script

2004-10-05 Thread Andrew Kreps
On Mon, 04 Oct 2004 22:31:15 -0400, Gary Rachel [EMAIL PROTECTED] wrote: I've tried not using the mysql_close statement. But that option doesn't select the new database, it seems to stay connected to the previous one, despite my specifying a new database to access. Can I not access two

[PHP-DB] Database Backup

2004-10-05 Thread Aaron Todd
What is everyone doing to backup a MySQL database. Just in case...I'd like to backup mine, but I was wondering if there was a way to do it without going to a page and clicking a button. Is there a way to run a php script on a time schedule and then push a backup file to an FTP server or

Re: [PHP-DB] Multi Page Form

2004-10-05 Thread Stuart Felenstein
Regarding Session Variables - Can't the session be set to expire , so that if someone tried to reload later it would fail ? Stuart --- Frank Flynn [EMAIL PROTECTED] wrote: Using hidden fields is not less secure than using visible fields - or session variables which were filled out by end

[PHP-DB] Unusual Array Results

2004-10-05 Thread Wendell Frohwein
Hello all again, I am using php 5.0.1 with mysql 4.1.4a-gamma. After I did this upgrade, I noticed pieced of my code were failing. Took me a while to figure it out. When I would be working with arrays, sometimes I would call the values out like so: $value=$thearray[0]; Every piece of script

Re: [PHP-DB] Database Backup

2004-10-05 Thread martin73
You can simply copy files from 'data' subfolder of mysql database or create php script to make a dump of db and run it on regular basis as a cron job. Cheers, Martin What is everyone doing to backup a MySQL database. Just in case...I'd like to backup mine, but I was wondering if there was a

[PHP-DB] Re: [GENERAL] SSL connection between PHP4 PostgreSQL ???

2004-10-05 Thread Joshua D. Drake
Mike Morris wrote: Hi, I've setup a postgres server (7.4) and confirmed that SSL is enabled - I can successfully connect via tcp socket over SSL using the psql client. From PHP4, how can I get the pg_connect function to negotiate an SSL connection? Hello, Have not done this in a while but I

Re: [PHP-DB] Auto-increment questions...

2004-10-05 Thread Andrew Kreps
On Tue, 5 Oct 2004 12:59:55 -0500, NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED] wrote: OK. The problem is I don't want the next highest number. There are gaps in the UID sequence. I need to find the next UNUSED number in the sequence which is rarely the highest number. As far as I know,

Re: [PHP-DB] Auto-increment questions...

2004-10-05 Thread Andrew Kreps
On Tue, 5 Oct 2004 14:18:55 -0700, Andrew Kreps [EMAIL PROTECTED] wrote: if (isset ($lastId) ($lastId $id - 1)) { $returnVal = $lastId + 1; } Sorry, I left a bit of a bug in there. You should exit the loop at this point, if you've found a gap. -- PHP Database Mailing

[PHP-DB] Fw: [PHP-ES] crc32 en PHP y VisualFox

2004-10-05 Thread Eduardo Cortés
PRUEBA CON ESTO ?php $data = 'dot'; echo dechex(crc32($data)); ? Returns 59278a3 Witch is missing a leading zero. ?php $data = 'dot'; echo str_pad(dechex(crc32($data)), 8, '0', STR_PAD_LEFT); ? Returns the correct string: 059278a3 AttE : - Eduardo

Re: [PHP-DB] Mail Header Redirect

2004-10-05 Thread Valerie
Yes, I put an echo statement inside the function itself and it returns fine. The problem appears to be with the header location. Thanks again, Valerie - Original Message - From: Bastien Koert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004

Re: [PHP-DB] Unusual Array Results

2004-10-05 Thread Andrew Kreps
On Tue, 5 Oct 2004 13:49:11 -0700, Wendell Frohwein [EMAIL PROTECTED] wrote: Hello all again, I am using php 5.0.1 with mysql 4.1.4a-gamma. After I did this upgrade, I noticed pieced of my code were failing. Took me a while to figure it out. When I would be working with arrays, sometimes I

Re: [PHP-DB] Database Backup

2004-10-05 Thread Andrew Kreps
On Tue, 5 Oct 2004 16:33:08 -0400, Aaron Todd [EMAIL PROTECTED] wrote: What is everyone doing to backup a MySQL database. Just in case...I'd like to backup mine, but I was wondering if there was a way to do it without going to a page and clicking a button. Is there a way to run a php script

Re: [PHP-DB] Auto-increment questions...

2004-10-05 Thread John Holmes
NIPP, SCOTT V (SBCSI) wrote: I am working on a database application for Unix user accounts. I want to be able to have a system that will provide me the next available numeric user ID. I have created a 2 column index table that simply includes UID and user name. This field is

Re: [PHP-DB] Safe / Secure Login Script

2004-10-05 Thread Gavin Amm
Sorry, I always forget to reply all... Original message bellow... -Original Message- From: Gavin Amm Sent: Tuesday, 5 October 2004 3:55 PM Subject: RE: [PHP-DB] Safe / Secure Login Script 1. Personal preference, but you may find sessions a better option (does not store user data (like

RE: [PHP-DB] Unusual Array Results

2004-10-05 Thread Wendell Frohwein
Hi Andrew. I'm using a class that was designed to search zip code radius's. Here is the piece that gets them. 2 Mile Radius Search From 90606 $radius=2; $zipArray1 = $zipLoc-inradius(90606,$radius1); $zip_results1=count($zipArray1); print_r($zipArray1); I'm starting to think it's not php. Just

[PHP-DB] Generate Menu based on database structure

2004-10-05 Thread Gavin Amm
Hi guys, I need to generate a menu based on the content structure of my database. The data is structured using an 'id' 'parent' relationship, for eg: id parent title 1 0 Home Page 6 1 My Page 2 9 6 My Page 3 15 9 My Page 4 21 6 My Page 5 22 9 My Page 6 23 22 My Page 7

Re: [PHP-DB] Unusual Array Results

2004-10-05 Thread Andrew Kreps
On Tue, 5 Oct 2004 16:50:04 -0700, Wendell Frohwein [EMAIL PROTECTED] wrote: Hi Andrew. I'm using a class that was designed to search zip code radius's. Here is the piece that gets them. 2 Mile Radius Search From 90606 $radius=2; $zipArray1 = $zipLoc-inradius(90606,$radius1);

[PHP-DB] Recursively determine parent records?

2004-10-05 Thread Murray @ PlanetThoughtful
Hi All, I have recordset that contains a hierarchical representation of records where a record's [parentid] field contains the recid of the record 'above' the current record. A representation might look like this: Recid, parentid, title 1, 0, Top level record 2, 0, Another top