[PHP-DB] dbx question - specifying a port for pgsql

2002-09-27 Thread Jeff Van Campen
Hello, We have been using dbx here at work, and it seems that it could be a very useful tool, since we use several DBMSs. However, on one of our servers, we have to run Postgres on a port other than 5432. After reading the documentation and finding nothing there, I took a look at the

Re: [PHP-DB] [PHP-MySQL] lock a record of MySQL from PHP

2002-09-27 Thread Miles Thompson
1. Check MySQL syntax for locking a record 2. Build the query to do that, assigning it to something like $qry 3. mysql_query( $qry ) 4. Check for results HOWEVER - given that the web is a stateless environment, and a user can just close a browser, or walk away, or whatever, are you SURE you

SV: [PHP-DB] Current row of query

2002-09-27 Thread Henrik Hornemann
Actually you dont need to keep track of the row number. Yoy could just alternate the two colors like this: while ( $row = mysql_fetch_array($result) ) { $bgCol = ( $bgCol == #EADBC6}?#EFE1CE:#EADBC6; echo ..; } hth Henrik Hornemann -Oprindelig meddelelse- Fra: Patrick Lebon

Re: [PHP-DB] Re: ODBC?

2002-09-27 Thread Andrew Hill
And if you are using ODBC from *nix, you will want to configure it --with-iodbc as per the HOWTO at www.iodbc.org. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software - http://www.openlinksw.com On Tuesday, September 24, 2002, at 10:34 AM, Ever Lopez wrote: First

[PHP-DB] Dates

2002-09-27 Thread Steve Vernon
Hiya, I am doing a database of things that have dates, some I know the month and year of, some I only know the year. I suppose I could do a field for the year, and one for month, and then allow the month to be NULL. But is there a date type that allows years and / or months??? Thanks,

[PHP-DB] Flush database

2002-09-27 Thread wade
I am storing IP addresses in a database, but after an hour has passed I want to delete all the IP addresses from that database. I want to do this based on the server time. Example.. Someone comes to my web page, I store their IP address in my database. So now I write a PHP script that says if

Re: [PHP-DB] Dates

2002-09-27 Thread Micah Stevens
May I recommend setting the field type to INT, and just using timestamps? That's what I usually do, then you can manipulate things however you want. Much more convenient than the date style type I think. Looking at how the MySQL docs talk about the DATETIME field, I bet the database is doing

Re: [PHP-DB] Flush database

2002-09-27 Thread Ignatius Reilly
why not simply store the server time at log in in the DB after a successful log in together with the IP address; and at the next log in request perform a SQL time difference comparison? Ignatius - Original Message - From: wade [EMAIL

Re: [PHP-DB] Flush database

2002-09-27 Thread Brad Bonkoski
How about writting the IP address to the database with a timestamp, then when a matching IP address arrives you view the timestamp and if it has been more then a hour, they can view the page, which would force you to update the timestamp. Of course you would probably need to write a stand-alone

Re: [PHP-DB] Flush database

2002-09-27 Thread Jim Hunter
First make sure that you are storing the IP and the time it was saved in the database. Then I would have 3 queries: 1) a query to see if the IP address is in the database and less then an hour old. 2) a query to save the IP and time into the database 3) a query to delete all entries over 1

Re: [PHP-DB] Flush database

2002-09-27 Thread Brad Bonkoski
Sounds like we are all on similar pages with timestamping, but if you issue a delete query every time the page is viewed it could create some sub-par performance based on number of hits. i.e. if the site gets 100 hits in the first 10 minutes of operation, it would issue delete logic and queries

[PHP-DB] Flush database

2002-09-27 Thread wade
So how would one compare the timestamp? how would you write if timestamp is greater than timestamp + 1 hour { Ok to view page run query to update that IP to new timestamp -- I think this will be better than a delete statement } else { Can't view page } I know you

RE: [PHP-DB] Dates

2002-09-27 Thread John Holmes
    I am doing a database of things that have dates, some I know the month and year of, some I only know the year. I suppose I could do a field for the year, and one for month, and then allow the month to be NULL. But is there a date type that allows years and  / or months??? If that's all you

Re: [PHP-DB] Flush database

2002-09-27 Thread Micah Stevens
Using UNIX timestamps: if (time() - $timestamp mktime(1,0,0,0,0,0)) { // Difference it greater than one hour. Perform rejection code here } else { // Difference is one hour or less. Perform acception code here. } At 04:35 PM 9/27/2002 -0500, wade wrote: So how