php3-list | 2000051
Date: 05/15/00
- Next message: TomHenry: "Re: [PHP3] Making my WebPages search engine friendly"
- Previous message: Bomelin, Joakim: "[PHP3] AGIs with Truetype."
- In reply to: Marian Vasile: "[PHP3] Registration database !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <001101bfbdfb$c0166f80$43fbb3c3 <email protected>>, marian_2001 <email protected>
("Marian Vasile") wrote:
> Who can give me an example of MY-SQL database with a simple table containing
> these fields:
> Name
> Registrationcode
> IP1
> IP2
> IP3
> IP4
>
> This database must be updated all the time using an PHP page.
> Something like...
> Visitor will go directly to this link:
> www.mysite.com/registration.php3?name=Marian&Registrationcode=87533
> and in that moment database (MYSQL) must be uploaded with IP. When visitor
> come from more than 4 distinct IP then no uploading is made....
> Anyone can help ?
At least one of us is very confused...
How could a visitor come from more than one IP at any given instant in time?
Or are you saying that after the fourth visitor with the same registration
code, their info will not be counted?...
If that's the case, the first thing I would do is make it a two-table
database. (See previous posts and my most recent "Tip" on
http://www.zend.com/):
Since this looks altogether too much like a mult-level marketing thing,
I'm going to use those terms in my example. Sorry if I'm confusing you,
but I dunno what else you could be trying to do that looks like this...
create table upline(
registrationcode int4,
name text
);
create table downline(
registrationcode int4,
IP text
);
<?php
//Limit to 4 downlines:
$downlinemax = 4;
$query = "select count(*) from downline where registrationcode =
$Registrationcode";
$downline = mysql_query($query) or die(mysql_query());
$downlinecount = mysql_result($downline, 0, 0);
if ($downlinecount < $downlinemax){
$query = "insert into downline(registrationcode, IP)
values($Registrationcode, '$REMOTE_ADDR')";
$insert = mysql_query($query) or die(mysql_query());
}
?>
I'll leave it to you to decide if this new person should be inserted into
'upline' or not...
If I'm just completely missing your question, try again in different words...
(Tell us what your application is doing.)
-- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: TomHenry: "Re: [PHP3] Making my WebPages search engine friendly"
- Previous message: Bomelin, Joakim: "[PHP3] AGIs with Truetype."
- In reply to: Marian Vasile: "[PHP3] Registration database !"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

