Re: MySQL database design, one column, 10 entries?
You need to add an additional table, favorites. It should have three columns: favoriteID INT, userID INT, favoriteTypeID INT REFERENCES FavoriteType. Plus the additional column for the rating, assuming it's associated with a favorite. Each row represents a single preference (this way users can have an arbitrary number of preferences). Each user would be associated with multiple rows in the table. The favoriteID is so that you can delete/update favorites easily; you want to be able to talk about a particular row. You might want a SELECT like this: "SELECT * FROM favorites WHERE userID = $id ORDER BY rating DESC LIMIT 0,10" to get the top ten favorites for user identified by $id. You might also want to make an additional table, favoriteType, unless each favorite is completely unique (in which case the third column in the table above would have VARCHAR or TEXT type). (You should avoid that kind of design if possible, because most likely anything you want to rank is going to have similarities across users) favoriteTypeID INT favoriteLabel VARCHAR You should do some research on normalization and database design. There are some good books on the topic. Quinten On Sun, 11 Aug 2002, david wrote: > Date: Sun, 11 Aug 2002 00:43:14 -0400 > From: david <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: MySQL database design, one column, 10 entries? > > > I am creating several tables in MySQL and linking via primary keys. I am held > up on one issue, for one row in one table i have a column 'favorites' where i > want to hold up to 10 unique entries, how do i implement this? > > > userTable > userId varchar(20) > name varchar(30) > email varchar(40) > > preferences > userId varchar(20) > styles varchar(20) > favorites > > > preferences > userId styles favorites rating > 01 'modern''#1 sleek' 15 > '#2 ultra-sleek'20 > '#3 un-sleek' 12 > '#4 plain' 9 > etc, up to 10 or so. > > 02 'gothic''#1 dark' 21 > '#2 tall' 4 > '#3 scary' 2 > etc, etc,... > I can't just make it a really long varchar(1000) because of the other columns > that act on the same data. I hope that this is an appropriate question for > this MySQL list. > TIA > > -david > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail ><[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
DBI weird and unheard of issues with mySQL?
Hi, This is a problem of the sort that is starting to make me a little supersituous. I am using mySQL various versions, one of which is 4.01 max on FreeBSD 4.5 stable, DBI 1.30 and I believe the latest DBD::mysql module. Well the weird thing that is happening is that on this particular machine when I use fetchall_arrayref, I end up missing the last column that I should return. I tested this over and over with different queries and databases. Then I moved some things over to a Slackware machine and found no problems. So I thought, oh it must be a FreeBSD thing, somehow. So I took my queries home to my other FreeBSD 4.5 stable and tested, fetchall_arrayref works as expected, but I thought, oh I have 3.x not 4.x, so I installed 4.02 Max and still all is well. So now I am thinking, "What do I do with this other machine?" Do I upgrade to 4.02? Downgrade to 3.x? Install FreeBSD 4.6 and hope that the gods are pleased? This is just so weird and I don't really know who to turn to. I have posted to the FreeBSD newsgroup misc, and the DBI mailing list, no responses so far. Maybe people just think I am nuts? :) I wouldn't blame them. But if the problem had anything to do with my test code it would not have worked on the Slackware machine and my home FreeBSD machine. The scary thing is the home machine is identical to my work machine except that it has been worked on a lot more, and so a few more perl modules are hanging around, and the work machine has 4.01, the home machine now has 4.02. Thanks, Eric http://www.kwinternet.com/eric (250) 655 - 9513 (PST Time Zone) "Inquiry is fatal to certainty." -- Will Durant - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: MySQL database design, one column, 10 entries?
I am not very sure I understand the questionbut maybe column type 'enum' is what you are looking for. - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 10, 2002 9:43 PM Subject: MySQL database design, one column, 10 entries? > > I am creating several tables in MySQL and linking via primary keys. I am held > up on one issue, for one row in one table i have a column 'favorites' where i > want to hold up to 10 unique entries, how do i implement this? > > > userTable > userId varchar(20) > name varchar(30) > email varchar(40) > > preferences > userId varchar(20) > styles varchar(20) > favorites > > > preferences > userId styles favorites rating > 01 'modern''#1 sleek' 15 > '#2 ultra-sleek'20 > '#3 un-sleek' 12 > '#4 plain' 9 > etc, up to 10 or so. > > 02 'gothic''#1 dark' 21 > '#2 tall' 4 > '#3 scary' 2 > etc, etc,... > I can't just make it a really long varchar(1000) because of the other columns > that act on the same data. I hope that this is an appropriate question for > this MySQL list. > TIA > > -david > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
MySQL database design, one column, 10 entries?
I am creating several tables in MySQL and linking via primary keys. I am held up on one issue, for one row in one table i have a column 'favorites' where i want to hold up to 10 unique entries, how do i implement this? userTable userId varchar(20) name varchar(30) email varchar(40) preferences userId varchar(20) styles varchar(20) favorites preferences userId styles favorites rating 01 'modern''#1 sleek' 15 '#2 ultra-sleek'20 '#3 un-sleek' 12 '#4 plain' 9 etc, up to 10 or so. 02 'gothic''#1 dark' 21 '#2 tall' 4 '#3 scary' 2 etc, etc,... I can't just make it a really long varchar(1000) because of the other columns that act on the same data. I hope that this is an appropriate question for this MySQL list. TIA -david - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ERROR 2002: Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock' (111)
mysql.sock file doesn't exist in the /var/lib/mysql directory. Stop and restart mysql server. Regards, Bhavin. - Original Message - From: "samratsam" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 10, 2002 4:28 AM Subject: ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) > why do i get an erro like > "ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)" > > what could be wrong with this error > > please send me the reason for it and also > how do i overcome this problem > > > regards > samratsam > Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com > > Buy Music, Video, CD-ROM, Audio-Books and Music Accessories from http://www.planetm.co.in > > Change the way you talk. Indiatimes presents Valufon, Your PC to Phone service with clear voice at rates far less than the normal ISD rates. Go to http://www.valufon.indiatimes.com. Choose your plan. BUY NOW. > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
FW: Error: 7 - Error on rename ... (Errcode: 13)
-Original Message- From: William dw [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 10, 2002 5:34 PM To: Mysql Subject: FW: Error: 7 - Error on rename ... (Errcode: 13) Error code 13 = Permission denied. Check your permissions :) -Original Message- From: David yahoo [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 10, 2002 4:09 PM To: Mysql Subject: Error: 7 - Error on rename ... (Errcode: 13) Hi all, While trying to upgrade a table struture i get the following error : ALTER TABLE Prefixtest_T_Stories ADD COLUMN IndexDisplay char(1) default 'Y' >>> Error: 7 - Error on rename of '.\testbase\Prefixtest_t_stories.MYI' to '.\testbase\#sql2-118-3.MYI' (Errcode: 13) I m running a mysql 401 on windows xp. thanks. ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Error: 7 - Error on rename ... (Errcode: 13)
I'm getting this in 3.23 on OS X. As near as I can figure out when I used this installer disk from open osx it reset my drive permissions to read only excepting anything in my specific user folder (including desktop). I'm stuck here too so any help would be appreciated. Brian Loomis From: "David yahoo" <[EMAIL PROTECTED]> Date: Sat, 10 Aug 2002 16:09:02 -0600 To: "Mysql" <[EMAIL PROTECTED]> Subject: Error: 7 - Error on rename ... (Errcode: 13) Hi all, While trying to upgrade a table struture i get the following error : ALTER TABLE Prefixtest_T_Stories ADD COLUMN IndexDisplay char(1) default 'Y' >>> Error: 7 - Error on rename of '.\testbase\Prefixtest_t_stories.MYI' to '.\testbase\#sql2-118-3.MYI' (Errcode: 13) I m running a mysql 401 on windows xp. thanks. ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- End of Forwarded Message - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Error: 7 - Error on rename ... (Errcode: 13)
Hi all, While trying to upgrade a table struture i get the following error : ALTER TABLE Prefixtest_T_Stories ADD COLUMN IndexDisplay char(1) default 'Y' >>> Error: 7 - Error on rename of '.\testbase\Prefixtest_t_stories.MYI' to '.\testbase\#sql2-118-3.MYI' (Errcode: 13) I m running a mysql 401 on windows xp. thanks. ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: MySQL 3.23.51 install on OS X
try using "localhost". you have to set the hostname in the install script. on 8/10/02 1:08 PM, Alex Pilson, typed: > I am installing a new MySQL installation on a new Xserve and I am > getting this message; > > [xserve:/usr/local/mysql] admin% sudo ./scripts/mysql_install_db > Sorry, the host 'xserve' could not be looked up. > Please configure the 'hostname' command to return a correct hostname. > If you want to solve this at a later stage, restart this script with > the --force option > [xserve:/usr/local/mysql] admin% > > What am I missing? I do have the DNS setup for this host... - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: ERROR 1146: Table 'test.test' doesn't exist - Why is mysql adding a postfix to my USE request?
>From: david [mailto:[EMAIL PROTECTED]] >Sent: Saturday, August 10, 2002 1:42 PM >Subject: ERROR 1146: Table 'test.test' doesn't exist - Why is mysql adding a postfix to my USE request? > >Why is mysql adding a postfix to my USE request? I know that test.test >doesn't exist, i don't want it to, i'm not asking for anything.anything why >will it append this suffix to my request? > Mysql is using the full syntax for accessing a table, which is database.table. So for the database xx , accessing the table yy, it would be xx.yy. >From the commands used below, the reason you're getting an error is probably because you really don't have a table called 'test' in the 'test' database. As you note, you have the database directory for both test and mySQL, but I'd bet you don't have a table file called 'test' under the 'test' directory. Essentially you're trying to select from a non existent table, and mySQL is showing you how it's interpreted the table you wanted from your SQL query, in this case test.test. >mysql> show databases; >+--+ >| Database | >+--+ >| mysql| >| test | >+--+ >2 rows in set (0.00 sec) > >mysql> use test; >Reading table information for completion of table and column names >You can turn off this feature to get a quicker startup with -A > >Database changed >mysql> select * from test; >ERROR 1146: Table 'test.test' doesn't exist >mysql> use mysql >Reading table information for completion of table and column names >You can turn off this feature to get a quicker startup with -A > >Database changed >mysql> select * from mysql >-> ; >ERROR 1146: Table 'mysql.mysql' doesn't exist >The database directories do exist and are populated: >/var/lib/mysql/mysql >/var/lib/mysql/test - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ERROR 1146: Table 'test.test' doesn't exist - Why is mysql adding a postfix to my USE request?
What are you trying to do here? MySQL is giving this error because the table 'test' does not exist in the 'test' database. Are you mistaking database for tables? I think perhaps you need to take a look more carefully at the manual about creating tables. Mike - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 10, 2002 8:42 PM Subject: ERROR 1146: Table 'test.test' doesn't exist - Why is mysql adding a postfix to my USE request? > Why is mysql adding a postfix to my USE request? I know that test.test > doesn't exist, i don't want it to, i'm not asking for anything.anything why > will it append this suffix to my request? > > mysql> show databases; > +--+ > | Database | > +--+ > | mysql| > | test | > +--+ > 2 rows in set (0.00 sec) > > mysql> use test; > Reading table information for completion of table and column names > You can turn off this feature to get a quicker startup with -A > > Database changed > mysql> select * from test; > ERROR 1146: Table 'test.test' doesn't exist > mysql> use mysql > Reading table information for completion of table and column names > You can turn off this feature to get a quicker startup with -A > > Database changed > mysql> select * from mysql > -> ; > ERROR 1146: Table 'mysql.mysql' doesn't exist > > > The database directories do exist and are populated: > /var/lib/mysql/mysql > /var/lib/mysql/test > > I have searched the mysql site for a listing for error 1146 with no luck, > probably an oversight on my part but any insight is appreciated. > > -david > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
ERROR 1146: Table 'test.test' doesn't exist - Why is mysql adding a postfix to my USE request?
Why is mysql adding a postfix to my USE request? I know that test.test doesn't exist, i don't want it to, i'm not asking for anything.anything why will it append this suffix to my request? mysql> show databases; +--+ | Database | +--+ | mysql| | test | +--+ 2 rows in set (0.00 sec) mysql> use test; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from test; ERROR 1146: Table 'test.test' doesn't exist mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from mysql -> ; ERROR 1146: Table 'mysql.mysql' doesn't exist The database directories do exist and are populated: /var/lib/mysql/mysql /var/lib/mysql/test I have searched the mysql site for a listing for error 1146 with no luck, probably an oversight on my part but any insight is appreciated. -david - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: PHP form to mySQL
Hi, Jerry, Here's your simplified form: Here is the page "addcontacts.php": It would be a good idea too, of course, to add some error-checking in there. Plenty of documentation on that stuff at http://php.net . Good luck! Jed On the threshold of genius, JeRRy wrote: > Hi, > > I am trying to setup a PHP form to send to mySQL > database. I know how to connect to mySQL but need > help getting the information in the form to update > into the mySQL database. > > I have the following table called contacts, I'd like > the form to have the following fields. > > firstName > lastName > email > > I have created the table in my database but now need > the code(s) to put in my PHP page for the form than > once submit is clicked the table in my database will > be updated. I'm too familiar with ASP and just > started using PHP not long ago, so if anyone can help > please let me know. I have tried some online > resources but I continue to get errors so think I am > doing something wrong. So I thought I'd post here so > my question can be answered. > > Thankyou! > > http://digital.yahoo.com.au - Yahoo! Digital How To > - Get the best out of your PC! > > - > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Warning mysql.dll
Hi, In Win32 distribution version of MySQL(ver 4.x) , mysql.dll don't have entry point for mysql_ssl_clear(). Regards, Gelu _ G.NET SOFTWARE COMPANY Permanent e-mail address : [EMAIL PROTECTED] [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
MySQL 3.23.51 install on OS X
I am installing a new MySQL installation on a new Xserve and I am getting this message; [xserve:/usr/local/mysql] admin% sudo ./scripts/mysql_install_db Sorry, the host 'xserve' could not be looked up. Please configure the 'hostname' command to return a correct hostname. If you want to solve this at a later stage, restart this script with the --force option [xserve:/usr/local/mysql] admin% What am I missing? I do have the DNS setup for this host... -- <---> Alex Pilson FlagShip Interactive, Inc. [EMAIL PROTECTED] 404.728.4417 404.642.8225 CELL <---> - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Subtracting 2 times
Chris, A pointer is a type of shark! Just like them, this suggestion has sharp teeth too - change the time_in value to 11:45 and see what I mean... This topic was discussed one week ago ("Time Calculations") - see archives (to save you that, I'll forward you a copy privately (list doesn't like attachments)). Regards, =dn > Thanks for the quick response. The times are stored in TIME format. If I > do the following: > > SELECT *, time_out-time_in as job_time from time_sheet; > > the job_time column gives me the right time, but is not formatted, for > example: > > time_in = 11:00 > time_out = 13:15 > > job_time= 21500 > > Any pointers? > > -Chris > > On Saturday, August 10, 2002, at 09:36 AM, DL Neil wrote: > > > Hello Christopher, > > > >> I need to ask for some help and I can't find anything in the manuals. I > >> am writing a php based app that as one of it's functions keeps an > >> employee time sheet. The times are stored in a mysql database with 2 > >> columns - time_in and time_out. What I need to do is subtract these to > >> columns to show a job_time (which should be in hh:mm form). > >> > >> Can anyone give me any suggestions? Or am I better off doing this on > >> the > >> PHP side rather than the mysql side? > > > > > > My general rule is that when pulling data out of an RDBMS it is best to > > do > > as much as possible there, than to transfer data into (say) PHP and > > post-process it. > > > > Are the times stored as DATETIME/TIME, timestamp, or other format data? > > The > > answer will thus vary! Assuming we're not talking about timestamps > > (trivial > > exercise) then SEC_TO_TIME() and its counterpart may be of interest. > > Manual > > ref: http://www.mysql.com/doc/en/Date_and_time_functions.html > > > > Regards, > > =dn > > > > > > > > - > > Before posting, please check: > >http://www.mysql.com/manual.php (the manual) > >http://lists.mysql.com/ (the list archive) > > > > To request this thread, e-mail <[EMAIL PROTECTED]> > > To unsubscribe, e-mail > [EMAIL PROTECTED]> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Using PHP for login/Members Area!
Hi, I would like to create a members area on my site, using mySQL for the database to hold usernames and passwords to login to the area. I need to know the following if anyone can help please. - What code would I need to make a login page form that has username and password? (lets say the table in the database is called members) - How do I make it so members need to be logged in to access the pages, rather than able to bookmark the site and go back to it without entering username/password? - and what is the code I need for people to update their membership details, that will not create a new membership but rather update the current one? Thankyou for your time. http://digital.yahoo.com.au - Yahoo! Digital How To - Get the best out of your PC! - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
PHP form to mySQL
Hi, I am trying to setup a PHP form to send to mySQL database. I know how to connect to mySQL but need help getting the information in the form to update into the mySQL database. I have the following table called contacts, I'd like the form to have the following fields. firstName lastName email I have created the table in my database but now need the code(s) to put in my PHP page for the form than once submit is clicked the table in my database will be updated. I'm too familiar with ASP and just started using PHP not long ago, so if anyone can help please let me know. I have tried some online resources but I continue to get errors so think I am doing something wrong. So I thought I'd post here so my question can be answered. Thankyou! http://digital.yahoo.com.au - Yahoo! Digital How To - Get the best out of your PC! - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Subtracting 2 times
Thanks for the quick response. The times are stored in TIME format. If I do the following: SELECT *, time_out-time_in as job_time from time_sheet; the job_time column gives me the right time, but is not formatted, for example: time_in = 11:00 time_out = 13:15 job_time= 21500 Any pointers? -Chris On Saturday, August 10, 2002, at 09:36 AM, DL Neil wrote: > Hello Christopher, > >> I need to ask for some help and I can't find anything in the manuals. I >> am writing a php based app that as one of it's functions keeps an >> employee time sheet. The times are stored in a mysql database with 2 >> columns - time_in and time_out. What I need to do is subtract these to >> columns to show a job_time (which should be in hh:mm form). >> >> Can anyone give me any suggestions? Or am I better off doing this on >> the >> PHP side rather than the mysql side? > > > My general rule is that when pulling data out of an RDBMS it is best to > do > as much as possible there, than to transfer data into (say) PHP and > post-process it. > > Are the times stored as DATETIME/TIME, timestamp, or other format data? > The > answer will thus vary! Assuming we're not talking about timestamps > (trivial > exercise) then SEC_TO_TIME() and its counterpart may be of interest. > Manual > ref: http://www.mysql.com/doc/en/Date_and_time_functions.html > > Regards, > =dn > > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail [EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: lock row
>>> Alexander Burbello<[EMAIL PROTECTED]> Wrote: >>> Hi, >> >>how can I lock only one row in the table? >> >>What table type I have to use to lock? If you use MyISAM table (default table on MySQL 3.23.x) you can't use InnoDB table for enabling row level locking, BTW it's default table for MySQL 4.x >> >> >>Regards >> >> >>Alexander >> >> >> - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Subtracting 2 times
Hello Christopher, > I need to ask for some help and I can't find anything in the manuals. I > am writing a php based app that as one of it's functions keeps an > employee time sheet. The times are stored in a mysql database with 2 > columns - time_in and time_out. What I need to do is subtract these to > columns to show a job_time (which should be in hh:mm form). > > Can anyone give me any suggestions? Or am I better off doing this on the > PHP side rather than the mysql side? My general rule is that when pulling data out of an RDBMS it is best to do as much as possible there, than to transfer data into (say) PHP and post-process it. Are the times stored as DATETIME/TIME, timestamp, or other format data? The answer will thus vary! Assuming we're not talking about timestamps (trivial exercise) then SEC_TO_TIME() and its counterpart may be of interest. Manual ref: http://www.mysql.com/doc/en/Date_and_time_functions.html Regards, =dn - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Subtracting 2 times
Hello, I need to ask for some help and I can't find anything in the manuals. I am writing a php based app that as one of it's functions keeps an employee time sheet. The times are stored in a mysql database with 2 columns - time_in and time_out. What I need to do is subtract these to columns to show a job_time (which should be in hh:mm form). Can anyone give me any suggestions? Or am I better off doing this on the PHP side rather than the mysql side? Thanks, -Chris - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: 4.0.2 mysqld.sym.gz is empty
Steven, I have forwarded this to the build master of MySQL AB. I too noticed that the mysqld.sym file did not work in the mysql-4.0.2-alpha-pc-linux-gnu-i686 .tar.gz distro, but did not realize that the .sym file was totally empty. The .sym file works in the .rpm distro, but unfortunately that is a different binary and does not help too much in resolving a stack trace from the .tar.gz distro. Thank you for the bug report! It is essential that the .sym file is good in a distribution so that we can find the bugs. Best regards, Heikki Tuuri Innobase Oy --- InnoDB - transactions, row level locking, and foreign key support for MySQL See http://www.innodb.com, download MySQL-Max from http://www.mysql.com Copied message: . I can't look up a MySQL 4.0.2 crash since the mysqld.sym.gz is empty! Can someone at MySQL email me the file, please. Pretty please. Thanks! Sincerely, Steven Roussey http://Network54.com/?pp=e query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
MysqlTool v0.94
Hello, Using MysqlTool v0.94 on Netscape Communicator 4.79 to access MySQL vers 3.23.49 on FreeBSD 4.x Suddenly starting returning Please enable cookies. Multi-user MysqlTool uses cookies to store encrypted connection information. Browser has "Accept all cookies" set. The same message was rec'd from IE 6.00, so the problem is not Browser specific. Has any one had any experience with this. -- Thanks -- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
why do i get an erro like "ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)" what could be wrong with this error please send me the reason for it and also how do i overcome this problem regards samratsam Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com Buy Music, Video, CD-ROM, Audio-Books and Music Accessories from http://www.planetm.co.in Change the way you talk. Indiatimes presents Valufon, Your PC to Phone service with clear voice at rates far less than the normal ISD rates. Go to http://www.valufon.indiatimes.com. Choose your plan. BUY NOW. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Another pattern matching question
Obiajulu, Please refer to previous response and the as yet unanswered question within. > I have the following values in my db table: > Id. regdate > 001040-1467 > 011910-2002 > 021700-1789 > 031550-2002 > 041600-1700 > 051900-2000 > ... > How can I use mysql RegEx to the query parameter: 1445-1600: That is to > extract those values that fall between 1445 to 1600: > > This example result will be > Id. regdate > 001040-1467 > 031550-2002 > 041600-1700 Because there is no longer reference to "tallet", life is considerably easier. There is no need to use RegEx. Use LEFT() and RIGHT() to extract the range-dates from regdate The selection condition then becomes an OR: ... WHERE LEFT( regdate, 4 ) IS BETWEEN LowQueryDate and HighQueryDate OR RIGHT( regdate, 4 ) IS BETWEEN LowQueryDate and HighQueryDate ... Again: the design of the data structure seems to be causing fundamental problems, so perhaps that's where the 'real issue' lies!? =dn - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Need to change MySQL results to numbers
Gloria > > in a database on adjunct faculty. > > Well, I set my table up withalphnumeric codes and most stats software > > want those mutliple choices as numbers. =which is why most people design to enter such data as number codes (1~5) rather than alpha. > > So I need to change the things already answered and placed into MyCC to > > numeric data: =unless you learn to work with alpha codes > > Q1: Your region? > > > > NE > > NW > > MW > > SE > > SW -> TO > > > > 1 > > 2 > > 3 > > 4 > > 5 > > > > I have 31 such questions. > > 21 replies so far. > > > > Do you know the MyCC commands to make the changes? =doesn't MyCC use SQL? > > Would it be easier to download the whole file and import it it from text > > editor > > with the chnages all made? > > But there's a header on the export. I don't want to import back and > > erase everything... > > I can send anyone the first export on which we can experiment. =is the data currently held in MySQL or not? > > Please help on this since it is for a worthwile purpose, =assuming you want to change the data values held in a field, the UPDATE command is where it's at: UPDATE tblNm SET Q1 = 1 WHERE Q1 = "NE"; =this will change all rows that have "NE" as the answer to Q1. If you want to get really clever/save having five commands per question, then you should look at sets and enumeration. =However consider that the WHERE clause (above) is exactly the same as the WHERE clause that you would use in any SELECT, and thus how you will be analysing the survey results anyway - unless your reference to "stats software" means that you are only collecting the data in MySQL and not using MySQL for processing, and that raises the question: why not capture the data into the stats software in the first place? =dn - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How stable is v4? (was: Re: InnoDB vs. MyISAM on large numberof tables?)
On Fri, 9 Aug 2002, Thomas Seifert wrote: > On Thu, 8 Aug 2002 03:02:40 -0700 > Jeremy Zawodny <[EMAIL PROTECTED]> wrote: > > > > > btw: > > > I did a quick benchmark with mysql4 and its query caching running with > > > innodb. > > > Quite impressive, the app run with double the number of pages per second as > > > before. > > > > Excellent. MySQL 4.0.{2,3} is working well for us too. > > > Is there 4.0.3 already somewhere to download? Hi Thomas, pulling from the source tree will give you a preliminary form of 4.0.3-beta. The fine manual tells how to do this. > At all, how stable is 4.0.x already? afaik its labelled alpha on the > website but I heard some talking about beta-quality. I have it running on production, but it does a small set set of relatively simple fulltext queries at a low load. > I would like to give it a shot on a production-system 'cause of that > fantastic speed increase. Go ahead, if you can tolerate a very small risk. It's likely to work fine. Thomas Spahni - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php