Re: [PHP-DB] PHP/Apache not totally closing MySQL connections
At 18.11.2001 06:36, Bob Maple wrote: Proto Recv-Q Send-Q Local Address tcp1 0 burner.com:4848 burner.com:mysqlCLOSE [munge-alert!] Hmm, looks like my pastes got whacked. Oops. nope, if you leave it going for awhile nothing out of the ordinary happens, the socket will be reused (when it's time is up). the reason it doesn't go away until Apache is closed is that this is apache's socket, and not MySQL's, as the forreign address is the :mysql. OK, thanks -- I did some rapid refreshes of a page and indeed, the 'CLOSED' state sockets ultimately are being recycled. I guess I just wasn't getting the same httpd process that had them open before, because at one point I had about 5 of these sockets hanging around while new connections continued to appear. that's because you're running more than one apache process, the number of closed sockets should be proportional to the number of apache processes (as set by httpd.conf). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] date help
At 17.11.2001 14:45, Srinivasan Ranganathan wrote: Hi I need to store the date and time of sign-up and date and time of last successful login in a mysql database and calculate how long the user has been using a site. how do i do this? Store date either in seconds since 19700101 or use your rdbms' datefield (most of them've got one). (I always prefer seconds as it's IMHO the easier to do calculations with) -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] PHP/Apache not totally closing MySQL connections
At 18.11.2001 02:06, Bob Maple wrote: I've been through the bug database a couple of times, and scanned through the list archives before joining, but haven't exactly found anything that matches what is happening in my case. First, dirty details: I am running MySQL 3.23.33, Apache 1.3.19, and PHP 4.0.6 under an RH system on kernel 2.2.19. PHP running as a module in Apache. Good, pretty complete details. I am having a little quirk with persistant connections with MySQL. The connections themselves work; However, after a while when the connections time out, they don't seem to be closing all the way. For instance, right now if I do a netstat, among some other connections I get: Proto Recv-Q Send-Q Local Address tcp1 0 burner.com:4848 burner.com:mysqlCLOSE [munge-alert!] This is strange as the normal output from netstat should look like this Proto Recv-Q Send-Q Local Address Foreign Address State tcp0 0 localhost:46764 localhost:imap4sESTABLISHED tcp0 0 localhost:imap4slocalhost:46764 ESTABLISHED Yours seem to miss out at least to headings, who knows what else is missing? and there is no such state as CLOSE, so I'll assume for the rest of the email that you're refering to CLOSED. This has been there and been in CLOSE state all day. It was there yesterday. It will be there tomorrow. MySQL has terminated the connection as far as it cares (if I mysqladmin processlist, no connections show up.) Indeed, if I shut down the MySQL server, the socket remains. Only if I shut down Apache will it ever go away. So, if left going for awhile, tons of these dead sockets will pile up. nope, if you leave it going for awhile nothing out of the ordinary happens, the socket will be reused (when it's time is up). the reason it doesn't go away until Apache is closed is that this is apache's socket, and not MySQL's, as the forreign address is the :mysql. Before I post a bug report, anyone have any ideas? Yes, read netstat(8). and I quote: CLOSED The socket is not being used. if the socket was dead you'd either see CLOSE_WAIT The remote end has shut down, waiting for the socket to close. LAST_ACK The remote end has shut down, and the socket is closed. Waiting for acknowledgement. (or even a time_wait, but only for a limited time, unless you've got some nifty problems with loopback.) What is the problem here really? MySQL isn't chewing resources, Apache isn't chewing resources, the fact of the matter is that you're seeing closed sockets, sockets that will be reused when apache+php reconnects to MySQL. The only intriguing part about your post is that the Recv-Q is still 1, but all in all I wouldn't worry... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Access with PHP on Linux?
At 13.11.2001 23:23, Chris Payne wrote: Hi there everyone, I have had abit of an emergency, I have a website for a client based on ASP and ACCESS 2000, but the current server is giving us problems so I want to move over to my own server. The problem is my server is a Linux server - is ACCESS 2000 possible? My server has support for PHP, ASP, MySQL, etc .. and it says that PHP is able to interface with ACCESS - but how to hell do you do that? I haven't got a clue - could anyone please help me as it is dead easy using a DSN-LESS connection on the current server, but I don't know where to start here. My server runs the latest Red Hat Linux Apache system, with ASP (Don't remember which version I only know it's not Chilishoft - sorry :-( Latest PHP, MySQL, FP2000 Ext... CGI and so on. I want to keep it an access DB if possible as i've had problems changing the DB to MySQL. Install ODBC, that would let you interface with degenerate database formats as access et al. Your best solution however would be to ditch Access and go a decent database solution, one that doesn't tend to break under load (and doesn't impose strange limitations on itself with regards to throughput). (on a totally different not, I'd ditch FP extensions aswell, as they've proved to be a bit of a nightmare on the security front in the past, don't know how they're doing at the moment, but anything that tries to imitate something undocumented is a no-no in my production environments). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] delete multiple entries from a database using PHP
At 26.09.2001 17:16, Markus Bertheau wrote: [EMAIL PROTECTED] wrote: how can I delete multiple entries from a database using PHP . I need to make sth like delete from table where attribute = something deletes all rows where attribute is something. or the glorious DELETE FROM tablename (tip: do not try that on useful information ;-) -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Huw do I perform update? I missed the accual code bi t.. sorry
At 26.09.2001 19:55, Ricky Theil wrote: I have no problem updating integer and float fields when putting them in '' if you update an integer with a blank value, it makes the value in the db =0. always on unix and mysql, though. Ricky True, there's nothing that forces you to wrap integers into s under mysql, and generally that's not a bad idea, it would escape some of the duuuh-mistakes that happen from time to time $query = UPDATE dvd.news_categories SET newscategory='$newscategory', newscat_status='$newscat_status' WHERE newscat_id='$newsid'; What does mysql_error() say, and have you tried the query on the command line to get and exact pinpoint where the error is? (okay I admit I haven't even looked at the query as this sounds like a stupid mistake that could be solved by trying a few easy twiddles.) -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] guys here is my problem in a simpler way:)
At 26.09.2001 22:24, its me wrote: hi there, i have a similar problem which is driving me crazy and i hope u can help with: i have a form whith a normal button when clicked ,i open a new window through javascript(this window have a php script) which i wanna pass to it a form field: input name=category but as i told u there is no submission for the form so i can't pass for example a hidden field or $category script function test() { x=document.forms[0].subcategory.selectedIndex y= document.forms[0].subcategory.options[x].text if(y==Printers) open(store1.php,newwindow) } /script form input name=category input type=button onClick=test() Why don't you pass the value along with the URL? open(store1.php?myvalue=wooosh, newwindow) (and ofcourse use your pretty little function to create the URL). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] warning/error
At 25.09.2001 21:00, Rick Emery wrote: show us code Agreed! But if I were you I'd check my query and optionally the output of mysql_error() or try the query with the mysql client... 8 out of 10 times it's a error in the query, 1 out of 10 it's a spelling error (eg. $result and $rseult) and the last time is reserved for special occations... to find out which either post code or DO SOME TESTING BEFORE POSTING! -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] random created numbers and letters
At 25.09.2001 22:46, Saulius Jankauskas wrote: Hello, Can you give me a piece of code, where I could see, how to create random written numbers and letters? For example, I'd like to give my visitor temporary passwrord: BS0147. To another HF0124 and so on... How to generate it with PHP? Sorry, if I didn;t explained clearly what I want. Thanks. Did you read _anything_ in the manual before posting?! (and how on earth is this related to php-DB ?!) check out rand() srand() mt_rand() mt_srand() and so on... and I'll leave it up to the reader to decide how to create a password-fish out of a row of numbers... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Individual Lines of text
At 25.09.2001 01:19, Devon wrote: I am pulling down data from a switch which looks like Port 1, 33889029532 Port 2, 0 Port 3, 135852 Port 4, 6652941243 etc etc I need to know if it is possible with PHP to write a script that will pull the individual lines of this text file and store them into a mysql database line by line. Cheers if the lines are exactly as you describe them (ie. comma-separated) read the file line by line and use the explode() function to create an array of each line and flush it to the db of your choice... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Fatal Error
At 23.09.2001 02:41, you wrote: Hello, I was wondering if this means that my ISP doesnt support mysl commands in php. They use php3.0.18 and apache server. I get the following message. Pretty much. Your ISP has probably compiled PHP w/o mysql support, since they're running such an old version in the first place, why not put in a nice request and try to get them to recompile php (and perhaps move to version 4). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] about Printer()
At 20.09.2001 03:18, cheify wrote: php4 suport Priner() in windows.How do I use it ?thanks very much. http://uk.php.net/manual/en/ref.printer.php (substitute uk for local mirror) rantmethinks this is in the same ballpark av php-DB, not even the same league, it's not even the same fscking game!/rant -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] When would it be 'good' to store binary data in a DB?
At 07.08.2001 22:03, Justin Matlock wrote: cut Is this a bad idea? what is the downside to doing it this way? as far as disk usage goes, I seem to have more disk space this way -- inodes aren't getting wasted. The DB servers don't seem to mind at all. Thanks; Justin Looking at what you've written I'd say your solution seems excellent for the problem. As you say there isn't an easy solution to instant distribution with some level of redundancy between multiple sites, for a big number of files of relatively small size storing them in databases is certainly one of the easier solutions. What you didn't write though, is how you use these files... (I didn't see the word 'PHP' mentioned in your post though...) -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] mysql errors....
At 07.08.2001 20:39, Brian Weisenthal wrote: hey, im using php and mysql. i am sure that i am getting mysql errors but for some reason they are not being displayed making it real hard to debug. i hate debugging, im going to go insane..i cant see my errors helpplease, pretty please.thanks bwise We can't see them from here either, so you better post some code to illustrate your problem... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] php Please help
At 08.08.2001 01:05, Robert Barish wrote: Hello everyone. Let me get to the point directly. I had to reinstalled a clean version of 7.2 and only one thing left to do and is is kicking my perverbial back side :-) I use php scripting for my little web site and access mysql. The old installation I got up in a snap. When i move the save files over to the htdoc directory and tried to view my index.php page it tries to download it. You can go to www.bmtsolutions.com and see what I mean. I have done everything under the sun to try to fix this and am missing something really lame. I know this is not exactly not a php-db issue directly but I am hoping someone can help. It looks like i might need hand leading here. ;) Thanks for you valuable time. Bob First, what the is 7.2, Mandrake ? RedHat ? Slackware? Debian ? Trustix? Corel ? SuSE ? Linux? FreeBSD ? OpenBSD ? NetBSD ? *BSD? Solaris ? SunOS ? HP-UX ? *NIX ? Windows ? BeOS? (I guess that makes the point clear) My guess is that your webserver (which you didn't name) is missing what in apache-speak would be AddType application/x-httpd-php .php (for php4) or AddType application/x-httpd-php4 .php3 (for php3). Out of interest which OS and httpd are we talking? (I've got a hunch telling me it's RedHat and apache, it usually is when somebody is running a version number and no OS). (and yes this is certainly not a php-db issue, php-install would have been the list you should have posted to). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] auto fill field with value from another
At 03.08.2001 20:38, you wrote: Is there a way to have a field in a MySQL table automatically be filled whenever that row is created or updated with the value of another field in the same table? Is there a way to have it filled with a calculation based on another field? thanks, bill hollett subselects are nasty to implement in mysql (due to the fact it doesn't support them very-well/at-all depending on your viewpoint). but it is doable... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Connect to MySQL through Proxy?
At 03.08.2001 13:36, David Viner wrote: Does anyone know if it is possible to make a MySQL connection (using mysql_connect or mysql_pconnect) through a proxy server? I need to be able to synchronise from one server on an internal network through to one on the web - doing it when a proxy is not involved is dead easy, but... Thanks in advance for any tips/ideas on this. This is strictly a MySQL issue and not a php issue, but to avoid being a oneliner, I'm pretty sure that you can't do what you're hoping to do... Proxyservers deal with http requests (usually 1.0 and 1.1), mysql uses it's own protocol and has no means to communicate over http... Get your sysadm to open or map some ports for you so you can use mysql native, otherwise you'd have to do a dump and then import that on the other server, which would not be a 2-way sync... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Storing Code in a db?
At 27.06.2001 14:06, you wrote: Hey there, Is it possible to store code like a function, for example, in a mysql database and pull it into a php dynamicallly so you can use the function if needed? Not in a way that would be effective, the only way I could see it work is if you use a script to pull the function out of the database, write it to a file, and then include your newly written file... Which ofcourse would require a reload or 2 scripts. I'd stick with a couple of includes if I were you =). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] MySQL Error???
At 27.06.2001 17:24, Brian Grayless wrote: Is anyone familiar with this MySQL error? 1062: Duplicate entry '127' for key 1 I wrote a great bookmark management program that works fine, but everytime I insert bookmarks, I insert somewhere over 120 and I start getting this error, and it won't add them anymore. Any suggestions??? Thanks, It's a code error, not MySQL. Duplicate entry means that there already is an entry with value '127' for key '1'. Check whether there are some stale bookmarks in your db (use auto_increment instead). Also check your code for any errors around the insert statement... codesnipplets would be fine if you want the list to track this down... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] static or dynamic printer-friendly webpages?
At 27.06.2001 23:13, [EMAIL PROTECTED] wrote: Question for all you php experts out there: My organization's website is based on mysql/php backend - 95% of the webpages are generated dynamically using templates and database records. We have been asked to create printer-friendly versions of these pages. Now for your opinion/advice: should we (1)create another template called print.php for example and generate there print friendly pages dynamically or should we (2)create static html copies of each database record so that they are print friendly? By print friendly I mean I want a page that doesn't have the text cut off the right hand side of the page (nevermind, for now, that the original page shouldn't do this in the first place :) ) Thank you so much for your help! Depends how large your ogranization's website is. I'd definatly go with the dynamic one, that means creating one template and nothing else (appart from updating the other templates to have a PrinterFriendly link on them). While a static page would require updating every time something changes, and requires an amount of work proportional to the number of pages, which could create a living hell somewhere down the line, especially if you have more than one webmaster. *dynamic-dynamic-dynamic* ;-) -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] News(article) code that using PHP and MySQL
At 24.06.2001 13:30, you wrote: Could anyone suggest the free news(article) code that works fine? I want to learn how it work . thank you What about posting to the correct list? (ie. do you see the DB in the listname?) For some more info on your post, check www.freshmeat.net (or the links at php.net). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] MAIL from php
At 22.06.2001 16:22, you wrote: Very strange Warning: mail() is not supported in this PHP build in /virtual/sergio/public/prova.php on line 18 What's this ? This is _totally_ unrelated to php-db, and should have been posted on the php-general list! But basically your php install hasn't compiled in support for the mail() command, it might have been disabled on purpose, ask your admin. -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Connecting to MySQL
At 22.06.2001 09:42, you wrote: How can I connect to our MySQL server remotely. Ordinarily, we upload the same PHP application the same machine that runs MySQL too. So, I just access it using localhost in the mysql_connect( ) function, like: mysql_connect($servername,$dbusername,$dbpassword); where $servername = localhost What if I want to access the MySQL server from my Win test machine that runs Apache? change the servername variable to the hostname of your database server and make sure that you are allowed to connect (either in mysql.db or mysql.user). btw. it's always a good idea to use a different topic than a subject just discussed.. -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] Password Protect page
At 22.06.2001 11:23, you wrote: I tried but to no avail, I was trying to send the header to redirect if the password in the input box matches the database password but it kept saying that the header was already sent.. I tried Javascript aswell, doing a location.href = URL within the if statement. this is not a db issue, when you are using the header() function it has to be the first output sent back to the user, ie. no blank spaces before the ?(php) and no echo's etc. Check that first, and if that doesn't help, try pasting the code so we can try to see the bug... (code is always good when you run into trouble). -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] how to email article to a friend
At 20.06.2001 08:52, you wrote: You can query your database to extract those info, compose your email and use mail( ) function to send it. that is _not_ a wise way to do it, you should include some form of restrictions on how many emails can be sent to a single account within X minutes for example. Further you should restrict by HTTP_REFERER (yep it's poor, but it's better than nothing) so that a automated script can't use your email-article-to-a-friend function to spam thousands of people without any work... There are quite a few considerations to take into account when writing a email-article-to-a-friend function, just to be on the safe side... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] newbie: Trying to select a database in php
At 20.06.2001 09:06, you wrote: Im using win2k and php to retrieve and dipslay database records, however whenever the page is loaded in a browser I get the following error (the line in question is in bold) Fatal error: Call to undefined function: msql_select_db() in D:\ASP\test\php\default.php on line 18 Spelling mistake I take it, the error refers to msql while you're using mYsql... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Query in a function
At 19.06.2001 09:21, you wrote: Hello I have a query that I have placed in a function that is in a file that I include in the page to be displayed. It doesn't work. I know that the code works because when I place the code in the page to be displayed directly it works fine. I can't figure it out. Thanks in advance for any help. John Here is the function contained in lib.inc: function type_select() { $connection = mysql_connect($server, $user, $pass); are $server, $user and $pass global variables? If not, they wouldn't be available inside the function and you'd either have to make them global, or pass them to the function. That could explain why you can't connect... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then. -- 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] newbie: showing records from SQL
At 28.04.2001 18:06, you wrote: Hello, I'm new at php... I've done a little SQL with visual basic in the past, and now I would like to publish a database online... I managed to find out how to add records in my table, but I can't find out how to show records... Are there manuals on the web that are specific to php sql? I've found manuals for both, but they both give only a little bit of information, and refer to the other website for more information... or is there anyone who can give me a simple example, where the page just renders all the records? and one where the page renders all records where name is Jhon Thanx 2peak click on links at php.net and look under tutorials (or similar) there you should find a couple of tutorials and guides to get you started, it simpler than you think... If you look in the annotated manual you'll probably find some examples there too. -- Andreas D. Landmark / noXtension PGP ID:0xB2BEAE80 / 4096bits Fingerprint:654B 3BCD 1130 9B3A 08BB AB1A BF72 841D B2BE AE80 -- 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] mail system
At 26.04.2001 16:20, you wrote: I was wondering if anyone had any ideas on how I can setup a email system , internal using php and mysql only .. No Imap Server, or POP. Can someone please guide me in the right direction ,, this is email sysetm would be only for registered members. I am setting up a dating site.. Any help would be appreciated Thank You Store the email in some form of storage (database would be preferable) and then use queries to fetch the mail. To send mail just insert an entry into the table holding the mail. -- andreas landmark / noXtension [EMAIL PROTECTED] We are Pentium of Borg. Division is futile. You will be approximated. -- 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] Can't connect to local MySQL server through socket '/tmp/mysql.sock'
At 26.04.2001 20:53, you wrote: I have this error Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) sounds like MySQL is not running on your server.. ensure it's installed properly and has actually started, i think typing mysqladmin -p version at the command line will tell you if it's running. you might find some useful info here: http://www.mysql.com/doc/S/t/Starting_server.html good luck, simon or just run mysql -p and see if the client can connect through the pipe, if not (and ps auxw | grep mysql returns a running process) your pipe has been fiddled with... -- andreas landmark / noXtension [EMAIL PROTECTED] #distributed : 20001003 [23:27:04] froggie_ I like the feeling of a TCP socket you get in a DCC chat.. -- 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] continuously view database updates.
At 26.03.2001 15:44, you wrote: Hi, I am doing a college project which involves using PHP scripts to update a MySQL database. For demonstration purposes I would like the new updated table in my Database to be shown each time it is updates without me having to go to the command prompt window and type in select * from members; for example! I will have the command window open for the demo. Thanks Kev. Live display of a mysql table isn't possible AFAIK, but you could fake it through scripting og programming on your preferred platform, just do a select * from somewhere statement every second (- put favorite interval there) and display it the way you like it to be displayed... PHP could do it, perhaps not the most effective solution, but certainly an easy solution... use a persistant connection and HTTP-REFRESH or something, unless you're dumping heavy work on the DB this should be fine, if we're talking high-performance time-critical and or high-load stuff here, you might wanna look at somethingelse... -- Andreas D. Landmark / noXtension PGP ID:0xB2BEAE80 / 4096bits Fingerprint:654B 3BCD 1130 9B3A 08BB AB1A BF72 841D B2BE AE80 -- 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] MySQL for Billng Question
At 26.03.2001 22:21, you wrote: how bout something like this. You have 3 columns TOTAL_HOURS | UNPAID_HOURS | LAST_PAID when you are paid, update TOTAL_HOURS to add UNPAID_HOURS and clear [delete, or set to zero] the UNPAID_HOURS column... LAST_PAID would be type = timestamp, or date. You could get pretty elaborate, and mySQL can do a TON of cool tricks with the numbers... depends what your uses may be. If you are using it to generate statements it may be worth more time than simply "keeping track" I picked up SAM'S learn SQL in 10 minutes. I really liked it, considering that I don't need to use a whole lot of mySQL functions, it's a wonderful little reference and I have learned some neat things real fast. I understand that it is far from "complete" but i feel it is worth it for me [starting out] olinux I'd rather go for something like one field for date, one for hours worked, one for paid and one for date paid, this way you could keep track of _when_ you worked and didn't get paied, it's much easier and better in the long run than just having the number of hours they owe you... (this way you could calculate number of hours you work per week etc.). -- Andreas Landmark / [EMAIL PROTECTED] "If you are too low a lifeform to be able to learn how to use the manual page subsystem, why should we help you?" (Theo de Raadt) -- 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]