[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 l

RE: [PHP-DB] Unusual Array Results

2004-10-05 Thread Wendell Frohwein
Yup that was it, can't believe these people sale this software like that. I should ask them to donate some money to everyone that helped me on this for debugging purposes. -Wendell Frohwein -Original Message- From: Andrew Kreps [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 5:

Re: [PHP-DB] Unusual Array Results

2004-10-05 Thread Andrew Kreps
On Tue, 5 Oct 2004 17:40:54 -0700, Wendell Frohwein <[EMAIL PROTECTED]> wrote: > Here is that inradius function: > I think I see your problem. The counter isn't initialized. Try sticking $i = 0 right here: if($db->affected_rows()<>0) { $i = 0; while($db->next_record()) { and see if that wo

RE: [PHP-DB] Unusual Array Results

2004-10-05 Thread Wendell Frohwein
Here is that inradius function: function inradius($zip,$radius) { global $db; $query="SELECT * FROM zipcodes WHERE zipcode='$zip'"; $db->query($query); if($db->affected_rows()<>0) { $db->next_record(); $lat=$db->f("lat");

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] 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 2

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.

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 p

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 autoincrement

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 scri

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] 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,

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

2004-10-05 Thread Eduardo Cortés
PRUEBA CON ESTO Returns 59278a3 Witch is missing a leading zero. Returns the correct string: 059278a3 AttE : - Eduardo Cortés C. Ingeniero Informático - Empresas Verschae M.R -

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

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

[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 beli

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

[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 whe

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

[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 somet

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 >

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 Log

[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 sa

[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 acci

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: Mail & Header Redirect

2004-10-05 Thread Amit Arora
Please note that HTTP headers are case sensitive. You should use: 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 submission of a form. I need to redirect to a c

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: (

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 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] 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 = ?col=colname&sort=asc'>Asc then on the server $col = $_REQUEST['col']; $sort= $_REQUEST['sort']; sql= "select * from tableName [where] order by $col $sort"; b

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

2004-10-05 Thread Bastien Koert
If its an autoincrement, the next highest number will be assigned by the db. There is no need to query the db to find it. Simply insert the record and leave the id field out of the insert statement. bastien From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: [PHP-

Re: [PHP-DB] Mail & Header Redirect

2004-10-05 Thread Bastien Koert
so try if ($sent==true) { mailsent(); } bastien From: "Valerie" <[EMAIL PROTECTED]> To: "Bastien Koert" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> Subject: Re: [PHP-DB] Mail & Header Redirect Date: Tue, 5 Oct 2004 12:34:27 -0400 When I echo $sent, it returns 1. Thanks, Valerie - Original Mes

[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

[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 link

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

[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] 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

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. > > B

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 a

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 i

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

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

2004-10-05 Thread veditio
To the group: 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 have a second pull do

[PHP-DB] php_mysql.dll (5.0.2) and libmysql.dll (4.0.20a) incompatibilities

2004-10-05 Thread Steve Olney
Hi, I have an incompatibility problem when trying to use PHP 5.0.2 with an installation of MySQL version 4.0.20a. The problem seems to be as follows: The php_mysql.dll file is compiled with support for two MySQL function calls (from the API) namely: mysql_drop_db and mysql_create_db (which are n

[PHP-DB] Mail & Header Redirect

2004-10-05 Thread Valerie
I have an email that is sent upon submission of a form. I need to redirect to a confirmation page if email is sent successfully. I thought the problem was that my email headers are already being sent, but when I removed them it still did not work. I need to bcc as well. headers: http://www.

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); if(is_resource($someother_db_linkid))