[PHP-DB] DISTINCT Question

2002-04-20 Thread Jeff Oien
How can I do a query for a distinct field plus get the info from other fields? I tried this: select DISTINCT email, name_first, name_last, id from applicants; and it gave me everything. Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http

RE: [PHP-DB] MySQL to Email and Line Breaks

2002-04-14 Thread Jeff Oien
shows these breaks? I can't find any \n in the data. Then when it's sent via email of course there are no line breaks displayed. Jeff Oien > Hiya, > > If I remember correctly, you much send both \r and \n to terminate a line > on an e-mail, regardless of the platform. Thi

RE: [PHP-DB] Re: MySQL to Email and Line Breaks

2002-04-13 Thread Jeff Oien
I tried wrap=hard already. I should have mentioned that. Sorry if this is off topic. Jeff Oien > You need a wrap= within your textarea.. You may need a couple if the > browsers haven't come together on it yet.. But you can check it out here: > > http://www.blooberry.com/indexdo

RE: [PHP-DB] MySQL to Email and Line Breaks

2002-04-13 Thread Jeff Oien
This isn't what I'm looking for because the output is to email not HTML. What I would like is the natural line breaks in the form input to be preserved and then result in line breaks in the email without having to add any \n, which didn't work anyway. Jeff Oien > check ou

[PHP-DB] MySQL to Email and Line Breaks

2002-04-13 Thread Jeff Oien
d those \n show up in the database data. I must be missing something. Thanks for any help. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Re: Speed Up Code?

2002-03-25 Thread Jeff Oien
P BY f.id' > .' ORDER BY u.album_title ASC'; > > $result = @mysql_query($sql,$connection) or die(" Couldn't execute query."); > > while ($row = mysql_fetch_array($result)) { > $id = $row['id']; > $username = $row['user

[PHP-DB] Speed Up Code?

2002-03-24 Thread Jeff Oien
Here is some code I have for an index page of people who post charts on the Web, kind of like Yahoo Photos or something. It displays the album title, number of images and date of last upload. The page takes about 5-6 seconds to load which is all in the queries I'm sure. Is there a way I can make t

[PHP-DB] GREATEST, LEAST

2002-03-11 Thread Jeff Oien
Could anyone give me an example of how to use GREATEST and LEAST in a MySQL query. I want to look through the last 15 records in a certain field and find the highest and/or lowest number. Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http

[PHP-DB] Unwanted Column Updating

2001-11-03 Thread Jeff Oien
W() where id = '$id'"; However, time1 is being updated to be the same as time2 after the exit and I don't want it to be. Am I missing something? Jeff Oien -- 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] Previous | Next (Again)

2001-08-31 Thread Jeff Oien
ut them into an array? Thanks for the help. Jeff Oien > I don't know of a way to do the insert in a single query (anyone?!?) with > this... but > > assuming the fields in pic are > id int PRI > location varchar(30) > picnumber int > user varchar(20) > > $query = &

RE: [PHP-DB] Previous | Next (Again)

2001-08-31 Thread Jeff Oien
sword stuff but this I'm just clueless. Jeff Oien > I would add the field "picnumber int" or something to your DB. > This is where the pic falls in the order of pics in the album. > > The the previous and next should be as simple as doing > select picnumber,picloc

RE: [PHP-DB] Password Question

2001-08-31 Thread Jeff Oien
retrieve lost > password > > > > if '$id' is set then have the user input their password and email address > (the one they registered > > with) and query the database for a username on the basis of the inputted > info, and email it using > > mail() to t

[PHP-DB] Password Question

2001-08-31 Thread Jeff Oien
sword they use for other things I think it would be best for it to be encrypted. Jeff Oien -- 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] Previous | Next (Again)

2001-08-30 Thread Jeff Oien
s the second etc. and know which the current one is if the id field has gaps in it. Not sure if that made any sense. Jeff Oien -- 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 administrato

Re: [PHP-DB] Date_Format Question

2001-08-30 Thread Jeff Oien
;) from Chart_Users; or select date_format(creation_date, '%M %D, %Y') as creation from Chart_Users; Jeff Oien > Jeff, > > mysql> select now(); > +-+ > | now() | > +-+ > | 2001-08-29 21:21:50 | > +

RE: [PHP-DB] Date_Format Question

2001-08-29 Thread Jeff Oien
Isn't that what I tried? Jeff Oien > Although it might be better to format the date in php, don't forget you can > also do date formating in the select string. The date format functions for > mySQL can me found here: > > http://www.mysql.com/doc/D/a/Date_and_time_func

[PHP-DB] Date_Format Question

2001-08-29 Thread Jeff Oien
I have a date like this in date format in MySQL 2001-08-29 and I want it to say August 29, 2001 I tried this and it didn't work. select date_format('creation_date', '%b %D, %Y') from Chart_Users; Could you tell me what I'm doing wrong or how I should do th

RE: [PHP-DB] Photo Album Schema

2001-08-21 Thread Jeff Oien
I should have said photo_filename. That was what I intended to do. Would you suggest one directory for all photos or separate directories for each user? Jeff Oien > Rick: I don't see any .php tags there... plus just because someone > else has done it doesn't mean he can

RE: [PHP-DB] Photo Album Schema

2001-08-21 Thread Jeff Oien
Thanks for the suggestion but this is a personal project to be used for learning and as a place for friends to post photos with only the features that we all want. Jeff Oien > This has been done. see http://www.photopoint.com > > This is a free service available to the public.

[PHP-DB] Photo Album Schema

2001-08-21 Thread Jeff Oien
I want to make a photo album that will have users who sign up to create an album and then have the albums open to the public. I was thinking of doing it like this but I've never done a relational database before so if anyone thinks of anything I should change please let me know. Thanks. Jeff

RE: [PHP-DB] Re: Query and Date problem

2001-08-15 Thread Jeff Oien
> "Jeff Oien" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I want to retrieve the last 15 days of data from a certain time but > > not today's. I have this but it's still giving me today's data:

RE: [PHP-DB] Query and Date problem

2001-08-15 Thread Jeff Oien
That did it. Anybody know why? Jeff Oien > Not sure if this will make a difference, but try putting single quotes > around $today: > date != '$today' > > - Jonathan > > > -Original Message- > From: Jeff Oien [mailto:[EMAIL PROTECTED]] > Sent:

[PHP-DB] Query and Date problem

2001-08-15 Thread Jeff Oien
R by id desc LIMIT 15"; (date != $today) code in question When I print $today it's: 2001-08-15 and the date field in the database is also displaying as 2001-08-15. Any suggestions? Thanks in advance. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PR

RE: [PHP-DB] Averaging Numbers

2001-08-15 Thread Jeff Oien
That's exactly what I needed. Thanks. I'm absolutely awful with math and this is my first time averaging numbers from a database. Jeff Oien > Maybe I am missing the complexity but I would just add them all up as > you retrieve them (or where you are printing them out) a

RE: [PHP-DB] Averaging Numbers

2001-08-15 Thread Jeff Oien
..how do you do this!? I've been > wanting something like this for months. > > Cheers (and apologies!) > Russ I have a cron job that runs on a Unix server that runs a PHP file that gets a number from a Web site and inserts it into the database. Jeff Oien -- PHP Database Mailing

[PHP-DB] Averaging Numbers

2001-08-15 Thread Jeff Oien
y the numbers fine, I just don't know how to go about putting these all into variables or an array or if I can do this within a query and then take an average for them. Hope that made sense. Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

[PHP-DB] Inserting NULL?

2001-08-03 Thread Jeff Oien
I have a variable that is either Yes or No. I would like NULL to be inserted if it's No. Can I do this? if ($variable == 'No') { $variable = 'NULL'; } then INSERT it. Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-ma

[PHP-DB] Limit Select Field Characters?

2001-08-01 Thread Jeff Oien
I have a timestamp field that looks like this 0109011754 but I only want to compare 010801 when doing a SELECT. Is there a way I can do this? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: [PHP-DB] MySQL Timestamp

2001-07-18 Thread Jeff Oien
Thanks. I was using MySQL by DuBois book as a reference. Jeff > According to the manual, 12 is YYMMDDHHMMSS and 14 is MMDDHHMMSS. > > http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#DATETIME > > > "Jeff Oien" <[EMAIL PROTECTED]&

[PHP-DB] MySQL Timestamp

2001-07-18 Thread Jeff Oien
I have a field that's timestamp(12) which should be MMDDhhmm but what I'm getting is 010718125000 what I was expecting was 200107181250 How can I get what I was expecting? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROT

[PHP-DB] Only Insert on Error?

2001-07-18 Thread Jeff Oien
I can't figure this out. The first code works as far as inserting into a MySQL database with the !result error checking. The second with the error code commented out doesn't. I can't figure out why. Jeff Oien if ($M_First_Name) { $sql = "INSERT INTO $table_name (F

RE: [PHP-DB] Inserting Variable Variable?

2001-07-18 Thread Jeff Oien
I found a solution but not sure if it's the most efficient. I need to first define a simpler variable: $C_First_Name = "${"C_First_Name".$x}"; then INSERT VALUE $C_First_Name. Jeff Oien > Hi Jeff. > > $varname = "C_First_Name".$x; >

RE: [PHP-DB] Inserting Variable Variable?

2001-07-18 Thread Jeff Oien
Hi, I'm not quite getting it. If $x is 1 here is what happens. $varname = "C_First_Name".$x; echo $$varname; then $$varname prints as $C_First_Name1. However $C_First_Name1 prints the contents of the variable. Jeff Oien > Hi Jeff. > > $varname = "C_First_Name

[PHP-DB] Inserting Variable Variable?

2001-07-18 Thread Jeff Oien
only $C_First_Name get interpolated. Any solutions? Thanks. Jeff Oien -- 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] Alternating Values

2001-07-09 Thread Jeff Oien
st in Group1 is Rm101, this person be assigned Rm102 with that equation being in the PHP script? If that's the case would I retrieve all the records for Group1 and find the largest ID (auto_increment type)? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscri

RE: [PHP-DB] MySQL Connect Problem

2001-05-18 Thread Jeff Oien
I found a "solution." I uninstalled (and deleted the ini file) MySQL v. 3.23.36 and installed v. 3.23.38 and now it works. I have no idea why. But I learned some things in the process. Thank you very much for all the help. Jeff Oien > Where you have your variable set to "

RE: [PHP-DB] MySQL Connect Problem

2001-05-17 Thread Jeff Oien
I tried your code and got this: Warning: Can't connect to MySQL server on 'localhost' Also tried ip address of my machine. So at least maybe that narrows down the problem. Jeff Oien > Hi Jeff, > I am using Windows, but am a beginner. Here is some code I use maybe it &

RE: [PHP-DB] MySQL Connect Problem

2001-05-17 Thread Jeff Oien
set a > password for root in the database. > > Wayne > > > On Thu, 17 May 2001 13:20, Jeff Oien wrote: > > > > Here is sample code: > > > > > > > $connection = @mysql_connect("localhost", "jeff",

RE: [PHP-DB] MySQL Connect Problem

2001-05-16 Thread Jeff Oien
gt; > > This is on my machine only used by me. I also tried connecting to > > IP address and 127.0.0.1 and it still won't work. Thanks. > > Jeff Oien > > Are your the 'root' rather than 'jeff'? Did you alter the grants and > apply the password? If no

RE: [PHP-DB] MySQL Connect Problem

2001-05-16 Thread Jeff Oien
Yes it is running. I don't need to use a password when running from the command line but I am when connecting through PHP. This is exactly how I did it on my Win98 machine but it isn't working with W2k. Jeff Oien > Well the mysql tool doesn't need any authentication usually wh

RE: [PHP-DB] MySQL Connect Problem

2001-05-16 Thread Jeff Oien
Used Prompt in Win2k. Moved to the apache/mysql/bin directory and typed mysql. Jeff Oien > You said you could connect through the command-line. How did you do that? > > Jonathan > > Here is sample code: > $connection = @mysql_connect("localhost", "jeff&qu

RE: [PHP-DB] MySQL Connect Problem

2001-05-16 Thread Jeff Oien
Here is sample code: This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien > 1. Can you set up a simple connection for us to test out? Allow people from > any host (%) to connect. > 2. Try connecti

RE: [PHP-DB] MySQL Connect Problem

2001-05-15 Thread Jeff Oien
Yes they are. Jeff > Is the MySQL and Apache running on the same machine? > > Jeff Oien wrote: > > > I have MySQL on a new Win2000 install and can't connect to it using PHP. > > I am able to connect using the command line. I'm not sure what the next > &g

[PHP-DB] MySQL Connect Problem

2001-05-15 Thread Jeff Oien
rking fine otherwise. Typical code: Thanks. Jeff Oien -- 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] Autoincrement Question

2001-05-10 Thread Jeff Oien
If I have a database that has three records and I delete the entire third record, when another record is then added will the auto_increment number be 3 or 4? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

RE: [PHP-DB] INSERT Problem

2001-05-09 Thread Jeff Oien
That told me my problem. Thank you! I hadn't selected the database in my connect include but had it in other scripts and not this one. Long story but thanks for the help. I can stop banging my head now. Jeff Oien > on 5/9/01 12:29 PM, Jeff Oien at [EMAIL PROTECTED] wrote: > >

RE: [PHP-DB] INSERT Problem

2001-05-09 Thread Jeff Oien
OK, did that and it's just printing the INSERT command back to me. INSERT INTO OVEvents (First_Name, Last_Name) VALUES("Jeff", "Oien") Any help from here? Thanks. Jeff Oien > > echo $sql; > > > always helpful, then paste that into the c

[PHP-DB] INSERT Problem

2001-05-09 Thread Jeff Oien
ERT INTO $table_name (First_Name, Last_Name) VALUES (\"Jeff\", \"Oien\")"; $result = mysql_query($sql,$connection) or die("Failed"); or $sql = "INSERT INTO $table_name (First_Name, Last_Name) VALUES (\"$First_Name\", \"$Last_Name\")"

[PHP-DB] Encode/Decode Secure Enough?

2001-04-07 Thread Jeff Oien
Are encode and decode secure enough for storing credit card numbers on a Web server? Jeff Oien -- 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

RE: [PHP-DB] PHP an MySQL

2001-04-01 Thread Jeff Oien
I would recommend the first two books listed on this page: http://www.webdesigns1.com/php/books.php I've read both. Jeff Oien > Can someone recommend a book that shows how to use PHP and MySQL. > > I need to see how to pass parms from a form to a PHP so I can Update, Add > a

RE: [PHP-DB] HELP: Eporting data from mySQL with PHP

2001-03-30 Thread Jeff Oien
> Hello, > > I'm trying to figure out how to get the data out of a table in a format > which I can easily import into excel. I wanted to have tab delimited fields > enclosed by quotes. I'm not sure how to do this? I check the mySQL doc and > saw the mysqldump call but haven't found any mention

[PHP-DB] MySQL for Billng Question

2001-03-26 Thread Jeff Oien
I want to have a database for my hours for my clients. I want to create a report where it shows only the hours back to the last time I was paid. I have no idea how to go about this. Any help would be appreciated. Jeff Oien PHP >start here http://www.webdesigns1.com/php/ -- PHP Database Mail