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
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
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
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
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,
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
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
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
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
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
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
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
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
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
14 matches
Mail list logo