add secs to datetime
I have datetime and I want to add a number or seconds to it. That number can be greater than 60, it can actually be greater than the equivalent of a years in seconds. How do I add these seconds to the value of a datetime field through an update with MySQL? - 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: add secs to datetime
On Monday 07 January 2002 01:13 am, Roger Baklund wrote: * Kodrik I have datetime and I want to add a number or seconds to it. That number can be greater than 60, it can actually be greater than the equivalent of a years in seconds. How do I add these seconds to the value of a datetime field through an update with MySQL? update table set datefield=datefield + INTERVAL 1 SECOND; I thought SECOND was limited to 59 and if you entered more it ignored it. Glad to see I was wrong :) - 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: not in -- not exists
Dear all can anyone help me to use NOT IN or NOT EXISTS command in mysql .. You need to use left join the table and look for an inexisting link select * from table 1 left join table2 on table2.key1=table1.id where whatever and table2.id is null - 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: not in -- not exists
Dear all can anyone help me to use NOT IN or NOT EXISTS command in mysql .. You need to use left join the table and look for an inexisting link select * from table 1 left join table2 on table2.key1=table1.id where whatever and table2.id is null - 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: Should I give on Linux and go back to Microsoft???
If you are a beginner and are using red hat why don't use the mysql rpms. It does everything for you. When you compile php, be sure you have the right path for mysql (I think that is your error in this case). Finally, be sure you entered the user right for the connection, with the host specified. On Monday 10 December 2001 07:04 am, you wrote: I knew that would get your attention. But it may become reality because I don't seem to have the skill to solve this problem as I'm a Linux novice and my Win2K install works perfect. It would be a shame to give up on Linux in favor of Microsoft but it works on Microsoft. I have run out of ideas and need some help. I'm now well into my 4th day working on this problem and letting you know that I have done my research before posting and wasting your time hashing over ideas that have already been posted. I've tried implementing all the solutions outlined throughout this site and nothing works yet. I'm running RedHat 7.1. I installed the latest release of MySQL and have run every test in the manuals, the readme's and the conversation threads. Everything works perfectly. When I try to connect with either MySQLGUI or PHP I get the error: Can't connect to local MySQL server though socket (111) I telnet in and it tells me that MySQL is running MySQL shows up in my active processes so it is definately running I can manage the database from MySQLAdmin I've ensured that the mysql.sock exists in var/lib/mysql. I've created the link in the /tmp/ folder. I've updated the my.cnf file I've reset all permissions on those files to chmod 777 I've allowed group nobody in permission to database directory and files as well as my.cfg and both mysql.sock files (in tmp and var/lib) I've tried setting my.cfg, and mysql.sock permissions in various configurations including user:mysql and group:mysql and made sure that apache user was a member of group mysql and vice versa. I also used chmod 777 on both (although I'm not exactly sure I used it correctly). I also modified the PHP ini file although I also can't connect from MySQLGUI and I don't believe it uses PHP (it looks like Java, but I can't be sure). Just in case I tried the PHP.ini file anyway. No luck. etc. etc. etc... As I stated, the MySQL is running and everything tests fine from MySQLAdmin. Yes, I checked the socket entry and tried both /tmp/mysql.sock as well as /var/lib/mysql/mysql.sock (both exist so I thought I'de try both). Since most threaded conversations on this board deal with this issue I have spent most of my time here. But I really starting to think this is a permissions problem but I'm not good enough on Linux to figure it out. I think Apache can't get access to the socket or mysql.optons file. I can't even get MySQLGUI to connect yet everything works from MySQLAdmin without any problems. I'm targeting the permissions just because both MySQLGUI and PHP fail. When I connect with the MySQLGUI client is first gives me the can't connect to 111 error. Then if I choose options and change localhost to 127.0.0.1 and add mysql in the default database, it then tells me that I don't have permissions to change /root/.mysqlgui/mysql.options. Then when I try to connect and it requests my password, it then tell me Apache does not have permission to access the MySQL database. I don't see any of these problems from PHP, I actually get absolutely no response at all. I can't even get a failure on die for a failed connection attempt. Anyone run into permission problems before? Any help would be appreciated - 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: Random
Try (select field 1, field2, field3, rand() as rnd where blah blah blah order by rnd limit 1) On Saturday 08 December 2001 10:35 am, [EMAIL PROTECTED] wrote: Hi, I am trying to pull up one random name in mysql 3.22.21 but not having much luck. Here is what I have done: $select=$dbh-prepare(select * from $thetable where url is not null order by rand() limit 1); I have tried everything, but nothing seems to work. Can anyone help. Rob - 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: help with timestamp...
At 11:25 PM 12/4/01 -0700, *Himerus* wrote: Can anyone give me a good link on how to put in a timestamp on a form that inserts directly into a sql database??? I keep trying it, but it's only coming thru as 00 , so on. I enter my timestamp as a unix timestamp in an INT field. I have never encounter a case where the mysql time functions were a benefit, on the contrary. I get the unix timestamp from the program but I think mysql could generate it as well. - 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: Selecting boundary dates for a given week using date/time functions?
Well, whatever language you are using to output your data, there should be some unix tampstamp converting function. In php it's date(). On Sunday 25 November 2001 04:20 pm, Chris Cooper wrote: Hey all, I'm hoping someone can help me out with a little date/time problem I'm having. I've got a database full of timestamps that I want to group together based on their week. I can use the WEEK() function or DATE_FORMAT() to convert the timestamp to a week number, but I'd rather display the boundary dates for the week because I don't feel the week number is very informative. e.g. Given the timestamp '2004095959' (a Wednesday), I would like to output '2001-11-12 to 2001-11-18' (which is Monday to Sunday). Is there a way using the date/time functions of MySQL to make this conversion in my SELECT statement? I haven't been able to figure out a way to get MySQL to use a week number to generate these boundary dates. I'm assuming the final SQL will look something like: SELECT CONCAT(function_to_get_monday, ' to ', function_to_get_sunday)... Any help is appreciated. -- coop - 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: time_format();
I find the easiest is to use a unix timestamp in your db (int), then use the date() php function to format the display as your please. On Tuesday 20 November 2001 04:29 pm, Joel Wickard wrote: Hello all. I'm developing a web-based app with php / mysql. I'm interested in hearing peoples opinions on a fairly trivial subject. I have a feature on a page that retrieves times out of a mysql database. I was considering formatting the date with javascript, or php, but it would be easiest to just format it with the mysql time_format() function. I've never used mysql's built in functions before and I was wondering if I'm going to see any performance drawbacks from formatting it with mysql instead of passing that off onto the other servers. -Joel - 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: MySQL has transactions, foreign keys, and an option for NO DEFAULT
That is all good :) I'm mostly aware of the possibilities I had offered to me the last time I set up my developing environmenta and the db design decision I had to make accordingly. I guess in less then a year, when 4.x will have some good mileage, I'll set myself a new developing environment and rethink my future database logics. Some of those features will help a lot. Please allow me to clarify a few items here, since we don't want misunderstandings to linger around forever 1) MySQL supports transactions since 3.23.34a, with the InnoDB and BDB table types. Using the the InnoDB table handler you have commit, rollback, crash recovery capabilities, row level locking, consistent non-locking read, and much more... See http://www.mysql.com/doc/I/n/InnoDB.html and elsewhere in the manual for heaps of info. 2) Foreign keys are supported by the InnoDB table handler from 3.23.44. http://www.mysql.com/doc/S/E/SEC427.html 3) The other items you mentioned are already part of the 4.x development track. http://www.mysql.com/doc/N/u/Nutshell_4.1_development_release.html For the curious: implementation of these new features should not adversely affect your performance if you don't use the features. In simple terms: trust Monty! ;-) 4) Finally, MySQL does in fact have a NO DEFAULT option. This was kindly pointed out by Paul DuBois a few days ago. The DONT_USE_DEFAULT_FIELDS compile time option has existed since as early as version 3.20.14. From the manual: You can configure MySQL not to use DEFAULT column values for non-NULL columns (that is, columns that are not allowed to be NULL). This causes INSERT statements to generate an error unless you explicitly specify values for all columns that require a non-NULL value. See http://www.mysql.com/doc/c/o/configure_options.html I do believe this option addresses the issue put forward by Frank and Shelby. Regards, Arjen. -- MySQL Training Worldwide, http://www.mysql.com/training/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Arjen G. Lentz [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Technical Writer /_/ /_/\_, /___/\___\_\___/ Brisbane, QLD Australia ___/ www.mysql.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: Default forced on MySQL
I would like to add my support for NO DEFAULT. The lack of this feature is by far the worst thing about MySQL. I don't get this argument. What happens when a unique index is violated? Isn't this the same problem? Those two comments together are quite interesting. Can you enlighten me with an example where you can't add just one line of code before the call to do exactly that. Understand also that the check for a uniq index has to be made by a call to the DB so it makes sense the DB does it, but a check on the content of a variable can be made by one line of code without any call to the db. In php, which is what he is using, you can just write if($variable1 and $variable2) { makeyourcall } There are many features in MySQL that cannot be solved so easily, so I am really interested in your view that this is the worst thing about MySQL. I must be missing something that is why I would love a situation example from you. - 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: Default forced on MySQL
On Saturday 10 November 2001 01:00 pm, you wrote: Kodrik wrote: Understand also that the check for a uniq index has to be made by a call to the DB so it makes sense the DB does it, but a check on the content of a variable can be made by one line of code without any call to the db. Anything that the database does, one can also do in code. I could make sure a column is unique by checking it in code before inserting or updating values, but I prefer that it is done in the database with a unique index because this centralizes it. For the same reason, I prefer having NO DEFAULT in the database, because this centralizes the check and avoids errors. I said one line of code without any call to the db. You cannot make sure a column is uniq without a call to the db. And for lack of a feature that you can and should do anyway from code, you state The lack of this feature is by far the worst thing about MySQL. Can you do these with one line of code without a call to the DB: * Transaction * Subselects * Foreign keys * Stored Procedures If you can, you are my God. Do you actually believe that the lack of NO DEFAULT is much worst than those features above, which cannot be as easily worked around? Why did you make that extreme statement? What was the purpose for it? - 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: Beginner question - getting last inserted ID
The manual has all the necessary information: http://www.mysql.com/doc/C/R/CREATE_TABLE.html http://www.mysql.com/doc/e/x/example-AUTO_INCREMENT.html The unofficial FAQ has a chapter on AUTO_INCREMENT: http://www.bitbybit.dk/mysqlfaq/faq.html#ch6_0_0 What you're looking for is probably LAST_INSERT_ID(), but I'll let you find it yourself. Oops, now I told you. :-P //C His language might also have a function for it. - 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: Keeping SQL dbs separated
The guy passed this request to the hosting company (which he doesn't want to change) and the answer is: if you *really* need to use PHP instead of ASP OK, but as far as MySQL is concerned we only have one customer using it now, and if we gave it to you too, then the two databases would be visible and writeable to each other users.. unless *your* new webmaster programs our MySQL by himself to avoid this problem. That is one of the problem with most Virtual Hosting. The web server user is the often same for all users so you can use a scripting language to look at the files of other people's website. I'm talking about Unix/Apache server because it is what I know, but you can extrapolate to NT. For a script to access a database, it needs to write the connection on the files, and any other virtual user will therefore be able to see those files using php or asp. So any other user can read all access codes and duplicate them temselves. Which means having the same access to the database the other user has. You will also be able to write scripts to remove/add/modify any files that have the web server's permission. Worst, if your host gives a similar access code to your DB and FTP (which is often the case), you will be able to know your ftp user and pass. I must stress that this is not a MySQL issue, it is valid with any other database. I do work for various customers on various hosting systems and I must say that security within virtual hosting company is horrific between sites, regardless of OS. From their comment it seems their server is insecure although Microsoft has blinded them in a sense of false security and warned them about Open Source. The first thing you shoudl do is ask them how could you see the other person's db if you have different privileges. If they are able to answer this question and it makes sense; ask them why it isn't an issue on their MS server. I doubt they will answer well to those questions and you will have a extremelly valid point to request your customer to change provider: Security! regardless of the DB and script used. Now, leaving apart every comment on the quality of this ISP, what should I do on their server to make it so that I can indeed set my customer's PHP/MySQL pages without screwing anything up? I can usually find my way enough about MySQL, but this situation is entirely new to me. As a matter of fact, until yesterday I would have thought that it is more difficult to set up Mysql like this (or find real people doing it) than the other way around.. TIA, mweb - 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: OT: Default forced on MySQL;
No kidding? Why don't you fork the PostGreSQL codebase and apply your special assembly talents to speed it up by 50% or even 60%? If you're willing to pay for quality, Oracle is an obvious choice. It's fast, it has all the features, there are numerous advanced tools to manage and develop your systems. MySQL is targeted for some needs, to which it answers very well, Postgres has some great strengh for which it has to sacrifice (which is why MySQL choose not to support some features), MSQL has heuh, hum, hmm, oh yes, the micosoft logo of quality and security. And there's Oracle. I don't see what's the dilema. Go for Oracle. With the advanced need you have for your advanced coding, I feel you will rapidly need some other critical features that MySQL lacks. And even if it is within your means to remove all the MySQL's limtations that you will encounter, I think you will get a greater return by developing more great products using Oracle than to waste precious coding time (which would mean less other great products you can make). Also, since your products wil probably be original and appealing, you will end up partner with Oracle on some of your products. Oracle has a great dynamic team (and the best campus) and they will be more willing than work with you in bringing your products to market. Imagine if you made Coolpage (and your other future products like the db/site maker) with an Oracle sponsorship, you will easily be able to sell your site makers to Oracle customers, and you will be able to charge much much much more than to MySQL users, who prefer to use open source software, even if it means more headach. It pains me to advice you against helping MySQL, especially with all you plan to do for it, but the most profitable business model for you would be to dedicate yourself to your products instead of the DB, and then show a beta to Oracle who I am sure will want to partner with you in distributing them. At the end, it woud be much more $$$ in your pocket for less work. Oracle is a powerful company with a great product. - 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: lost in the Land of Oz Parking Lot (I hope this message makes it through!)
I think there is a package on Window called PHPtriad that installs Apache/MySQL/PHP all configured and everything for normal users (your case at this level). You should be able to find it trough download.com. On Thursday 08 November 2001 04:26 pm, [EMAIL PROTECTED] wrote: Dear Noble X: {I tried to email you but I failed, MISERABLY!! My AOL Screen Name, Cyberbean, came with attachments, I hope this mail makes it through the border of all that is good. Please Help! Thanks!} I am lost. I am a very VERY green newbie, and I am struggling on just how to begin. Basically, I have bought a book, entitled, PHP and MYSQL Web Development . , I have downloaded mysql-3.23.43.tar.gz, the install for windows document (yes I have not even made it passed the Install! Oh I am PATHETIC!) says to use Setup.exe for windows. The problem is I can not find that file anywhere. The bigger problem is, I do not know which 'platform' to enter any code in, and once entered, how do you run it as a web site???. I have been using FrontPage for my website, mothermachine.com (which is in a state of utter chaos) and found that I really do not like FrontPage. My questionable quest began when I tried to authenticate my message base, and I discovered, after a few wrong turns and dead ends, this whole new world. Basically if any of you can help me out by pointing me in a direction for beginners, I will be ecstatic and will return the favor if I can, maybe by, once I learn, helping out another newbie. I tell you, this message is a New Hope, if not a last resort. I have been hunched over my computer for quite some time. I have Windows 98 on an older computer which I am using to experiment with code. Can you help?. Thanks!!! Jason Mintel mail2web - Check your email from the web at http://mail2web.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: Update MYSQL command with PHP
$query1 = UPDATE Qusers SET $field_str WHERE UserName='$username'; $result2 = mysql_query($query1); It should be: update Qusers set field_name='$field_str' where username='$username'; - 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: performance of joins
Well, you usualy split your data in tables for a reason, because some data in mulitple numbers are associated to one, or multiple data. In your case, if you have one address and contact per customers, then make it one table. If you have an unknown numer of contacts and numbers per customer, then make multiple tables. The joins will be on the primary keys (they should be at least). so it should be fast, even with 2 million records. On Saturday 03 November 2001 07:06 pm, florian wrote: hello! im storing pretty big amounts of customer data in a mysql databases. its about 2 million rows. what im wondering about now is, how does mysql perform joins on such amounts of data? i was planning to split the info in at least 3 tables: a general customer table, a address table, and a contact table. since also other needs than just customers, for storing addresses and contacts. would it perform better though to store all that in one single table or is is it okay to split it up in 3 and join them later then, depening on what information is needed? thanks alot. florian - 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
Zork!
I wrote a php pipe that allows people to play Zork from their browser http://phpzork.com Zork is a 20 years old command based adventure games. One of the first and most popular. It's source code was released. Many of us here should remember it. For those who don't know how to play, just type your commands such as open mailbox, go east. I compiled Zork on my Linux box and used php to send commands and gather the output for the games with the system() call. It supports all the features of the original games plus some more, like multiple saves and high scores of all players. The interface is also modernized. I didn't have to modify the C code in anyway, it is just a pipe with some processing and database interaction. PHP talks to a MySQL database to store the member informatin (highs score, saves, log) so you cannot play without joining (it's free). http://phpzork.com Welcome to Dungeon. This version created 11-MAR-91. You are in an open field west of a big white house with a boarded front door. There is a small mailbox here. - 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: Formatting Large amounts of Text into Mysql
I use this function to cleanup my text. It converts any weird characters that may cause problems when outputting to html with php. It also converts end of line to br or br / depending on your version of php function cleanup($copy) { $copy=trim($copy); $copy=htmlspecialchars($copy, ENT_QUOTES); $copy=eregi_replace (%, #37;, $copy); $copy=eregi_replace (, lt;, $copy); $copy=eregi_replace (, gt;, $copy); $copy=eregi_replace (amp;, , $copy); $copy=nl2br($copy); $copy=StripSlashes($copy); return($copy); } On Wednesday 24 October 2001 02:04 am, Steve Meyers wrote: Are you sure it doesn't have the line feeds in the database? Neither MySQL nor PHP will strip them out, unless you do some fancy work to make it do that. I would guess that your real problem is that when you display it in your HTML, it shows up without returns. This is standard HTML practice -- try running the PHP function nl2br() on the data before displaying it. Steve Meyers -Original Message- From: tim gales [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 9:31 PM To: [EMAIL PROTECTED] Subject: Formatting Large amounts of Text into Mysql Hi. I am trying to have type in a story into a form textfield and submit it using PHP into blob formatted field mysql database. When I submit, all the returns are removed and all the text runs together like on ebig paragraph. Is there a way to have mysql or PHP recognize the returns and empty lines from the textarea field and rememeber them so when I call them up from the database the formatting looks just like when I typed it in the text field? Any help would be very much appreciated.Thank you Tim Gales - 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
Re: select stmt problem
for one, counts is not a colums, it aggreate values. In your case, since you didn't group, all record retrieved will have the same value for count(*), the number of record. So of course you can't order by counts, it's a single value. On Wednesday 24 October 2001 02:43 am, Carl Troein wrote: Teddy A Jasin writes: Hi, I have this mysql statement: select hpnumber,count(*) as counts from Mobile_Ringtone_Manialogs where counts 10 and datesent between '2001-09-24' and '2001-10-24' and (returncode 0 and returncode 10) group by hpnumber order by counts DESC - 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: Pictures in mysql
You should just enter the path to the picture in the database, in a varchar field. On Wednesday 24 October 2001 08:09 am, [EMAIL PROTECTED] wrote: Hello friends. I am a newbie in mysql and web programming. Can someone please tell me where I can find some info on putting pictures into mysql fields and also how I can use a web interface to add the pictures to the database. Thanks Denis - 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: select stmt problem
On Wednesday 24 October 2001 05:43 am, you wrote: I did the grouping too... ...group by hpnumber so what could be wrong? select hpnumber,count(*) as counts from Mobile_Ringtone_Manialogs where counts 10 and datesent between '2001-09-24' and '2001-10-24' and (returncode 0 and returncode 10) group by hpnumber order by counts DESC Well, count(*) is not a column, it is a function of a column. When it searches, it doesn't know the result of count so you cannot specify it in the where clause. This would work, but you have all the records retrieved, not only the ones who have more than 10 in the group: select hpnumber,count(*) as counts from Mobile_Ringtone_Manialogs where datesent between '2001-09-24' and '2001-10-24' and (returncode 0 and returncode 10) group by hpnumber order by counts DESC To do what you want, you would need to do a subquery. That's where PostgresSQL has an advantage over it. Right now, you need to do two steps: Get all the records with the counts associated to them. When processing the data, ignores those having a count under 10. - 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: looping
You can't at this point. But anyway, it is usually better to make your application do the work than your database. MySQL doesn't process functions faster than you would with arrays (which is what it would have to do ) and it's better to take as much load off from your database. Even if you could do it, it wouldn't be faster and it would take a toll on your DB, making other simultaneous queries slower, and your whole project would be slower. Whenever possible, have your application process functions for your database. A database should concentrate on queryiong the data and your program should perform as many functions as possible. On Wednesday 24 October 2001 07:14 am, Christian Andersson wrote: Hi there, I have a small question for you all (and yes I have searched the documents but not be able to found what I want) Lets say that I have a table with these values 1, 5 and 7 is it possible to create an sql query that will loop through these values a certain amount of time for example if i wanted 8 rows I would get 1, 5, 7, 1, 5, 7, 1, 5 as output.. I'm currently doing this looping in my application but it would speed things up if mysql could do this for me.. since I could then do some joins and retrieve values from other tables faster. /Christian Andersson - 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: Automatic Mathmatical Computation
Yes, you can do: update whatever set C=A*B+3 where whatever On Wednesday 24 October 2001 07:11 pm, [EMAIL PROTECTED] wrote: Hello, I am wondering if there is a way to make automatic computations into a particular column, for instance: Table ONE has column's A, B and C. When I post data to A and B, can I have C automatically calculate A / B and post that answer onto column C? Again, I want this to happen automatically, I don't want to have to issue a SELECT statement for this procedure. Thanks for your help. 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
Fwd: Re: finding the range of results?
How do you find what position a value is in a larger query's result? Well, if you put some sorting to your search, you will know the position of your item by the count of the loop you are using to extract the data. You use limit to return a max number of items, and keep a tab of where your limit starts. Let's say you want to display only 10 pictures (using php variables for the example): $startlimit=0; the query: select * order by tstamp limit $startlimit, 10 if you want to see the next set of picture $startlimit=10 When someone clicks on a picture, just send the $startlimit variable over and it will come back to the same stack. --- - 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