Re: [PHP-DB] unsub?

2002-01-09 Thread Jason Wong

On Thursday 10 January 2002 06:56, Richard Stringer-Hye wrote:
> Will someone please send me the correct unsubscribed sequence for this
> list? Have tried from phpnet with no success.. Thanks.

Have you tried this?

> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

Available at the bottom of every message in this list!

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: [PHP] need help looping through each record with a query -stumped

2002-01-09 Thread Brian Tully

thanks guys, I really appreciate it.

first off, Martin your suggestion looks great but I don't think its SQL
syntax is supported by MySQL. It's a good start though - gives me something
to work with :)

I guess I need to clarify a bit more about what needs to happen...

in the MySQL database, there are two tables involved - "users" and "scores"

Both tables have a "Username" field so Username can be used as a key for
joins.

Unfortunately, since this database is ancient and far from
normalized/optimized, neither table uses unique id's. So looking at the
scores table the fields are Username, Month, and Score.

Another big dud is the fact that the Month field is varchar, not a date
field. So this makes it difficult to sort, as Mehmet suggested.

And this also makes it difficult to write a function to automate the 3
consecutive month aspect that's required. That's why I had to code to look
for specific months - this month (January) counting back 3 (December,
November, October). Students have until the end of the month to take the
monthly test - so they can maintain certification if they have passed Dec.,
Nov., and Oct.'s tests. Or, if they have taken and passed January's test,
they can be certified if they've also passed December and November. Make
sense? 4 months total: if the first 3 are passed and/or last 3 are passed
the student is "certified".

So...

I tried to grab everyone's Username with the first query (which should
result in an array of about 2,000 records). Then using the "while" function
I thought I could perform a query for each Username.

So for each Username in the first result set, I would query the database and
select that user's test scores. I would then process these results by
looking for specific months and checking to see if those  scores were 75 or
better.

The problem lies in the loop - it doesn't go through each Username in the
system like it's supposed to. Are you not supposed to have a 'while' loop
inside another 'while' loop?

I've really been fighting to restructure the whole database, as it really
was poorly planned. But the system is old and there are many, many
applications that rely on it. So it'll take time and caution to make that
move.

In the meantime I'm just trying to figure out how to get this certification
bug resolved. I need to finish writing this script so that the database can
accurately reflect who is certified.

Hope that clarifies things. Any help would be greatly appreciated. In the
meantime I'm going to play around with Martin's sql statement - seems like a
good start.

thanks!
brian


On 1/9/02 7:18 PM, "Martin Towell" <[EMAIL PROTECTED]> wrote:

> i'm converting Brian's php code into sql - he's looking for scores in Oct,
> Nov, Dec and Jan, that's what I'm doing in the sql, and the if's all have
> "if score >= 75" which is what I'm doing in the sql too, Brian is getting a
> total "$tally++"  so am I "count(*)"...
> 
> -Original Message-
> From: Mehmet Kamil ERISEN [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 10, 2002 11:10 AM
> To: Martin Towell; 'Brian Tully'; PHP DB; PHP
> Subject: RE: [PHP] need help looping through each record with a query -
> st umped
> 
> 
> If you are querying the Score >= 75 how are you ging to
> take the "Consecutive" requirement into the account.
> --- Martin Towell <[EMAIL PROTECTED]> wrote:
>> could you change this
>> 
>> $query2 = ("SELECT Month, Score FROM scores WHERE
>> Username =
>> '$Username'");
>> 
>> to
>> 
>> $query2 = ("SELECT count(*) FROM scores WHERE
>> Username = '$Username' and
>> Score >= 75 and Month in ('January', 'December',
>> 'November', 'October')");
>> $result2 = mysql_query($query2) or die ("Cannot
>> execute query" .
>> mysql_error ());
>> $tally = mysql_fetch_row($result2);
>> 
>> take out the while loop (the one with all the if's in it)
>> and, if I haven't
>> stuffed up somewhere, all will be okay - (btw, I haven't
>> had experience
>> using mysql, but I'm assuming that it's sql is compatable
>> with interbase and
>> oracle)
>> 
>> Hope that helps
>> Martin
>> 
>> -Original Message-
>> From: Brian Tully [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, January 10, 2002 8:59 AM
>> To: PHP DB; PHP
>> Subject: [PHP] need help looping through each record with
>> a query -
>> stumped
>> 
>> 
>> hey folks - 
>> 
>> i'm stumped. been working on what i thought would be a
>> simple script to
>> cycle through users' records and perform a query. But I
>> can't get the loops
>> right, it seems like only one or two records get updated.
>> 
>> Using MySQL, we have about 2000 students enrolled. each
>> month they take a
>> test. if they pass the most recent 3 tests
>> (consecutively) they earn
>> "Certified" status and get a few perks.
>> 
>> Somehow the certification status' got messed up. So I'm
>> trying to create a
>> script that will look through each user's test records to
>> see if they've
>> passed the last 3 tests, and if so, change their
>> certification status in the

RE: [PHP-DB] Concept help required

2002-01-09 Thread olinux

Haven't been following and not sure if this is what
you're after, but these are some great data models:
http://www.databaseanswers.com/data_models/index.htm

HTH
olinux
--- Tim Foster <[EMAIL PROTECTED]> wrote:
> 
> You wouldn't happen to have a spare ELH diagram (or
> two) lying around
> that one could take a look at, would you?
> 
> Thanks.
> 
> TIM
> -When you save for a long time to buy something,
> then you find
> that you can't afford it --- that's inflation.
> 
> 
> > -Original Message-
> > From: DL Neil
> [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 09, 2002 7:23 AM
> > To: George Pitcher; [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] Concept help required
> 
> 
> > =The purpose of an ELH diagram is to take a piece
> of data
> > (in your case, because we are assuming/checking
> > normalisation, I'd 'cheat' and work at the table
> level -
> > rather than something more atomic like the
> data-item
> > level). Once again we draw boxes (I have some
> wonderful s/w
> > for doing these tasks, but it is M$). A single
> > label/box at the top, featuring the name of the
> data-unit,
> > and I would guess a minimum of three (must be my
> > favorite number!) boxes in the next row,
> representing the
> > arrival/creation of the data, its use within the
> > system, and the removal of the data from the
> system once
> > its usefulness has subsided, respectively. The
> third
> > row of boxes represents the actual, individual
> events in
> > the life-cycle/daily operation of the system, and
> how
> > they alter/update/use the data. Lines drawn
> between the
> > boxes show how these events relate and where there
> may
> > be some iteration.
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Database statistics, submissions over last 12 hours

2002-01-09 Thread Richard R Dutton

Hi,

I have a database containing a field of type datetime (-00-00 00:00:00).

The datetime field of each new record is set to the current date and time
when a new record is added. I would like to be able to produce some
statistics on the new records entered within the past 12 hours. I would like
to produce an array of 12 values, each value representing the number of
records with a timedate value within that hour.

I am not sure quite how to explain this properly, so I guess I'll provide an
example to make it a bit clearer, say I have the following database table
'dates' as follows:

id date
0 2001-12-16 13:20:51
1 2001-12-16 15:13:19
2 2001-12-16 15:43:38
3 2001-12-16 15:53:23
4 2001-12-16 16:16:31
5 2001-12-16 16:31:52
6 2001-12-16 17:28:06
7 2001-12-16 18:06:41
8 2001-12-16 21:08:30
9 2001-12-16 21:15:01

and so if the current time was 21:18 when the script was run, I would like
it to output an array with values as follows
{0,0,0,1,0,3,2,1,1,0,0,2}

I hope this makes a bit of sense to someone who might be able to help me.

Richard


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: [PHP] need help looping through each record with a query - st umped

2002-01-09 Thread Martin Towell

i'm converting Brian's php code into sql - he's looking for scores in Oct,
Nov, Dec and Jan, that's what I'm doing in the sql, and the if's all have
"if score >= 75" which is what I'm doing in the sql too, Brian is getting a
total "$tally++"  so am I "count(*)"...

-Original Message-
From: Mehmet Kamil ERISEN [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 11:10 AM
To: Martin Towell; 'Brian Tully'; PHP DB; PHP
Subject: RE: [PHP] need help looping through each record with a query -
st umped


If you are querying the Score >= 75 how are you ging to
take the "Consecutive" requirement into the account.
--- Martin Towell <[EMAIL PROTECTED]> wrote:
> could you change this
> 
> $query2 = ("SELECT Month, Score FROM scores WHERE
> Username =
> '$Username'");
> 
> to
> 
> $query2 = ("SELECT count(*) FROM scores WHERE
> Username = '$Username' and
> Score >= 75 and Month in ('January', 'December',
> 'November', 'October')");
> $result2 = mysql_query($query2) or die ("Cannot
> execute query" .
> mysql_error ());
> $tally = mysql_fetch_row($result2);
> 
> take out the while loop (the one with all the if's in it)
> and, if I haven't
> stuffed up somewhere, all will be okay - (btw, I haven't
> had experience
> using mysql, but I'm assuming that it's sql is compatable
> with interbase and
> oracle)
> 
> Hope that helps
> Martin
> 
> -Original Message-
> From: Brian Tully [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 10, 2002 8:59 AM
> To: PHP DB; PHP
> Subject: [PHP] need help looping through each record with
> a query -
> stumped
> 
> 
> hey folks - 
> 
> i'm stumped. been working on what i thought would be a
> simple script to
> cycle through users' records and perform a query. But I
> can't get the loops
> right, it seems like only one or two records get updated.
> 
> Using MySQL, we have about 2000 students enrolled. each
> month they take a
> test. if they pass the most recent 3 tests
> (consecutively) they earn
> "Certified" status and get a few perks.
> 
> Somehow the certification status' got messed up. So I'm
> trying to create a
> script that will look through each user's test records to
> see if they've
> passed the last 3 tests, and if so, change their
> certification status in the
> database.
> 
> Not very elegant since there are so many records in the
> database (2000
> users), but I don't think i have a choice.
> 
> Anyways, I've tried to loop through each user, and for
> each user loop
> through their scores. But the loops aren't working. I'm
> sure it's something
> simple and obvious I'm missing but my brain is fried!
> 
> I'd appreciate it if someone could take a look and offer
> any advice. It's
> about 65 lines of code (with comments).
> 
> thanks in advance!
> brian
> 
> 
> 
>  
> include("/home/includes/.connect.inc");
> 
> // Select each Username and start a loop of queries for
> each user
> 
> $query = ("SELECT Username, Certification FROM users");
> 
> $result = mysql_query($query)
> or die ("Cannot execute query" . mysql_error ());
> 
> /*
> here starts the loop - for each user in the database we
> look at their test
> records and try to establish if they have passed the last
> 3 tests
> consecutively
> */
> 
> while (list($Username, $Certification) =
> mysql_fetch_row($result)) {
> 
> $query2 = ("SELECT Month, Score FROM scores WHERE
> Username =
> '$Username'");
> 
> $result2 = mysql_query($query2) or die ("Cannot
> execute query" .
> mysql_error ());
> 
> 
> /*
> for each score record the user has, check to see if
> they've passed the last
> 3 tests
> */
> 
> while (list($Month, $Score) =
> mysql_fetch_row($result2)) {
> 
> 
> /* 
> here we initialize a counter which we'll use to tally how
> many tests the
> user has passed over the past 3 months
> */
> 
> $tally = 0;
> 
> if (($Month == 'January') && ($Score >= 75)) {
>
> $tally++;
> }
> 
> if (($Month == 'December') && ($Score >= 75)) {
>
> $tally++;
> }
> 
> if (($Month == 'November') && ($Score >= 75)) {
>
> $tally++;
> }
> 
> if (($Month == 'October') && ($Score >= 75)) {
>
> $tally++;
> }
> 
> }
> 
> /*
> the concept is that if a user has taken and passed the
> last 3 tests, they
> become certified. so we look at the current month first
> and go back 3
> months, since it may be the beginning of the month and
> they may not have
> taken the current months test yet. Since we increase the
> counter for each
> passed test, if the counter equals 3 or more this means
> they have passed 3
> tests and are thereby certified. So we update their
> certification status in
> the database.
> */
> 
> 
> if ($tally >= 3) {
> 
> $query1 = ("UPDATE use

[PHP-DB] RE: [PHP] need help looping through each record with a query - stumped

2002-01-09 Thread Martin Towell

could you change this

$query2 = ("SELECT Month, Score FROM scores WHERE Username =
'$Username'");

to

$query2 = ("SELECT count(*) FROM scores WHERE Username = '$Username' and
Score >= 75 and Month in ('January', 'December', 'November', 'October')");
$result2 = mysql_query($query2) or die ("Cannot execute query" .
mysql_error ());
$tally = mysql_fetch_row($result2);

take out the while loop (the one with all the if's in it) and, if I haven't
stuffed up somewhere, all will be okay - (btw, I haven't had experience
using mysql, but I'm assuming that it's sql is compatable with interbase and
oracle)

Hope that helps
Martin

-Original Message-
From: Brian Tully [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 8:59 AM
To: PHP DB; PHP
Subject: [PHP] need help looping through each record with a query -
stumped


hey folks - 

i'm stumped. been working on what i thought would be a simple script to
cycle through users' records and perform a query. But I can't get the loops
right, it seems like only one or two records get updated.

Using MySQL, we have about 2000 students enrolled. each month they take a
test. if they pass the most recent 3 tests (consecutively) they earn
"Certified" status and get a few perks.

Somehow the certification status' got messed up. So I'm trying to create a
script that will look through each user's test records to see if they've
passed the last 3 tests, and if so, change their certification status in the
database.

Not very elegant since there are so many records in the database (2000
users), but I don't think i have a choice.

Anyways, I've tried to loop through each user, and for each user loop
through their scores. But the loops aren't working. I'm sure it's something
simple and obvious I'm missing but my brain is fried!

I'd appreciate it if someone could take a look and offer any advice. It's
about 65 lines of code (with comments).

thanks in advance!
brian



= 75)) {
   
$tally++;
}

if (($Month == 'December') && ($Score >= 75)) {
   
$tally++;
}

if (($Month == 'November') && ($Score >= 75)) {
   
$tally++;
}

if (($Month == 'October') && ($Score >= 75)) {
   
$tally++;
}

}

/*
the concept is that if a user has taken and passed the last 3 tests, they
become certified. so we look at the current month first and go back 3
months, since it may be the beginning of the month and they may not have
taken the current months test yet. Since we increase the counter for each
passed test, if the counter equals 3 or more this means they have passed 3
tests and are thereby certified. So we update their certification status in
the database.
*/


if ($tally >= 3) {

$query1 = ("UPDATE users SET Certification = 'Y' WHERE Username =
'$Username'");
   
$result1 = mysql_query($query1) or die ("Cannot update user to
Certified" . mysql_error ());
   
}
}

print ("Update complete!");

?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



RE: [PHP-DB] Concept help required

2002-01-09 Thread Tim Foster


You wouldn't happen to have a spare ELH diagram (or two) lying around
that one could take a look at, would you?

Thanks.

TIM
-When you save for a long time to buy something, then you find
that you can't afford it --- that's inflation.


> -Original Message-
> From: DL Neil [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 09, 2002 7:23 AM
> To: George Pitcher; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Concept help required


> =The purpose of an ELH diagram is to take a piece of data
> (in your case, because we are assuming/checking
> normalisation, I'd 'cheat' and work at the table level -
> rather than something more atomic like the data-item
> level). Once again we draw boxes (I have some wonderful s/w
> for doing these tasks, but it is M$). A single
> label/box at the top, featuring the name of the data-unit,
> and I would guess a minimum of three (must be my
> favorite number!) boxes in the next row, representing the
> arrival/creation of the data, its use within the
> system, and the removal of the data from the system once
> its usefulness has subsided, respectively. The third
> row of boxes represents the actual, individual events in
> the life-cycle/daily operation of the system, and how
> they alter/update/use the data. Lines drawn between the
> boxes show how these events relate and where there may
> be some iteration.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] unsub?

2002-01-09 Thread Richard Stringer-Hye

Will someone please send me the correct unsubscribed sequence for this list? Have 
tried from 
phpnet with no success.. Thanks.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] need help looping through each record with a query - stumped

2002-01-09 Thread Brian Tully

hey folks - 

i'm stumped. been working on what i thought would be a simple script to
cycle through users' records and perform a query. But I can't get the loops
right, it seems like only one or two records get updated.

Using MySQL, we have about 2000 students enrolled. each month they take a
test. if they pass the most recent 3 tests (consecutively) they earn
"Certified" status and get a few perks.

Somehow the certification status' got messed up. So I'm trying to create a
script that will look through each user's test records to see if they've
passed the last 3 tests, and if so, change their certification status in the
database.

Not very elegant since there are so many records in the database (2000
users), but I don't think i have a choice.

Anyways, I've tried to loop through each user, and for each user loop
through their scores. But the loops aren't working. I'm sure it's something
simple and obvious I'm missing but my brain is fried!

I'd appreciate it if someone could take a look and offer any advice. It's
about 65 lines of code (with comments).

thanks in advance!
brian



= 75)) {
   
$tally++;
}

if (($Month == 'December') && ($Score >= 75)) {
   
$tally++;
}

if (($Month == 'November') && ($Score >= 75)) {
   
$tally++;
}

if (($Month == 'October') && ($Score >= 75)) {
   
$tally++;
}

}

/*
the concept is that if a user has taken and passed the last 3 tests, they
become certified. so we look at the current month first and go back 3
months, since it may be the beginning of the month and they may not have
taken the current months test yet. Since we increase the counter for each
passed test, if the counter equals 3 or more this means they have passed 3
tests and are thereby certified. So we update their certification status in
the database.
*/


if ($tally >= 3) {

$query1 = ("UPDATE users SET Certification = 'Y' WHERE Username =
'$Username'");
   
$result1 = mysql_query($query1) or die ("Cannot update user to
Certified" . mysql_error ());
   
}
}

print ("Update complete!");

?>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] query and count

2002-01-09 Thread Daniel Barton

Hi,
I hate to simply refer to other sources in a response, but cross-tabulations are a 
large and rich subject which are
too large for the time I have to write this email. I would suggest reading this 
article:

http://www.devshed.com/Server_Side/MySQL/MySQLWiz

which is a pretty good source of information on how to obtain some very useful results 
from MySQL tables. Be more than
happy to answer questions on cross-tabs though - it's a very fun way to query.

-db

Barry Rumsey wrote:

> I have two tables, the first one I query like :
>
> $query = "SELECT * FROM xp_topics WHERE artist_count='artist' AND topictext LIKE
>   'B%' ORDER BY artist_count DESC limit 0,5"; $req = mysql_query($query);
>   $res = mysql_num_rows($req); if ($res == 0) { echo "
>   Sorry there is no result.";} else { while($row = 
>mysql_fetch_array($req))
> { extract($row); echo ("$topictext
> "); } }
>
> The second one I want to do a count for each one that was returned above. eg Billie 
>(2) , Bill (4) Bret (1)
>  How would I set up the query to do both?

--
--
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Protecting php scripts from source being downloaded

2002-01-09 Thread Tom

sorry, as I said Im kinda new, I was downloading the file from my webserver
to my computer, and it downloaded the php file as a php file, non parsed by
the preprocessor. But when other people download it it does only give the
source

sorry :)

"Neil Thomson" <[EMAIL PROTECTED]> wrote in message
003e01c19933$7300d220$113331d2@home">news:003e01c19933$7300d220$113331d2@home...
> u can download a php page from a download manager ? i just tryed with
> flashget... & it phrased the php page into html first.. ? ?
>
> if you want to protect your say.. variables file from some1 trying in the
> address of it. heres a simple way. in the variables file include
> @header(status: error 404); (or how ever that code goes). then in the page
u
> want to include this. start the html tag first  then include this
> page. the @ will make it not report errors. so u can inclue the page
> perfectally.. & when people try to look @ it, it will say it doesnt exist.
>
> Neil
>
> - Original Message -
> From: Tom <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 09, 2002 8:00 AM
> Subject: [PHP-DB] Protecting php scripts from source being downloaded
>
>
> > Hi, im kinda new to this so be kind :)
> >
> > Im using mysql and php to create test databases (guestbook etc, basic
> > stuff), but it doesnt seem so secure, people can just use a download
> manager
> > to download the php files and steal the mysql passwords. Is there anyway
> to
> > make it so they can see the php files through the brower but not
download
> my
> > homecrafted php?
> >
> > Ive looked through many websites and the history of this, all I could
find
> > was one post which was to encript the files (this isnt really suitable
for
> > me as I edit bits and bobs as I go along). Is there anyway I can setup
> > access as said in the above? Or just hid the password somehow? Im using
> IIS
> > 5.1.
> >
> > thanks
> > tom
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Updating table with data from another table in the same database

2002-01-09 Thread DL Neil

Markus,

> I have the daunting task of porting an Access database to
> MySQL. It's unbeliveably poorly designed, and columns
> id, name, issn, year, info, volume, numbers and remarks.
> I made another table, names, that's got columns id and name.
>
> I used
>
> INSERT INTO names (name) SELECT DISTINCT mag_table.name FROM mag_table
>
> to get, as one would expect, the distinct magazine names into the names-
> table. Now, what I'd want to do, is to replace the names in mag_table
> with the id-numbers from the names table, but I can't figure out how
> to do it. I tried
>
> UPDATE mag_table SET name=names.id WHERE name=names.name
>
> but MySQL tells me the following :
>
> ERROR 1109: Unknown table 'names' in where clause
>
> I haven't go perror to work at all, it just says Unknown error.
>
> Has anyone ever done anything like this, and, if so, how?
> I was thinking about a PHP-script, but if someone has got
> a query that would take care of this I wouldn't have to get into
> that.


=A daunting task indeed, however it's a move for the better, so more power to your 
right arm/kung-fu grip...
However let's not jump to quickly to PHP, and keep it all within MySQL if we can...

=So you started with one table: mag_table which contains the columns id, name, issn, 
year, info, volume, numbers
and remarks.

=Then you created a table called names (which was too nebulous for me, so I created 
table MagNames with columns
MagId (auto_increment) and MagName). At which point we arrive at your question.

=UPDATE only works on a single table - but you are right on the other criteria: that 
the row already exists. So
a good first try, but sorry that one ain't going to get off the ground, Wilbur!

=I always think that it would be logical to use a REPLACE here, but no REPLACE doesn't 
like a table REPLACING
data within itself, unless the whole row is replaced - and even then it cannot refer 
to (copy values from)
itself. So again, close but no coconut!

=So we are pushed into the waiting arms of the INSERT command. Which requires an 
existing table and will
cheerfully add new records. INSERT-ing data from another table/tables requires the 
INSERT...SELECT option (see
manual 6.4.3  INSERT Syntax)

=Accordingly I recommend CREATE-ing a new table, eg the prosaically named 
new_mag_table with the columns Id,
MagId, ISSN, Year, Info, Volume, Numbers, Remarks - in other words, exactly the same 
as mag_table but with MagId
instead of the (mag)name. Then work out how to join the two 'source' tables to create 
each record in turn (write
the SELECT clause). Then construct the INSERT clause, slap the SELECT on its end, and 
the retrieved data will be
inserted into the new_mag_table, eg:

INSERT INTO new_mag_table
 ( Id, MagId, ISSN, Year, Info, Volume, Numbers, Remarks )
 SELECT Id, MagNames.MagId, ISSN, Year, Info, Volume, Numbers, Remarks
  FROM MagNames, Mag_Table
  WHERE MagName = Name

=once the new table is checked, if desired you can delete the original and rename the 
new...

=NB if the (new_)mag_table Id field is auto_increment, do NOT set this in the new 
table (just in case there are
discontinuities in the sequence (eg caused by DELETE-ions)). After checking and making 
the decision to adopt the
new table, then modify the definition of the table/Id column, and the very next time 
you INSERT a record it will
take on the next highest Id!

=Ok?
=dn



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Protecting php scripts from source being downloaded

2002-01-09 Thread Ryan Marrs

Or you could do something like:

if(!empty($PHP_SELF))
{
if(stristr($PHP_SELF," config.php"))
{ 
header("Status: 404 Not Found");
}
}

that's assuming you use the register_globals.  If not, then you could simply
grab $PHP_SELF from the environment variables.

Ryan


-Original Message-
From: Neil Thomson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 09, 2002 12:31 PM
To: Tom; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Protecting php scripts from source being downloaded

u can download a php page from a download manager ? i just tryed with
flashget... & it phrased the php page into html first.. ? ?

if you want to protect your say.. variables file from some1 trying in the
address of it. heres a simple way. in the variables file include
@header(status: error 404); (or how ever that code goes). then in the page u
want to include this. start the html tag first  then include this
page. the @ will make it not report errors. so u can inclue the page
perfectally.. & when people try to look @ it, it will say it doesnt exist.

Neil

- Original Message -
From: Tom <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 09, 2002 8:00 AM
Subject: [PHP-DB] Protecting php scripts from source being downloaded


> Hi, im kinda new to this so be kind :)
>
> Im using mysql and php to create test databases (guestbook etc, basic
> stuff), but it doesnt seem so secure, people can just use a download
manager
> to download the php files and steal the mysql passwords. Is there anyway
to
> make it so they can see the php files through the brower but not download
my
> homecrafted php?
>
> Ive looked through many websites and the history of this, all I could find
> was one post which was to encript the files (this isnt really suitable for
> me as I edit bits and bobs as I go along). Is there anyway I can setup
> access as said in the above? Or just hid the password somehow? Im using
IIS
> 5.1.
>
> thanks
> tom
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Protecting php scripts from source being downloaded

2002-01-09 Thread Neil Thomson

u can download a php page from a download manager ? i just tryed with
flashget... & it phrased the php page into html first.. ? ?

if you want to protect your say.. variables file from some1 trying in the
address of it. heres a simple way. in the variables file include
@header(status: error 404); (or how ever that code goes). then in the page u
want to include this. start the html tag first  then include this
page. the @ will make it not report errors. so u can inclue the page
perfectally.. & when people try to look @ it, it will say it doesnt exist.

Neil

- Original Message -
From: Tom <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 09, 2002 8:00 AM
Subject: [PHP-DB] Protecting php scripts from source being downloaded


> Hi, im kinda new to this so be kind :)
>
> Im using mysql and php to create test databases (guestbook etc, basic
> stuff), but it doesnt seem so secure, people can just use a download
manager
> to download the php files and steal the mysql passwords. Is there anyway
to
> make it so they can see the php files through the brower but not download
my
> homecrafted php?
>
> Ive looked through many websites and the history of this, all I could find
> was one post which was to encript the files (this isnt really suitable for
> me as I edit bits and bobs as I go along). Is there anyway I can setup
> access as said in the above? Or just hid the password somehow? Im using
IIS
> 5.1.
>
> thanks
> tom
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Listing select * from table; on PHP

2002-01-09 Thread Rick Emery

";
}

?>

Don't forget all other HTML tags you need to pack around this
-Original Message-
From: louie miranda [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 6:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Listing select * from table; on PHP





--

Hi, i have tried this php script to view my table db,
but when i browse it over the net i couldn't see anything
just plain blank page.

Hm, Can u help me make this show tables over on php
and post it over.



thanks,
louie...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Protecting php scripts from source being downloaded

2002-01-09 Thread Tom

Hi, im kinda new to this so be kind :)

Im using mysql and php to create test databases (guestbook etc, basic
stuff), but it doesnt seem so secure, people can just use a download manager
to download the php files and steal the mysql passwords. Is there anyway to
make it so they can see the php files through the brower but not download my
homecrafted php?

Ive looked through many websites and the history of this, all I could find
was one post which was to encript the files (this isnt really suitable for
me as I edit bits and bobs as I go along). Is there anyway I can setup
access as said in the above? Or just hid the password somehow? Im using IIS
5.1.

thanks
tom



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] OCI8 Function Clarification

2002-01-09 Thread Randall Barber

I have a simple SELECT statement that returns more than one row.
When I do something like this:

do
{
.
} while (OCIFetch($qryResult) != false);

I get an "Out of sequence" error on OCIFetch.  So then I tried this:

$numRows = OCIRowCount($qryResult);
for($i = 0; $i < $numRows; $i++)
{
OCIFetch($qryResult);
..
}

Now I get 0, for the row count.  If I call OCIFetch once, before the OCIRowCount, I 
get a value of 1 (which makes sense I guess, since it will only fetch one row at a 
time).

*** How do I step through a SELECT result set?

Thanks
RDB



[PHP-DB] Re: Pulling a long list of data stalls PHP

2002-01-09 Thread Ian Ferger


try mysql_fetch_array... mysql_fetch_row is a crappy old function.

- Original Message -
From: "Peter Westergaard" <[EMAIL PROTECTED]>
Newsgroups: php.db
To: <[EMAIL PROTECTED]>
Sent: Monday, January 07, 2002 8:32 AM
Subject: Pulling a long list of data stalls PHP


> Hi,
>
> I'm attempting to pull about 300 rows from a mysql database, (all rows in
> the table).
> I can pull the first 10, the first 20, the first 30, no problem.  (using
> LIMIT (start), (10|20|30)... in the SQL statement)
>
> But if I attempt to pull all of them (no LIMIT clause), or even the first
> (x) where (x) is much more than 30, using a simple while
> (mysql_fetch_row($sql,$db))... construction, IE just idles, tells me it is
> loading the page, and never displays anything.   When I press "STOP", I
> have a hung PHP process in my Task Manager, which I cannot kill!
>
> Does anyone know what could cause this behaviour?  It seems so simple,
what
> I'm trying to do, that I'm going insane.
> Very frustrated.
>
> Please, someone help a poor newbie out!
> -P
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: Pulling a long list of data stalls PHP

2002-01-09 Thread Max Sullivan



Just curious, but which version of PHP are you using, the ISAPI or CGI.
I've tried the isapi version before and had problems like this.  PHP
would crash and leave orphaned instances of php.  If your using the
isapi version try the cgi and see if it works for you.





-Original Message-
From: Peter Westergaard [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 08, 2002 6:39 PM
To: [EMAIL PROTECTED]
Subject: Re: Pulling a long list of data stalls PHP


Miles, you wrote:
 >Is your table indexed on the field your query is based on? That will
>greatly speed up the query.  >  >Miles Thompson

I'm afraid in my case, the query needs to be pretty much a complete
table dump.

Even if I filter a subset the data, my relational DB experience (not
deep, admittedly, and only with enterprise products like Oracle and ...
ugh...
MSSql) tells me that indices on tables less than a few thousand entires
cost more in upkeep than they gain in response.  And this is only about 
300-400 rows... and more to the point, this happens when I pull more
than 
30 of them or so!  I feel that something MUST be wrong!

But all of that aside, the problem isn't just that it takes a "long 
time"... the
problem seems to be that it literally *crashes* the instance of PHP!
(The webpage never finishes loading, and the CPU meter drops back down
to idle levels, and if I cancel the webpage, I leave an orphaned
instance of PHP.exe running, which I cannot kill even from my Win2000
Task Manager).

I mean, I'm a newbie and I'll admit that, but that just Don't seem
Right.

Does ANYONE have any idea what might be happening and how I can fix it?
Please? :)

-P



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] RE: query and count

2002-01-09 Thread Peter Westergaard

It seems like what you're looking for is first to do a "SELECT DISTINCT 
.." to find all the unique topic names in the system.  

This, in your case, would present you with Billie, Bill, Bret, ... etc.

Then, in a loop as you traverse this result, create a query for the 
count of each of these specifically.  

That's how I would approach it.  Don't forget to index your database 
based on the topic names, if it has very many records.  

Cheers,
-- Peter





===
EASY and FREE access to your email anywhere: http://Mailreader.com/
===



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Insert data selected from drop down list into mySQL table

2002-01-09 Thread Peter Westergaard

George, 


When you use:



$prd 



Why not use the Product ID in the VALUE tag, and use the Product 
NAME between the OPTION /OPTION tags?
That way, the VALUE is what is selected, and you can then use an 
SQL INSERT or UPDATE command to push that into the destination table.



One less check against the database, right?

-Peter 



===
EASY and FREE access to your email anywhere: http://Mailreader.com/
===



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Pulling a long list of data stalls PHP (SOLVED!)

2002-01-09 Thread Peter Westergaard

Thanks to Miles!

The problem, for anyone who is going through this themselves lay 
(in my case) with my php.ini file - evidently my fat fingers copied 
the 'recommended' php.ini file, instead of the 'distro' php.ini file.


The 'Recommended' file contains a few optimizations and security 
patches, recommended for a live-on-the-internet application.  I don't 
know what about that setup was incompatible with my application, 
but something was.  Maybe some day when I have a clue I'll figure 
it out.  

For now, I'm back up and running.  
Thanks, Miles.
-Peter 



===
EASY and FREE access to your email anywhere: http://Mailreader.com/
===



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Updating table with data from another table in the same database

2002-01-09 Thread markus|lervik


Hello, all!

I have the daunting task of porting an Access database to 
MySQL. It's unbeliveably poorly designed, and columns
id, name, issn, year, info, volume, numbers and remarks.
I made another table, names, that's got columns id and name.

I used 

INSERT INTO names (name) SELECT DISTINCT mag_table.name FROM mag_table

to get, as one would expect, the distinct magazine names into the names-
table. Now, what I'd want to do, is to replace the names in mag_table
with the id-numbers from the names table, but I can't figure out how
to do it. I tried 

UPDATE mag_table SET name=names.id WHERE name=names.name

but MySQL tells me the following :

ERROR 1109: Unknown table 'names' in where clause

I haven't go perror to work at all, it just says Unknown error.

Has anyone ever done anything like this, and, if so, how?
I was thinking about a PHP-script, but if someone has got
a query that would take care of this I wouldn't have to get into
that.

Cheers,
Markus

-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Concept help required

2002-01-09 Thread DL Neil

George,

=I was pleased to hear from Miles. There are likely to be as many suggestions for how 
things should be done, as
there are developers. I'll be interested to hear from others - personally (cf on the 
list) if the comments might
'interfere'/argue a case (and thus risk muddying your waters) or 'in public'.

> > =Prevailing wisdom in system design suggests that the data should be
> 'designed' first, and 'code'/processing
> > only later (relational or structured design philosophy, even
> object-oriented design). Accordingly I recommend
> > considering which parts of your current files should be converted into
> MySQL tables, and what might need to be
> > added/subtracted to ensure that the relationships between tables is
> adequately expressed/because that makes
> > other 'old data' unnecessary. As you would seem to have identified your
> data, and grouped/categorised it into
> > tables, you might be able to go straight into the process of 'normalising'
> your data - a series of
> > steps/techniques which enable you to analyse the data and structure it
> into a 'relational' form. (if you are not
> > familiar with this term: it's back to the books)
> Actually the Filemaker system is fairly 'normalised' having been developed
> over a couple of years, our previous web developer (commercial partner)
> pulled out of our service an I stepped in to deliver the goods and in doing
> so, went through the analysis and re-design process. It may well be that
> there could be some marginal improvement in doing it again. I'll have a look
> anyway - its part of the learning process.

=I'm feeling a little 'at sea' here, because we had established that you want to learn 
more about "joining", yet
you recognise the word "normalisation" straight off. I don't want to insult you by 
'talking down'/teaching
grandma to suck eggs... Please be sure it is not another one of those words that has a 
particular definition in
the relational world, but was subjugated by wiley marketing people at FM to mean 
something 'just a little
different' (alternatively that my ignorance of the product is the issue). Feel free to 
realign my approach...

=Continuing on, in such a situation I am always inclined to try to 'cut corners' 
(against the 'standard'
structured analysis/book approach) - bet this comment gets some of our list colleagues 
gagging, already thinking
I'm long-winded in my methods. Because, as an outsider, I would not have such an 
intimate understanding of the
data items and their inter-relationships as you do, I would probably attempt to take 
the existing data
structures (the tables, and the list of fields/columns in each) and restate/extend 
these into something called a
ELH diagram (entity life history) - the theory of which you will find in any competent 
structured analysis and
design or SSADM text (the latter relevant to your location, SSADM being a British 
Government initiative, if
you'll pardon the oxymoron).

=The purpose of an ELH diagram is to take a piece of data (in your case, because we 
are assuming/checking
normalisation, I'd 'cheat' and work at the table level - rather than something more 
atomic like the data-item
level). Once again we draw boxes (I have some wonderful s/w for doing these tasks, but 
it is M$). A single
label/box at the top, featuring the name of the data-unit, and I would guess a minimum 
of three (must be my
favorite number!) boxes in the next row, representing the arrival/creation of the 
data, its use within the
system, and the removal of the data from the system once its usefulness has subsided, 
respectively. The third
row of boxes represents the actual, individual events in the life-cycle/daily 
operation of the system, and how
they alter/update/use the data. Lines drawn between the boxes show how these events 
relate and where there may
be some iteration.

=This is an analysis/checking tool. As such it bores the socks off most techies. 
However it is most useful to
ensure that data is being used properly, and for a consistent purpose. In theory it 
can also be used to check
the data structure because by following the uses to which a piece of data is put 
during its life, you can ensure
that it is being represented using the 'best' data type for the purpose. It can 
certainly be used to ensure that
you have the best design of relationships between multiple data items - both in the 
single table/normalisation
sense, but most especially in the relationships between tables. As I go, my diagrams 
accumulate a bunch of notes
around the margins with lead-out lines heading back into/from a point in the diagram - 
reminding me to check
things as the design (or in your case, verification) proceeds. Methodically iterating 
across dozens of diagrams,
the notes are removed - and the system data coalesces.

=One of the great things about doing this, is that in examining where the data is 
coming from, going to, and how
it is being used; you are also making a list of all of the db queries that y

[PHP-DB] Listing select * from table; on PHP

2002-01-09 Thread louie miranda




--

Hi, i have tried this php script to view my table db,
but when i browse it over the net i couldn't see anything
just plain blank page.

Hm, Can u help me make this show tables over on php
and post it over.



thanks,
louie...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] query and count

2002-01-09 Thread Barry Rumsey

I have two tables, the first one I query like :

$query = "SELECT * FROM xp_topics WHERE artist_count='artist' AND topictext LIKE 
  'B%' ORDER BY artist_count DESC limit 0,5"; $req = mysql_query($query); 
  $res = mysql_num_rows($req); if ($res == 0) { echo "
  Sorry there is no result.";} else { while($row = 
mysql_fetch_array($req)) 
{ extract($row); echo ("$topictext
"); } } 

The second one I want to do a count for each one that was returned above. eg Billie 
(2) , Bill (4) Bret (1)
 How would I set up the query to do both?



[PHP-DB] Re: web interface for table design

2002-01-09 Thread Jarosław Jankowski



Marc Bragg wrote:

> Is there a web interface, like dreamweaver for html, for Php. Am aware
> of phpmyadmin, but am looking for the graphics side of things, i.e, make
> a bod this size, color, and put this date into it?

HI,
There is DreamweaverDev and Phakt extension -
http://www.interakt.ro/products/PHAkt
I didn't use is it but maybe that will help.
Jarek



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP-DB] genie's having problem in downloading FTP File - help me out

2002-01-09 Thread Charu Jain


I am usng ftp_get function. 
ftp_get($ftp,$select_file,$select_file,FTP_BINARY)

even though i give any other dir /file name in place of the temporary file it gives 
the error in opening file.
soemtimes it executes the cmmand but when searched no downloaded file founds.

basically my problem is that after entering the user name and the password the user 
should be able to view his files  (only his files)
and all the file should be hyperlinked to their respective file addresses.  so that 
they acn download the file by clicking on the file link.

please help me out.
or give any other suggestion to implement above thing.

any suggestions would be highely appreciated. :-)





Re: [PHP-DB] Concept help required

2002-01-09 Thread George Pitcher

David,

> =Prevailing wisdom in system design suggests that the data should be
'designed' first, and 'code'/processing
> only later (relational or structured design philosophy, even
object-oriented design). Accordingly I recommend
> considering which parts of your current files should be converted into
MySQL tables, and what might need to be
> added/subtracted to ensure that the relationships between tables is
adequately expressed/because that makes
> other 'old data' unnecessary. As you would seem to have identified your
data, and grouped/categorised it into
> tables, you might be able to go straight into the process of 'normalising'
your data - a series of
> steps/techniques which enable you to analyse the data and structure it
into a 'relational' form. (if you are not
> familiar with this term: it's back to the books)
>
Actually the Filemaker system is fairly 'normalised' having been developed
over a couple of years, our previous web developer (commercial partner)
pulled out of our service an I stepped in to deliver the goods and in doing
so, went through the analysis and re-design process. It may well be that
there could be some marginal improvement in doing it again. I'll have a look
anyway - its part of the learning process.


> =Have I misunderstood? It seems to me that you are not offering this data
to "the web", ie I can't get to it;
> you are only offering it to the copyright fee-paying clients. Hence the
publishers' argument seems
> illogical/ignorant...
>
Yes, exactly, but they control what happens and we are not mature enough as
a service to hit them over the heads yet.

> >
> > I run a dual site with a main 'Live' service and a Training service
allowing
> > users to play with the processes before they get near the real thing.
>
> =and now a third environment: for development, and a fourth: for system
testing...
>
I did omit to say that my server hosts a development solution
(Filemaker/Lasso) and that as well as the dev databases being on my laptop,
so is the MySQL/PHP solution. New laptop expected within a couple of weeks
and this one will then be switched to Linux.

Regards

George


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] SuSSE and PHP

2002-01-09 Thread gurix

hea

AFAIK You can use the ODBC functions to work with MS SQL :
http://www.php.net/manual/en/ref.odbc.php

that's all what i know

gurix


"Shane Peery" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED].
..
> I am looking for compiled libraries for PHP 4.1.1 and SuSE 7.2 for use
with
> M$ SQL 7+
>
> Does anyone know where I can find this library?
>
> Thanks,
>
> Shane Peery



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Insert data selected from drop down list into mySQL table

2002-01-09 Thread George Lioumis

Hello everyone!

In my mySQL DB I have the tables:

| po_product |  and   | products|
|--|  | -|
| po_id |  | product_id   |
| product_id  |  | product_name |
|--|  |--|

With the folowing code I build a dropdown list whith the product names

$get_list = "select product_name from products";
$res = mysql_query($get_list) or die (mysql_error());

while ($row = mysql_fetch_array($res))
{
$option_block .= "$prd";
}

I want to store into another table in my DB the product_id that corresponds to the 
product_name that the user has selected

Any help greatly appreciated.

George



Re: [PHP-DB] Re: Redirecting to a new page

2002-01-09 Thread php

hea
a better way is to include your admin pages.

if ($myrow[Admin] == "Y"){
 include("admin.php");
 }else{
  include("user.php")  ;
 }

so you can also include at the top of this example a general header with
menu's etc.

gurix


"Matt Stewart" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> yeah, i know this, but i'm just trying to get this to work before i add
some
> security in there - passing sessions through etc to ensure they're logged
in
> as admin etc.
> it doesn't really have to be that secure for what i want anyway, but
> probably a good job you pointed that out ;)
>
> -Original Message-
> From: Fred [mailto:[EMAIL PROTECTED]]
> Sent: 04 January 2002 21:18
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: Redirecting to a new page
>
>
> Please note, that this is a very insecure way of determining which page a
> person gets to view.  All they would have to do is enter the admin.php url
> in the browser and they get admin access even if they are not admins.
>
> Fred
>
> Matt Stewart <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Can't find the right instructions on php.net, basically, i want a page
> where
> > someone logs in, and then according to the database entry for them,
either
> > they are an admin user or a normal user, and it should then send them to
a
> > page depending on which they are.
> > I've accessed the db ok, and checked which they are, then i've used
> >
> > if ($myrow[Admin] == "Y"){
> > print "Location:admin.php";
> > }else{
> > print "Location:user.php";
> > )
> >
> > this doesn't sem to work - just gives a blank screen with the standard
> html
> > headers and footers, rather than the desired location page.
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
> >
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]