RE: [PHP-DB] checking for 0 results?

2002-11-15 Thread Aaron Wolski
Or you can skip a step like: $sql = select * from ietsfuckingfriday; if (mysql_num_rows($result) == 0) { do_something(); } else { do_anotherthing(); } Aaron -Original Message- From: Snijders, Mark [mailto:Mark.Snijders;atosorigin.com] Sent: November 15, 2002 8:26

RE: [PHP-DB] checking for 0 results? edit

2002-11-15 Thread Aaron Wolski
Doh! Edit: if (mysql_num_rows($sql) == 0) { Aaron -Original Message- From: Aaron Wolski [mailto:aaronjw;martekbiz.com] Sent: November 15, 2002 8:42 AM To: 'Snijders, Mark'; 'Jonathan Narong'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] checking for 0 results? Or you can skip a step like:

RE: [PHP-DB] checking for 0 results?

2002-11-15 Thread Snijders, Mark
and how does $sql now gets in touch with $result Or you can skip a step like: $sql = select * from ietsfuckingfriday; if (mysql_num_rows($result) == 0) { do_something(); } else { do_anotherthing(); } Aaron -Original Message- From: Snijders, Mark

RE: [PHP-DB] checking for 0 results?

2002-11-15 Thread Hutchins, Richard
Aaron was right initially: $sql = select * from ietsfuckingfriday; $result = mysql_query($sql); $num_rows=mysql_num_rows($result); Somewhere along the line, things got convoluted, but that's how you check for 0 rows returned from a query. -Original Message- From: Snijders, Mark

RE: [PHP-DB] serious help with linking data together...

2002-11-15 Thread Jason Vincent
you haven't really said what the problem is - but this is what I can see... Functions like COUNT, MAX and MIN etc. are group functions (or aggregate functions). For example, select count(*) actually only returns 1 record - the total count. When you mix aggregate functions with regular selects

Re: [PHP-DB] checking for 0 results?

2002-11-15 Thread 1LT John W. Holmes
How about: $sql = ... ; $result = mysql_query($sql); if($row = mysql_fetch_row($result)) { do { //process results in $row }while($row = mysql_fetch_row($result); } else { //no results } This way you don't have to make an extra call to mysql_num_rows() and it saves you time. ---John

RE: [PHP-DB] serious help with linking data together...

2002-11-15 Thread Aaron Wolski
Hi all, Sorry about not posting the problem that I was having. Was hard to explain without showing an example page and figure there was a problem with the code SQL itself that someone would spot off the bat. Anyway.. here's a link: http://www.rinkrake.com/blah.php You'll see what I am trying to

RE: [PHP-DB] serious help with linking data together...

2002-11-15 Thread Aaron Wolski
By George I think I may have got it! Code: HTML HEAD /HEAD link rel=stylesheet href=styles.css type=text/css BODY table border=0 cellpadding=0 cellspacing=0 width=600 tr valign=top tdimg src=Graphics/spacer.gif width=350 height=1/td

[PHP-DB] Email Encryption?

2002-11-15 Thread Aaron Wolski
OFFTOPIC Sorry for the off topic guys.. But I've just been informed that an application we developed for a client whereby they use an Admin tool to setup user accounts into their store needs to have the login (username and password) encrypted. I am thinking PGP for this but to be honest I've

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Aaron Wolski
Just thinking here.. PGP is not an option as it would mean EACH user being setup would need the company's public key to decrypt. Not possible as they setup a few hundred accounts each month. Hmm.. anything else? Argh :( Aaron -Original Message- From: Aaron Wolski

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Jason Vincent
Why email? If the Admin tool uses SSL, that is all you need. Regards, J -Original Message- From: Aaron Wolski [mailto:aaronjw;martekbiz.com] Sent: Friday, November 15, 2002 11:39 AM To: 'Aaron Wolski'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Email Encryption? Just thinking here..

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Hutchins, Richard
Can you explain how e-mail fits into the Admin solution? What is the e-mail used for? Setting up the accounts/passwords or sending the account/password to the user? -Original Message- From: Aaron Wolski [mailto:aaronjw;martekbiz.com] Sent: Friday, November 15, 2002 11:39 AM To: 'Aaron

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Aaron Wolski
Well. Its not what they want.. it what one of their clients want (very big corporation with very unrealistic security standards - you'd think they were NASA or something *grumble*) Their thought is that someone could hack the received email, login to the store using the publically displayed

[PHP-DB] database update question

2002-11-15 Thread chip . wiegand
I have a database with several hundred entries of file names that end with .pdf. I have converted all those docs to .zip, now I need to change all the entries in the database to .zip. I tried to use update table_name set col_name='%.zip' where col_name like '%.pdf' id = '11' but of course that

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Cal Evans
Instead of emailing them the login and password info, setup a fax gateway and fax it to them. I used this in a situation that needed to be HIPA compliant. (If security is still an issue, fold the fax before sending it.) :) HTH, =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com *

[PHP-DB] Re: database update question

2002-11-15 Thread Coert Metz
You can let PHP create all the update Statements into a while loop. Or is that wat you don't want to do? Coert Chip Wiegand wrote: I have a database with several hundred entries of file names that end with .pdf. I have converted all those docs to .zip, now I need to change all the entries in

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Aaron Wolski
Hmm... Could you provide more info on the fax gateway? Have not used this before and would appreciate the info you could provide so I can consider the development and implementation costs, etc. Note: this all has to be automatically done as to not create anymore work for my client. This system

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Hutchins, Richard
Aaron, I don't know much about encryption other than just using PGP myself. However, I would think that encrypting an e-mail message and sending it to a user would require the user to have a key to decrypt it as well as some client side software to actually perform the decryption. Seems like an

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Jason Vincent
What I was getting it is, have the 'users' log into a secure web page and create their own user names and passwords (and enter their email address). Then just have the admin 'approve' the request and this sends them an email saying that their access has been granted - that way no information is

Re: [PHP-DB] database update question

2002-11-15 Thread Joshua Stein
Is there a way to change all the entries from .pdf to .zip without writing an update statement for each individual row? UPDATE table_name SET col_name = LEFT(col_name, LEN(col_name) - 4) + '.zip' WHERE col_name LIKE '%.pdf' -j. -- PHP Database Mailing List (http://www.php.net/) To

Re: [PHP-DB] database update question

2002-11-15 Thread Jason Wong
On Saturday 16 November 2002 00:53, [EMAIL PROTECTED] wrote: I have a database with several hundred entries of file names that end with .pdf. I have converted all those docs to .zip, now I need to change all the entries in the database to .zip. I tried to use update table_name set

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Aaron Wolski
Yeah, This is one solutions I thought of. Problem is. the whole premise of the application is that it is hassle free for my client as well as their clients. By adding in this step (if last resort I will have to) we get rid of the hassle free concept and perhaps diminish the effectiveness

[PHP-DB] phpmysqladmin

2002-11-15 Thread Matt Giddings
Anybody have the url for phpmysqladmin? I believe phpmysqladmin is a web interface for mysql. I'm sure someone will correct me if I'm wrong. : ) Thanks, Matt --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.399 / Virus

RE: [PHP-DB] phpmysqladmin

2002-11-15 Thread Jason Vincent
http://www.phpwizard.net/projects/phpMyAdmin/ yes it is - and it is a great tool J -Original Message- From: Matt Giddings [mailto:cen10761;centurytel.net] Sent: Friday, November 15, 2002 12:18 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] phpmysqladmin Anybody have the url for

Re: [PHP-DB] phpmysqladmin

2002-11-15 Thread David Chien
Anybody have the url for phpmysqladmin? I believe phpmysqladmin is a web interface for mysql. I'm sure someone will correct me if I'm wrong. : ) phpMyAdmin - MySQL DB Administration tool. http://phpmyadmin.sourceforge.net/ -David- ___ DAVID CHIEN:

Re: [PHP-DB] phpmysqladmin

2002-11-15 Thread Peter Beckman
phpMyAdmin search for it on sourceforge.net On Fri, 15 Nov 2002, Matt Giddings wrote: Anybody have the url for phpmysqladmin? I believe phpmysqladmin is a web interface for mysql. I'm sure someone will correct me if I'm wrong. : ) Thanks, Matt --- Outgoing mail is certified Virus

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Peter Beckman
Why not encrypt the password in the DB? If they lose their password, it cannot be sent to them. They chose it, so it doesn't need to be sent to them in their email. If they lose it, it is changed, and they have to change it again. That way, only if they are stupid do they have an extra step.

[PHP-DB] Re: checking for 0 results?

2002-11-15 Thread Hp
Use mysql_num_rows() to return the amount of rows selected with your query. example: ?php /* DB connection stuff comes here */ $query = SELECT * FROM table; $getdata = mysql_query($query); if(mysql_num_rows($getdata)){ // output fetched rows } else{ echo no terms; } ? Jonathan Narong

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Aaron Wolski
My client is the one doing the setup of accounts. How would the account holder know of his password before it got encrypted? Hense the email. Aaron -Original Message- From: Peter Beckman [mailto:beckman;purplecow.com] Sent: November 15, 2002 12:35 PM To: Aaron Wolski Cc: 'Jason

Re[2]: [PHP-DB] Email Encryption?

2002-11-15 Thread Damian Harouff
If they have real security standards (though you said unrealistic), they would realize that good encryption isn't decryptable, only comparable. Or try and make them realize as such. AW My client is the one doing the setup of accounts. AW How would the account holder know of his password before

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Jason Vincent
What does the admin know about the client? Do their clients have account numbers for instance? If so, you could send them and email saying your user name is the same as your last name, and your password is the same as your user account number (an obviously don't disclose the account number in

RE: [PHP-DB] phpmysqladmin

2002-11-15 Thread alex hogan
Matt, The url is; www.phpmyadmin.net You are right, it is a web interface for MySQL. alex -Original Message- From: Matt Giddings [mailto:cen10761;centurytel.net] Sent: Friday, November 15, 2002 11:18 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] phpmysqladmin Anybody have the url

[PHP-DB] I just wanna say...

2002-11-15 Thread Brett Lathrope
I see people post questions here, get answers, and never even acknowledge anyone responded. Well I just wanna say, Thanks guys. I've posted questions here twice now...my last a couple of days ago. Both times I received numerous, almost instantaneous, knowledgeable, and extremely helpful

Re: [PHP-DB] I just wanna say...

2002-11-15 Thread Chris Payne
Here here, couldn't agree more. Sometimes I get the answers I need but am too tired to reply then the next day I get so caught up in everyday life sometimes forget to say thanks myself but this list is a lifesaver and is a godsend to many of us either just learning PHP/MySQL or who want to get

RE: [PHP-DB] I just wanna say...

2002-11-15 Thread Aaron Wolski
Yes indeed! We often forget cause we're so busy with our own projects. However, so are the people who helped us out originally. Thanks to you - you know who you are! *sings* Lets drink to the hard working people Lets drink to the good (PHP) and the evil (ASP/VB) haha :) Aaron

RE: [PHP-DB] Email Encryption?

2002-11-15 Thread Peter Beckman
At the time of the account setup, you'll have the unencrypted and encrypted password. Send the email before it gets encrypted. Still, this is a little silly, since the email is unencrypted. I guess you could base64 encode the email, but that'd take an extra step. Oooh, what about this? Send

Re: [PHP-DB] phpmysqladmin

2002-11-15 Thread vze2f6h6
Here you go. www.phpmyadmin.net From: Matt Giddings [EMAIL PROTECTED] Date: 2002/11/15 Fri PM 12:17:44 EST To: [EMAIL PROTECTED] Subject: [PHP-DB] phpmysqladmin Anybody have the url for phpmysqladmin? I believe phpmysqladmin is a web interface for mysql. I'm sure someone will correct

[PHP-DB] Query Executes in MySQL Command Line, Not From PHP.

2002-11-15 Thread Hutchins, Richard
I'm having problems with a query. The query as it reads in my code is: $sql_element_low = UPDATE $table SET medialow=NULL WHERE .$_POST[tbl].contentID=.$_POST[id].; All of the varibles get passed as expected. I know this because if I echo the SQL out to the page, I get: UPDATE levelone SET

Re: [PHP-DB] Query Executes in MySQL Command Line, Not From PHP.

2002-11-15 Thread Marco Tabini
I don't think you can have column names that start with a number. Are you sure you didn't mean to write: $sql_element_low = UPDATE $table SET medialow=NULL WHERE .$table.contentID=.$_POST[id].; Otherwise, try adding a simple die (mysql_error()); after the offending line and see what PHP tells

RE: [PHP-DB] Query Executes in MySQL Command Line, Not From PHP.

2002-11-15 Thread Marco Tabini
Uhm... are you sure it's not working? It's an update statement, maybe the row has already the NULL value before you execute the query? Otherwise, everything seems to be in order... sorry :-) Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide

RE: [PHP-DB] Query Executes in MySQL Command Line, Not From PHP.

2002-11-15 Thread Hutchins, Richard
It's definitely not working. A resulting page breaks each time the code runs and I can see that the UPDATE operation has not taken place when I examine the data in the database. I know the problem is not with the resulting page because the page is built to handle NULL and I can see that the

[PHP-DB] php sessions using mysql (or any db)

2002-11-15 Thread Adam Nelson
Cannot get code to work for session management on a database. Does anyone have tips. It appears that the data goes into the table, but I can't get it out. session_start just initializes the data in the value column.: SessionsTable definition ---

RE: [PHP-DB] Query Executes ... SOLVED

2002-11-15 Thread Hutchins, Richard
How do you know when it's 4:30 on a Friday afternoon? When you change the value of a column then reset it to its original value further down the page. Yup, brain fart. That's what it comes down to. Time to go kill that errant brain cell with a nice Friday afternoon cocktail (or three of four).

Re: [PHP-DB] php sessions using mysql (or any db)

2002-11-15 Thread Rasmus Lerdorf
CREATE TABLE `SessionsTable` ( `SID` varchar(32) NOT NULL default '', This doesn't need to be a varchar. The sid will always be 32 chars, so make it a char(32) `expiration` int(11) NOT NULL default '0', I would suggest using a timestamp type here so MySQL will handle updating it for you

RE: [PHP-DB] phpmysqladmin

2002-11-15 Thread Matt Giddings
Thanks to all that answered my question. Matt -Original Message- From: [EMAIL PROTECTED] [mailto:vze2f6h6;verizon.net] Sent: Friday, November 15, 2002 3:14 PM To: Matt Giddings; [EMAIL PROTECTED] Subject: Re: [PHP-DB] phpmysqladmin Here you go. www.phpmyadmin.net From:

[PHP-DB] database update question

2002-11-15 Thread chip . wiegand
I have a database with several hundred entries of file names that end with .pdf. I have converted all those docs to .zip, now I need to change all the entries in the database to .zip. I tried to use update table_name set col_name='%.zip' where col_name like '%.pdf' id = '11' but of course that

Re: [PHP-DB] Query Executes in MySQL Command Line, Not From PHP.

2002-11-15 Thread Peter Beckman
Can you post the explain levelone here? One thought is that 1contentID is a char or varchar instead of an int. Then again, if it were, that exact code shouldn't have worked. Are you sure you are doing the query using $sql_element_low and not something else? You may be echoing it but are you

Re: [PHP-DB] database update question

2002-11-15 Thread Brad Bonkoski
If you wish to update all of them, then just eliminate the id condition. [EMAIL PROTECTED] wrote: I have a database with several hundred entries of file names that end with .pdf. I have converted all those docs to .zip, now I need to change all the entries in the database to .zip. I tried to

Re: [PHP-DB] database update question

2002-11-15 Thread Peter Beckman
you could do substring update table_name set col_name=concat(substring_index(col_name,.pdf,1),.zip) where col_name like %.pdf What does this do? From the man page: SUBSTRING_INDEX(str,delim,count) Returns the substring from string str before count occurrences of the delimiter

[PHP-DB] If conditional behaviour

2002-11-15 Thread Bradley Crockett
AT http://crockett.ca/joinoptional.php I have a page posted. PHP isn't set up on the server, so I've posted a screenshot of what it looks like at http://crockett.ca/joinoptionalrendered.bmp (1/2 MB, sorry). For some reason, it wants to repeat 'Victoria' in the form. If I comment out the If

Re: [PHP-DB] If conditional behaviour

2002-11-15 Thread Mihail Bota
Did you try $city==Victoria ? On Fri, 15 Nov 2002, Bradley Crockett wrote: AT http://crockett.ca/joinoptional.php I have a page posted. PHP isn't set up on the server, so I've posted a screenshot of what it looks like at http://crockett.ca/joinoptionalrendered.bmp (1/2 MB, sorry). For some

Re: [PHP-DB] If conditional behaviour

2002-11-15 Thread Bradley Crockett
That was it. How embarrassing. Thanks! On Fri, 15 Nov 2002 21:12:42 -0800 (PST), Mihail Bota wrote: Did you try $city==Victoria ? On Fri, 15 Nov 2002, Bradley Crockett wrote: AT http://crockett.ca/joinoptional.php I have a page posted. PHP isn't set up on the server, so I've posted a