Re: [PHP-DB] Subject Matter
On Fri, Aug 23, 2013 at 4:21 AM, Matijn Woudt tijn...@gmail.com wrote: The problem is: there is no maintainer;) Sure there is. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Subject Matter
On Tue, Aug 27, 2013 at 12:10 PM, Matijn Woudt tijn...@gmail.com wrote: Uh, you're right. I meant moderator.. Yeah, as far as moderation, we only do in extreme circumstances. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Gnome Desktop Button
On Tue, Nov 27, 2012 at 5:31 PM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: Dear list - Maybe this fell thru the cracks, so here it is again. Is there a way to have a button in the tray that will minimize all the windows and show the desktop? Well, it's neither a PHP nor database question, so that may be why it wasn't even noticed before (I know I didn't see it). That said, button-wise I'm not sure, but you could do a keystroke combination. Go to System Systems - Keyboard, click the Shortcuts tab, Navigation, and then bind Hide all normal windows. By default, GNOME generally comes with it set to either CTRL+ALT+D or CTRL+Super+D (where, on most keyboards, Super is the Windows key). Checking mine, it does indeed toggle all windows with CTRL+Windows_Key+D. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Vulnerability Announced in phpMyAdmin
Afternoon, folks; Just a three-list cross-post to bring it to everyone's attention at once, in case you weren't already aware. It was announced today that a compromised SourceForge mirror was distributing a malicious file with the phpMyAdmin package that allows an attacker to arbitrarily execute code on a server hosting the exploitable package. Obligatory (not intentionally self-serving) social media link here: https://twitter.com/oidk/status/250688002005811200 I don't especially know how this might affect other projects that are hosting on the same mirror, but I hope at least some of the more popular projects will take a moment to verify the integrity of their packages on the affected mirror ('cdnetworks-kr-1' mirror in Korea, for those interested). Those of you who have phpMyAdmin installed should check immediately to see if your installation is vulnerable to the exploit, particularly if it's auto-updated or has been installed or updated recently. We now return you to your regularly-scheduled Tuesday (unless you're east of the EEST time zone, in which case, Happy Hump Day). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Unsubscribe me Please
On Fri, Sep 21, 2012 at 11:17 PM, Sam js...@yahoo.com wrote: I saw where you did it for others. I will just block your address thx Sent from Sam's IPad And yet you missed that I said I wouldn't be doing it in lieu of following the obvious unsubscription instructions. Please do block all of our addresses, as they are intended for technical folks, not the general web community. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Unsubscribe me please
On Thu, Sep 20, 2012 at 9:29 PM, Alan Vickers alanvick...@cox.net wrote: Please remove me, too. Thanks! Please follow the unsubscription instructions as posted all over, included in the foot of every single list message, and as I posted twice in this thread yesterday. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Unsubscribe me please
On Wed, Sep 19, 2012 at 6:43 PM, Graham H. mene...@gmail.com wrote: Hi, I tried unsubscribing from the list, but I was unsuccessful, I believe because when I subscribed I cleverly added +php to the end of my email address (for Gmail filtering). Could I be removed please? Thanks. No problem, I'll remove you, Graham. I guess I'll remove the rest from this thread, too, rather than have them unsubscribe the right way (php-db-unsubscr...@lists.php.net or http://php.net/mailinglists, for anyone else who may be wondering). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Unsubscribe me please
On Thu, Sep 20, 2012 at 11:51 AM, Valentin Nedkov mana...@bds.bg wrote: Hello, please, unsubscribe me too. Sure. It seems no one knows the unsubscription instructions. So, for all others: From your subscribed email address, send a blank message to php-db-unsubscr...@lists.php.net. - OR - Go to http://php.net/mailinglists and select the list from which you want to unsubscribe, enter your address, and click the Unsubscribe button. No further manual requests will be processed today. Sorry for the inconvenience. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Unsubscribing
On Tue, Sep 11, 2012 at 3:37 AM, Aaron Wood - Slurpy Studios aa...@slurpystudios.com wrote: Hello, I have been trying to unsubscribe from this list, but it doesn't seem to be stopping - could you look into it for me and take me off the list? I've removed you from php-db@lists.php.net manually just now, Aaron. Sorry you were having trouble. Below you'll see the command history, for verification of your removal. I've masked your email address in this email for your privacy and protection. # ezmlm-list ~ezmlm/php-db | grep slurpy {...}@slurpy{...} # ezmlm-unsub ~ezmlm/php-db {...}@slurpy{...} # ezmlm-list ~ezmlm/php-db | grep slurpy # If you have any questions or concerns, or have any further issues with our mailing list subscription services, please don't hesitate to let us know. Thanks. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Test 2 w/copy
Looks like your mail from string in your email headers is coming through blank to the server. Can you check your email client settings and see if that fixes it? Also, if you have access to Earthlink webmail, try sending an email from there. On Fri, Aug 31, 2012 at 1:23 PM, Ethan Rosenberg eth...@earthlink.net wrote: Dan - Dear list - I am not receiving replies. I have been instructed to send a test email. Ethan -- -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] echo into variable or the like
On Tue, Aug 21, 2012 at 12:01 AM, s@optusnet.com.au wrote: Hi, this is my first post so forgive me if I missed a rule and do something wrong. I have this code, echo $_SERVER['PHP_SELF'].?; foreach ($_GET as $urlvar=$urlval) echo $urlvar.=.$urlval.; It works by it’s self. I want to insert the output in a table. Is there a way to ‘echo’ into a variable(i.e. make the output of this echo the value of a variable) or am I on the wrong track all together? This question actually belongs on the PHP General mailing list. As for echoing into a variable, the only way that's really possible is with output buffering (ob_start(), ob_get_contents(), ob_end_clean(), et al). However, you don't need (and shouldn't want) to do this here. Instead, as your snippet really won't do much of anything useful, you should (entirely) rewrite your code to look something like this, for an HTML table: ?php echo $_SERVER['PHP_SELF'].'?'.PHP_EOL; echo 'table'.PHP_EOL; foreach ($_GET as $key = $value) { echo ' tr'.PHP_EOL; echo ' td'.$key.'/td'.PHP_EOL; echo ' td'.$value.'/td'.PHP_EOL; echo ' /tr'.PHP_EOL; } echo '/table'; ? However, since it looks almost as if you're trying to build a query string based upon the supplied GET variables, you may want to try looking into http_build_query(). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MOD_Rewrite
On Tue, Sep 20, 2011 at 17:01, Gavin Chalkley gavin.chalk...@gmail.com wrote: Hey all, I am trying to use MOD_Rewrite with EasyPHP. I have this in my htaccess: RewriteEngine On RewriteBase / RewriteRule ^([0-9]+)/?$ main_index.php?key=$1 My main page is MAIN_INDEX.PHP my db identifier is KEY How ever i have never done any MOD_REWRITE so look at the following: http://www.knowledgesutra.com/forums/topic/10219-php-mod-rewrite-tutorial/ But i cannot get this to function. What I am trying to do is www.website.com/KEYNUMBER Could some one kindly help me out?? This is not a PHP question, but rather a mod_rewrite question. Further, it has very little to do with databases, so it's not pertinent to this list in that respect either. Finally, we ARE NOT associated with EasyPHP, we DO NOT support it, and we DO NOT endorse it by any means whatsoever. To get the answers you need to your questions, please contact a mod_rewrite group or the Apache httpd mailing list. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MSsql madness
On Fri, Jun 24, 2011 at 16:07, Paul Wilson paulwilso...@gmail.com wrote: please remove me from this list Email php-db-unsubscr...@lists.php.net. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] mysql error
On Thu, May 5, 2011 at 10:29, Grega Leskovšek legr...@gmail.com wrote: Can smbd please look at this sentence - I got an error and do not know how to fix it - I am still very unfamiliar with MYSQL: CREATE TABLE log ( idlog int auto_increment not null, imepriimek varchar(50), clock timestamp, action varchar(30), onfile varchar(100), filesize float(6,2), uniqueid(idlog) ); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(idlog) )' at line 1 This is by no means a PHP question, and should not be asked on the PHP General mailing list. Please ask questions in the appropriate place; for this, the MySQL General list is the correct forum, and they've been CC'd. In the future, if it relates to a PHP database issue, you may want to use the PHP Database mailing list, also CC'd. This not only means you'll get more on-target help faster, but also helps in archiving data in the proper location for future searchers. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] testing
On Fri, Mar 18, 2011 at 17:35, Jim Giner jim.gi...@albanyhandball.com wrote: first time poster There's no need to test. We've known it's worked for years. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SELECT WHERE length of content question
On Wed, Mar 9, 2011 at 17:49, Ron Piggott ron.pigg...@actsministries.org wrote: Is there a command in mySQL that would allow me to SELECT the rows where the `fax` column is more than 11 characters long? There is. SELECT * FROM tblName WHERE CHAR_LENGTH(fax) = 11; (Presuming you meant greater than or equal to eleven, as in an invalid US/Canadian phone number.) -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Submitting data to MySQL database using HTML/PHP form
On Sun, Feb 20, 2011 at 16:43, Donovan Brooke li...@euca.us wrote: $insert = INSERT INTO user_info(login,password) VALUES('.mysql_real_escape_string($login).','.mysql_real_escape_string($password).'); Look at that one more time Dan. ;-) Yeah, well, that's why one should never copy and paste, and why I shouldn't reply to a thread on quotes from my phone. Go figure. ;-P -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Submitting data to MySQL database using HTML/PHP form
On Sun, Feb 20, 2011 at 14:11, Nazish Zafar naz...@jhu.edu wrote: $insert = INSERT INTO user_info (login, password) VALUES ($login, $password); You're using double-quotes to encapsulate your $insert variable data, then never closing them. What's more, you're also using double-quotes to encapsulate each individual variable in the query. Rewrite $insert to this: $insert = INSERT INTO user_info(login,password) VALUES('.mysql_real_escape_string($login).','.mysql_real_escape_string($password).'); -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] bool type (between MySQL and PHP)
On Tue, Jan 25, 2011 at 17:05, Donovan Brooke li...@euca.us wrote: What is the best PHP practice when using bools with MySQL? Save 1's and 0's instead of true/false? You could either do an INT(1) DEFAULT 0 or an ENUM('Y','N') to make it easier on yourself. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] bool type (between MySQL and PHP)
On Tue, Jan 25, 2011 at 17:40, Donovan Brooke li...@euca.us wrote: Thanks Dan, I think the error would still persist using DEFAULT.. because as mentioned, I don't think MySQL likes: UPDATE tablename SET vbool= ..which is not great news for me since I'd like to avoid having to redo all my bool's in PHP (input checking, updates, add's etc.. ;-) ENUM would require that route as well I guess. Oh, sorry, I must've skimmed that part of the message. If you're not changing the value from the default, just omit it from the query. You can't send an empty value. If, for whatever reason, you MUST send the `vbool` column data in your UPDATE query, then define it: 0 = false, 1 = true (of course). Two easy workarounds here: ?php /** * Method #1 - note the triple-equals. If you set $tvar to anything * other than boolean true/false (such as 0/1), drop it to double-equals. */ if ($tvar === true) { mysql_query(UPDATE tablename SET vbool='1'); } /** * Method #2 - do it on the fly with a ternary operator. */ $sql = UPDATE tablename SET vbool='.isset($tvar) $tvar ? '1' : '0'.'; ? -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting PHP to MySQL on Windows
On Fri, Jan 7, 2011 at 15:06, Gavin Chalkley gavin.chalk...@gmail.com wrote: Mike, A plain HOST file should have the commented part at the top, and only 1 reference to localhost unless you are creating Virtual hosts. I would suggest removing the ::1 line As long as he never plans to use IPv6 on there, that would be fine. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting PHP to MySQL on Windows
On Thu, Jan 6, 2011 at 01:13, michael manning michaelgmann...@gmail.com wrote: Hi, I have installed MySQL 5.1.52, Apache 2.2.15 and PHP 5.3.2 on my Windows Vista computer. The MySQL works fine with the command line client and I have tested the Apache and PHP and it appears fine when I test this with the phpinfo() function. There is just one exception - I cannot connect to a MySQL database from within a PHP script. I have installed the MySQLi extension I know you said MySQL works fine from the CLI, but a stupid question: is the MySQL server running while you're trying to test from PHP? And, if so, on what port does netstat show it running? -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] using PDO vs mysql extension
On Thu, Jan 6, 2011 at 02:52, Miriam Natanzon miriamna...@gmail.com wrote: Hi, I want to build an internal module for common DB-involved tasks: starting with connection, simple queries and go on to multiple pages of results and connecting tables and so on. We are currently working with MySQL but maybe in the future we'll add use of MSSQL (but it's negligible in comparison with the MYSQL percentage of use). I wonder if to base my functions on the abstract layer of PDO or to use mysql function (means mysql_connect and so on). As I see it, mysql functions are more readable and comfortable, but in this case : using MSSQL in the future would affect with new DB module with another implementation. What do would do in such a situation?? You could stick with the native mysql_* and mysqli_* functions, but if you have any hint that your application may eventually change its database platform, or if you at least want the option to easily swap, you should definitely use abstraction. You could use PDO or, as I did, create your own abstraction layers with a common application interface. Then all you need to do is change a configuration variable if you need to switch from, say, MySQL to SQL Server, PostgreSQL, et cetera. The application never notices a difference. For example: ?php define('DB_PLATFORM','mysql'); $db = new DB(DB_PLATFORM); $db-select('*','tablename'); ? There will be some pitfalls and intricacies now and again that require some additional adjustments in the model, but I've found that, for myself, I prefer having full control over the code. Well, that and the fact that it was a specific requirement in the spec of the project. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Word Matching Application
On Wed, Jan 5, 2011 at 21:23, Ron Piggott ron.pigg...@actsministries.org wrote: I only know how to do one array at a time, using FOREACH, like this: === echo ul\r\n; foreach($match_words as $word) { echo li . $word . /li\r\n; } echo /ul\r\n; === You could either swap that out for a simple `for` loop or add in an array_combine() call and sort like so: foreach ($new_array_name as $word = $explanation) -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Job Search
On Fri, Dec 31, 2010 at 09:11, Ethan Rosenberg eth...@earthlink.net wrote: Dear list - I am an entry level data base programmer [PHP/MySQL HTTP/CSS] looking for work in the NY metropolitan area. Any ideas? Search Google, but trust me, you're going to need more experience than entry-level to pick up a job around here, unless you're working remotely, and for relatively-minimal wage for the industry. I'm out in Scranton, and even here, when companies hire for someone with skills in those areas, they want a minimum of 2-4 years. Should we have a job search board? No. Not only would that be reinventing the wheel, but if we did it, it would be square. Many others can do it much better than we would have any interest in doing. That said, I'd highly recommend checking your local CraigsList, in the Gigs section, for computer and web jobs. Sometimes they have some quick one-off ones that can not only help you build experience, but also start building your roster of contacts. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Regex for telephone numbers
On Fri, Dec 31, 2010 at 12:05, Dmitriy Ugnichenko mitya.ugniche...@gmail.com wrote: I guess, this will work fine ereg('[0-9]{3}-[0-9]{3}-[0-9]{4}', $phone_number); Not quite. Plus, all ereg* functions have been deprecated for some time now. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] Regex for telephone numbers
On Thu, Dec 30, 2010 at 14:07, Ethan Rosenberg eth...@earthlink.net wrote: Josh - I used use \d{3}-\d{3}-\d{4}. It works beautifully!! Just keep in mind that invalid numbers will also pass that check, such as 000-000- or 123-456-6789. That's why my example was a bit more involved. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP-INSTALL] php - libmysqlclient question
On Wed, Dec 29, 2010 at 04:57, Hajo Locke hajo.lo...@gmx.de wrote: Hello, i want to talk from php to different mysql-servers with different versions. is it a recommend way to compile php always against newest libmysqlclient or not so important? You should use the newest stable version so you can take advantage of the latest features and fixes, but unless you're going back really far - like MySQL 3.23 - any modern client version should have no negative impact. Even in that case it may not, but that's a better question for either the php-db@ list or the MySQL General list (both CC'd for folks to add anything I may have forgotten). -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] Problems w/ goto
On Sat, Dec 18, 2010 at 17:02, David Hutto smokefl...@gmail.com wrote: or maybe it's saturday morning and i'm drunk? This seems to be the most likely, and considering how all messages are permanently and independently archived and propagate throughout the Internet, it might be a good reason not to go nuts in sending unrelated and unintelligible messages of this nature in the future. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Problems w/ goto
On Fri, Dec 17, 2010 at 11:38, Ethan Rosenberg eth...@earthlink.net wrote: I am trying to write a program that can have two(2) independent forms in one PHP file. When I run the code below [from PHP - A Beginner's Guide], to which I have added a second form, it freezes. [snip!] What did I do wrong? You presumed that A Beginner's Guide meant that it was a book for beginners not one written by a beginner. Firstly, while GOTO has a place in programming for certain things, the example (and I can see the difference between the original and your additions) is atrocious, and is not at all representative of any code you would ever, ever want to put into production. That looks like a nightmare of taking a math final, not knowing the answer, and suddenly realizing you're in your underwear --- and have explosive uncontrollable diarrhea on top of it, and your ankles are chained to the chair. Who is the author? I saw one on Amazon by Vikram Vaswani, but there was no use of GOTO that I could find there. I'd like to see what other tips are included, or perhaps to see if that code was used in a different context (as in, what will work, but what not to do anyway, or, I wrote this on April Fool's Day). -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] Problems w/ goto
On Fri, Dec 17, 2010 at 12:16, Richard Quadling rquadl...@gmail.com wrote: And have you seen all the sad faces ... : { on http://docs.php.net/manual/en/control-structures.goto.php#92763 Can't be good for them. If only people knew how many hours - literally, hours - it took me to keep that page clean and free from vandalism after GOTO was introduced. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Resetting auto_increment
On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg eth...@earthlink.net wrote: Dear List - Thanks for all your help. How do I reset auto_increment so that the primary key will start from 1. The primary key is now 2421. I have deleted all the data in the table and started over, and the primary key just increments from its previous value. Setting auto_increment=0 does not work for me, why I don't know. UPDATE tablename AUTO_INCREMENT=1; -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Resetting auto_increment
On Tue, Dec 14, 2010 at 13:02, Ethan Rosenberg eth...@earthlink.net wrote: UPDATE tablename AUTO_INCREMENT=1; mysql update Visit3 auto_increment=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=1' at line 1 Same error if auto_increment is in caps. What did I do wrong? Sorry, you didn't --- I did. I was working on something for myself simultaneously and somehow crossed wires. My apologies. That's not an UPDATE query, it's an ALTER TABLE query. ALTER TABLE Visit3 AUTO_INCREMENT=1; Again, my apologies. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Resetting auto_increment
On Tue, Dec 14, 2010 at 13:43, Toby Hart Dyke t...@hartdyke.com wrote: Use 'ALTER tablename AUTO_INCREMENT=1' rather than 'UPDATE tablename AUTO_INCREMENT=1'. Yeah, again, my fault. Not enough coffee on this cold (~7F) winter's day, perhaps. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] French and Spanish Accent Letters
On Wed, Nov 10, 2010 at 10:03, Ron Piggott ron.pigg...@actsministries.org wrote: I have a column that is VARCHAR 250. I need it to be able to accept french and spanish accents. The purpose of the column is organization names. The “Collation” default is “latin1_swedish_ci” What do I need to do? Ron You need to ask on a database list. If it's MySQL, blast it to my...@lists.mysql.com, or - regardless of database - you can send it to php...@lists.php.net. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] French and Spanish Accent Letters
On Wed, Nov 10, 2010 at 10:16, Ron Piggott ron.pigg...@actsministries.org wrote: I did Daniel --- php-db@lists.php.net ; Thank you for telling me about the mySQL list. I failed to mention in my original e-mail the database is mySQL. My fault. Force of habit mentioning the php-db@ list. Sorry if there was any confusion on that. In any case, you'll probably get exactly the answer you're trying to find on the MySQL list. Quite possibly quicker there than the php-db@ list as well. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: ezmlm warning
On Fri, Nov 5, 2010 at 08:13, Lester Caine les...@lsces.co.uk wrote: Karl DeSaulniers wrote: Hi, Can anyone admin please explain this to me? If the email server gets bounce messages back for emails set out, then it tries to check those emails. If the warning message gets through then nothing really happens, but if that bounces as well, then it will disable sending more emails to that address. I had one for this list this morning as well ... Mostly everyone on the list would've gotten that same one. It's nothing of which to be concerned, it just means that your local mailservers did what they should: they bounced a poor attempt at a phishing message claiming to be from the lists.php.net support team (there is no such group). When your mailserver rightfully bounced the email, ezmlm sent the notice to you that it bounced. You can check the content of bounced messages yourself by following the instructions in any given bounce message you receive from us. Inside the email, you'll see a message number (not to be confused with a message ID), and you can build a dynamic email address to which you simply send a blank email. Moments later, you should receive a copy of the original email --- and usually that will come through, by request. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] php_warn
On Thu, Feb 11, 2010 at 08:49, madunix madu...@gmail.com wrote: some of my web pages having the following issue when i call them Warning:main(main_page.html.php): failed to open stream: No such file or directory in /www/htdocs/web/public/public.php on line 50 Warning:main(): Failed opening 'main_page.html.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/htdocs/web/public/public.php on line50 The following is useless for debugging this issue: PHP Core shows the following Directive = Local Value = Master Value allow_call_time_pass_reference = Off = Off disable_classes = no value = no value disable_functions = exec, shell_exec, system, passthru,popen, virtual, show_source, pclose ,ftp_connect,mysql_list_tables, display_errors = Off = Off display_startup_errors = Off = Off doc_root = no value = no value docref_ext = no value = no value docref_root = no value = no value enable_dl = On = On error_append_string = no value = no value error_log = no value = no value error_prepend_string = no value = no value error_reporting = no value = no value expose_php = On = On extension_dir = ./ = ./ file_uploads = On = On gpc_order = GPC = GPC html_errors = Off = On include_path = .:/usr/local/lib/php = .:/usr/local/lib/php log_errors = On = On log_errors_max_len = 1024 = 1024 magic_quotes_gpc = On = On magic_quotes_runtime = Off = Off magic_quotes_sybase = Off = Off max_execution_time = 0 = 240 implicit_flush = On = Off include_path = .:/usr/local/lib/php = .:/usr/local/lib/php log_errors = On = On Because it's not an issue with the core. What is your code on the lines mentioned in the error message? Did you use one of the following? * include * include_once * requre * require_once Lastly, is the file main_page.html.php actually even in the same directory as public.php? Is it named with the dual-extension .html.php? -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Looking for hosting or dedicated servers? Ask me how we can fit your budget! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] trying to dump out table info
On Tue, Jul 14, 2009 at 08:16, h...@deweywilliams.comh...@deweywilliams.com wrote: The problem I have always had with the PHP Manual (online) has been the lack of complete examples. Yes, there are examples of how to use each function. But functions such as the MySQL related ones require multiple steps to get to a point where anything works. There are at least two steps to get any database function to work 1)connect to database 2)select connected database. Until these two things are correct, none of the other functions will work because you do not have a database to work on. This is a continuous process, and one of which we're definitely aware. For now, you can get more information and examples from the user notes at the bottom of each page, but we are working on official examples as well. For some things, however, full examples will not be provided, as it would be out of the scope of the individual function's manual entry. In such events, the official documentation is a good reference, but not a substitute for learning on your own and from others. That said, we are *always* looking for people who would be serious about providing long-term assistance to the PHP Project, including the official documentation. If you're interested in learning how to do so, get in touch with me off-list at danbr...@php.net and I'll be happy to point you in the right direction. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] trying to dump out table info
On Mon, Jul 13, 2009 at 16:53, Govindagovinda.webdnat...@gmail.com wrote: Hi all I am not sure why this is failing/giving error. I am quite new at PHP/Mysql, and apologize for what will undoubtedly end up being a trivial error on my part. Hey, I recognize that code ;-P Here is my code: $db_billing=mysql_connect(localhost,metheuser,mypass,billing); if (!$db_billing) { die('Could not connect: ' . mysql_error()); } $sql = SHOW TABLES; $result = mysql_query($sql) or die(mysql_error()); Note the addition to the $result definition. This will cause the script to exit with the MySQL error message (if any) if the issue is in the query. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] trying to dump out table info
On Mon, Jul 13, 2009 at 17:24, Govindagovinda.webdnat...@gmail.com wrote: No database selected You're getting warmer How would you select a MySQL database in PHP? (Hint: there's a built-in function.) -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] trying to dump out table info
On Mon, Jul 13, 2009 at 19:28, Govindagovinda.webdnat...@gmail.com wrote: $db_billing=mysql_connect(localhost,metheuser,mypass,billing); if (!$db_billing) { die('Could not connect: ' . mysql_error()); } if(!mysql_select_db('dbname',$db_billing)) die(mysql_error()); //$sql = SHOW TABLES FROM billing LIKE 'mytable'; $sql = SHOW TABLES; //line 237 The fourth parameter you have in mysql_connect() only evaluates within the engine as a boolean True statement. RTFM to see why. ;-P -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] trying to dump out table info
On Mon, Jul 13, 2009 at 20:17, Govindagovinda.webdnat...@gmail.com wrote: Dan, I am really making the effort.. despite how it may look. I believe you. I sent you the function and code that should work for you, but it may have been lost in the chopped replies. So it'll be something like this: ?php $host = 'localhost'; $user = 'user_name'; $pass = '123'; $db_name = 'my_database'; $link = mysql_connect($host,$user,$pass); $conn = mysql_select_db($db_name,$link); $sql = SHOW TABLES; $result = mysql_query($sql); // ? -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Checking Special Characters
On Sat, Jul 11, 2009 at 02:41, Manu Guptamanugu...@gmail.com wrote: Dear All, I have to design a databse where I need to check for date using date as datatype in mysql I am having problems while inserting it Can you help me with it?? Google. Also I am having problems with eregi(), erege(); This is a serious issue, and one that you will continue to experience: because there's no such function as erege(). PLUS can i know various ways to secure password in a db Sure! See: http://tinyurl.com/ljrvzt -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] A prepared statements question
[Redirected to PHP-DB: php...@lists.php.net] On Sun, Jul 12, 2009 at 00:31, Jason Carsonja...@jasoncarson.ca wrote: Hello everyone, I am having a problem getting my prepared statements working. Here is my setup... index.php - authenticate.php - admin.php 1)index.php has a login form on it so when someone enters their username the form redirects to another page I call authenticate.php. 2)In the authenticate.php file I want to use prepared statements to interact with the MySQL database. I want to compare the username submitted from the form with the username in the database. 3)If the login username was legitimate then you are forwarded to admin.php Its step 2 I am having problems with. Here is what I have but I don't think it makes any sense and it doesn't work. $link = mysqli_connect($hostname, $dbusername, $password, $database); $stmt = mysqli_prepare($link, SELECT * FROM administrators WHERE adminusers=?); mysqli_stmt_bind_param($stmt, 's', $username); $result = mysqli_stmt_execute($stmt); $count=mysqli_num_rows($result); if($count==1){ header(location:admin.php); } else { echo Failure; } Any help is appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP- Mysql problem
On Thu, Jun 18, 2009 at 06:03, NADARAJAH SIVASUTHAN NADARAJAHnsivasut...@live.com wrote: Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\ap_v5\inc\profile.inc.php on line 285 http://google.com/search?q=Access%20denied%20for%20user%20'ODBC'@'localhost'%20(using%20password:%20NO) http://fart.ly/dm6m7 -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] oci_connect
On Wed, Nov 19, 2008 at 8:15 PM, Fred Silsbee [EMAIL PROTECTED] wrote: [snip!] Fred, Please keep all of your posts in the same thread with the same subject. You're making it very difficult for others to follow along with your ramblings, and seem to even be confusing yourself a bit. Chris has been trying to get the information he needs from you, but it looks like you're running over yourself. It happens with frustration, I completely understand. ;-P Keep everything in one thread so that it's easy to follow and so that Chris and others can help you out. Once you get the information sorted out in one linear fashion, I think you'll find the problems aren't as serious as you might have thought. And if they are, then we can all help you to solve them. -- /Daniel P. Brown http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] Ask me about our current hosting/dedicated server deals! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Kesalahan posting?
On Mon, Nov 3, 2008 at 11:46 AM, Alejandro Peña [EMAIL PROTECTED] wrote: Hi, if you try on http://www.appliedlanguage.com/language_identifier.shtml you'll see the Language: *Malay *;) The Don Komo emails have been hitting this list for a while. At least a year or two. They were on the MySQL list, too, but I think they stopped. In any case, I put up filters here so that I wouldn't have to read the crap anymore. -- /Daniel P. Brown http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] Ask me about our current hosting/dedicated server deals! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] CREATE question
On Thu, Oct 30, 2008 at 2:19 PM, Dan Shirah [EMAIL PROTECTED] wrote: Is it possible for us to use PHP to create temp tables in our database? [snip!] But all that does is give me an ifx_prepare fails message. (Forwarded to PHP-DB as well.) Dan, make sure Informix is set to allow that user to use the CREATE syntax. Also, not sure about IFX, but with other SQL databases - including MySQL - you have to use the full word `TEMPORARY`, not just `TEMP`. -- /Daniel P. Brown http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] Ask me about our current hosting/dedicated server deals! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] OCI
On Mon, Jul 21, 2008 at 12:22 PM, Mad Unix [EMAIL PROTECTED] wrote: How could I build the OCI8 extension module for php5 under CentOS5? I have installe PHP/APACHE/MYSQL through yum install ... OCI8 is a PECL extension. 'pecl install oci8' If you need more help with that, you can either check Google or perhaps go directly to the PECL OCI8 page. -- /Daniel P. Brown Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] CURL and ASP
On Wed, Jul 9, 2008 at 9:35 AM, ioannes [EMAIL PROTECTED] wrote: Has anyone here experience of CURLing .asp pages which use session cookies as I am having difficulty doing so on two different sites, both asp. Forwarded to PHP-General, John. If you're not already subscribed there, please subscribe to continue to follow this thread. If you're referring to using cURL from PHP to grab or spider pages written in ASP on a remote server, no, I've had no problems at all. In fact, once the content is served on the web, server-side language matters nil. It all comes out in the standard HTML/JavaScript/etc. format, and all HTTP policies and procedures (such as session handling) are [pretty-much] universal. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] php upload questions --move_uploaded_file
Hai, I'm forwarding this email over to the PHP-General list, since it's not database-related. If you're not already subscribed there, please subscribe and I'm sure you'll get some responses. ORIGINAL MESSAGE FOLLOWS: On Thu, Jun 26, 2008 at 6:21 AM, Liu, Hai Tao (Taylor) [EMAIL PROTECTED] wrote: Hi all: I meet a very strange problem about php upload. Usually, we use move_uploaded_file to upload, but it could not work in flex use php to upload. Same Php upload code can work in html page, and move_uploaded_file function will return 1; But it could not work in flex, and move_uploaded_file function return nothing. I wonder if PHP have some restriction? Has anyone meet such problems? Thank you very much! Flex upload code: file = new FileReference(); .. var request:URLRequest = new URLRequest(http://www.a.com/upload.php;); ... file.upload(request); Php code: ?php $uploadFolder = $_SERVER['DOCUMENT_ROOT']./previews/order/; // upload folder $destFileName = $_REQUEST['fileName']; $dest = $uploadFolder.$destFileName; if (sizeof($_FILES)==0) { echo no file; } $f=array_pop($_FILES); echo $f['tmp_name'].br ; error_log($uploadFolder.\r\n, 3, $_SERVER['DOCUMENT_ROOT']./FileService.log); error_log($f['tmp_name'].'::'.$f['name'].\r\n, 3, $_SERVER['DOCUMENT_ROOT']./FileService.log); error_log((is_uploaded_file($f['tmp_name'])?true:false).\r\n, 3, $_SERVER['DOCUMENT_ROOT']./FileService.log); return true here! echo $dest; $r = move_uploaded_file($f['tmp_name'],$dest); error_log(uploadresult--.$r.--\r\n, 3, $_SERVER['DOCUMENT_ROOT']./FileService.log); chmod($dest,0777); ? Thank! Luna -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Recommended web developers
On Tue, Jun 24, 2008 at 3:45 PM, Ken Keefe [EMAIL PROTECTED] wrote: I'm a little surprised no one else has commented on this, but for a website that complicated, 10k is way too low. I actually did this morning, but the message included other information (no advertisement or offers or anything) that I thought was better left as a personal email. In any case, Ken, from the (somewhat vague) description in the original email, you're correct. It took Yahoo! over 13 years to build to where they are now, at an ever-expanding cost of millions-upon-millions of dollars. Trying to basically clone the site for $10,000 isn't practical, but I'm sure the OP knows that and might have just left some specifics out of the email. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] question, about mysql query
This isn't a PHP question at all. It's a MySQL question. However, answers are below, with forwards to the appropriate lists for archiving purposes. On Mon, Jun 2, 2008 at 9:19 PM, LKSunny [EMAIL PROTECTED] wrote: two table, tablea and tableb tablea uid, col1, col2, col3 1,xx, xx, xx 2,xx, xx, xx 3,xx, xx, xx tableb id, uid, col1, firstdata 1, 1, xx, 1 2, 2, xx, 0 3, 2, xx, 0 4, 1, xx, 0 i want query tablea, and join tableb, uid is associate, ok LEFT JOIN `tableb` b ON a.uid = b.uid, and than i want tableb firstdata=1 or tableb no associate uid b.firstdata=1 OR b.uid IS NULL, by the time all ok, but i want add one case, if tableb firstdata all is 0, result one row, like b.uid IS NULL, i don't know how to i want result is all tablea data no double, tableb one case firstdata is 1 (one uid in tableb just one row possible is firstdata=1), or no row in tableb, or all firstdata = 0 Thank You Very Much !! This query can't SELECT a.*, b.* FROM `tablea` a LEFT JOIN `tableb` b ON a.uid = b.uid WHERE (b.firstdata=1 OR b.firstdata=0 OR b.uid IS NULL) Okay, I had a difficult time understanding what it is you need, but hopefully got enough from your message to be able to help you out. What I think you may be looking for is something like this: SELECT * FROM tableb WHERE firstdata='1' AND id IN (SELECT DISTINCT id FROM tablea ORDER BY id ASC); That will select only unique `id` columns from `tablea` and select only the rows from `tableb` where the `id` columns match and `firstdata` is set to '1'. You can then modify that query as needed. -- /Daniel P. Brown Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE
On Tue, Apr 15, 2008 at 5:56 PM, Javier Viegas [EMAIL PROTECTED] wrote: Thanks Daniel i ´ve removed the unexpected else secction. Now it works but it tells me that there might be a syntax error on the query, this is good news because now i know i´m having connection with the database but also there must be something wrong with the query. $del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id']; [snip!] You didn't enclose the value in quotes, that's all (and you should sanitize the input --- NEVER accept data without sanitizing it first!). ?php $del_str = DELETE FROM libros WHERE bnumero='.mysql_real_escape_string($_GET['Id']).' LIMIT 1; ? -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [Stored Procedure] - Error handling
Ratheesh, There's a specific list for PHP database functions, Databases and PHP (PHP-DB), which you can find at http://php.net/mailinglists . I'm forwarding your message over to there, and recommend that you subscribe to that list. You'll probably get more direct responses by narrowing-down the lists to the support you need. LIST: Original message follows. On Tue, Apr 15, 2008 at 12:53 PM, Ratheesh K J [EMAIL PROTECTED] wrote: Hello folks, Any way to retrieve the error code/error number from a stored proc. Scenario -- calling a stored proc from PHP - using mysqli_multi_query() The stored proc has multiple queries. Lets say one of the queries generates an exception. How do I retrieve the error message within the procedure itself? OR Is there any way from PHP to get the last error msg? I tried with mysqli_error().. Did not work.. Any inputs will be appriciated. Thanks, Ratheesh -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE
On Tue, Apr 15, 2008 at 4:49 PM, Javier Viegas [EMAIL PROTECTED] wrote: Hi, i have this script wich basically connects to a database and delete a record according to the Id parameter given. The problem is that when i test it i get this error: *Parse error*: syntax error, unexpected T_ELSE in * /var/www/biblio/scripts/delete.php* on line *31 Javier, This block: } else { $r_string = 'errorcode=4'; } is incorrect. You call an else condition on line 21, so PHP expects that block to be the last for that if() condition. Either remove the } else { and $r_string = 'errorcode=4'; lines or rewrite the condition. And if that's your real database login information, change it and update all of your scripts and systems ASAP. This is the script: *?php /* deletescore.php: deletes record for passed id from highscores table and returns status to Flash */ // fill with correct data for your server configuration $server = localhost; $username = root; $password = itsveryeasy; $database = biblioteca; //connect to database added by calm mysql_connect($server, $username, $password); if (!mysql_connect($server, $username, $password)) { $r_string = 'errorcode=1'; } elseif (!mysql_select_db($database)) { $r_string = 'errorcode=2'; } else { $del_str = DELETE FROM libros WHERE bnumero=.$_GET['Id']; if (!mysql_query ($del_str)) { $msg = mysql_error(); $r_string = 'errorcode=3msg='.$msg; } else { $r_string = 'errorcode=0'; } } else { $r_string = 'errorcode=4'; } echo $r_string; ? Wha am i doing wrong?? Thanks. Javier -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: php-db Digest 9 Apr 2008 13:17:18 -0000 Issue 4019
On Wed, Apr 9, 2008 at 5:09 PM, A. Joseph [EMAIL PROTECTED] wrote: The question is. Some nestled calculation. How did club freedom did the calculation, or how will the database structure looks like? *The example is -: * *Joseph* gave birth to *John*, *James,* and *Johnson* *John* gave birth to* Peter*, *Matter*, and *Potter* James gave birth to Juliana, Justin, and *Jane* Johnson gave birth to Jak, Jake and Jacob Using a parent-child relationship, exactly as in nature. MySQL: db_name.people id INT ( 8 ) AUTO_INCREMENT NOT NULL full_name VARCHAR ( 255 ) child_of INT ( 8 ) NOT NULL num_children INT ( 2 ) NOT NULL Then do some simple queries like this: ?php // First record $sql = INSERT INTO people(full_name,child_of,num_children) VALUES('.$fullName.','0','0'); // For each child // $parentID is the `id` column for the record of the parent of this child. $sql = INSERT INTO people(full_name,child_of,num_children) VALUES('.$fullName.','.$parentID.','0'); $sql = UPDATE people SET num_childen=(num_children + 1) WHERE id='.$parentID.'; ? And so forth. Code sanity and such are your responsibility, but that should kick-start the idea for you. -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] joins issues again
On Tue, Apr 8, 2008 at 7:28 AM, Steven Macintyre [EMAIL PROTECTED] wrote: Hi all, I have the following SQL statement; SELECT count( salesID ) AS count, branch_name, company_name, branch.branchID FROM sales LEFT JOIN IGuser ON sales.IGuid = IGuser.IGuid LEFT JOIN branch ON IGuser.branchID = branch.branchID LEFT JOIN company ON branch.companyID = '{$companyID}' WHERE maincompanyid = '{$mcid}' GROUP BY branch.branchID ORDER BY branch_name ASC However, i do not want those join records to be appended, only to return the count of records from sales. Can someone assist me with this? I have tried differance variants of joins and none of the results are correct. Sales tbl doesnt have the companyID, nor does IGuser Steven, Since this isn't a PHP-specific question, you'll probably receive better responses on either the MySQL list (you didn't mention which database system you're using, but I'll blindly and ignorantly assume that's it), or at least the PHP-DB list. I'm CC'ing both of those for you. -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HTML CSS (Off Subject) 911 Help! :-)
On Tue, Mar 25, 2008 at 12:24 AM, Karl James [EMAIL PROTECTED] wrote: [snip!] I need some help on formatting issues. [snip!] Right now the page looks like this. [snip!] http://www.theufl.com/2003/reports/rosters/fantasyrosters.htm [snip!] It is almost, their. However, as you can tell the players name is not cooperating. I want the table to look similar to this one. http://www.webleaguemanager.com/demo/reports/FantasyRostersRpt.html [snip!] Karl, It looks like everything is as you described your vision now. Is that correct? For the future, your best bet when attempting to copy a design is to cheat and view the source of the design you want to mimic. -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Not updating certain fields in same row
On Tue, Mar 25, 2008 at 12:59 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. [snip!] I have tried this code: $tab = \t; if (!isset($_POST['txtLoginName']) || empty($_POST['txtLoginName'])) { $loginName = mysqli_real_escape_string($chpwpostlink, $_POST['txtLoginName']); } else { $loginName = $tab; } Mmm-hmm and exactly how do that work to update the database? The SQL query you're probably looking for would be like this: $sql = UPDATE users SET Field1='.mysql_real_escape_string($field1).',Field3='.mysql_real_escape_string($field3).' WHERE id='.mysql_real_escape_string($id).' LIMIT 1; -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Not updating certain fields in same row
On Tue, Mar 25, 2008 at 1:14 PM, Jason Pruim [EMAIL PROTECTED] wrote: the actual query I'm using is this: $chpwsql = UPDATE current SET customerName='$customerName', loginName='$loginName', loginPassword='$PW', email='$email', adminLevel='$adminLevel' WHERE Record='$Record1'; What it is doing now is if I don't set a a field I am replacing the content of it with a tab, which isn't what I want. Basically what I'm looking for is if loginPassword hasn't changed... don't clear the contents of it. if it has changed, then update loginPassword Okay, since you won't only want to rely on isset() here (in case someone accidentally hits a key into the field), try this: // NOTE: This assumes prior sanity checks and cleansing // of variables, and is written like so to avoid breaking // of the query due to mail client-enforced line breaks. $chpwsql = UPDATE current SET ; $chpwsql .= customerName='.$customername.',; $chpwsql .= loginName='.$loginName.',; if(preg_match('/^[a-z0-9]{5,16}$/i',$PW)) { // If it's between 5-16 case-insensitive alphanumeric // characters, it's all good. If you want to allow symbols, // simply modify the regexp accordingly. $chpwsql .= loginPassword='.$PW.',; } $chpwsql .= email='.$email.',; $chpwsql .= adminLevel='.$adminLevel',; $chpwsql .= WHERE Record='.$Record1.'; $chpwsql .= LIMIT 1; -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ini_set ...
On Fri, Mar 21, 2008 at 10:20 AM, VanBuskirk, Patricia [EMAIL PROTECTED] wrote: I have the line ini_set('display_errors', 'on'); in my code, but it is not working. Does it need to be the first command on the page? [merge] I have full access to the php.ini file, which is what I do now to test... go there, change the file, restart the IIS service, etc. I read somewhere recently where they used this line in their code, and I thought how convenient that would be ... just haven't been able to get it to work. I will try true instead of on and see if that works. Does it go back to the default on it's own, or do I need to hard-code that in the page when I'm done? Trish, this is a general question rather than a database question, so it's being forwarded to the PHP-General list as well. It will not only get you some more detailed replies, but it helps keep the archives organized. If you're not already subscribed, please consider doing so: http://php.net/mailinglists Try something like this at the head of your code: ? error_reporting(E_ALL); ini_set('display_errors','On'); ? Keep in mind that it will only be executed in the same script as it's coded, and only if/when those lines are executed. It won't set the system-wide (or even same-session) display_errors, it only enables that option for that script at that time. -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Fastest way to get table records' number
On Tue, Mar 18, 2008 at 11:43 PM, Shelley [EMAIL PROTECTED] wrote: Hi all, What do you think is the FASTEST sql to get the total number of a table with millions of records? That question would be better on the PHP-DB list, so for archive's sake, I'm CC'ing that list. $sql = SELECT COUNT(*) FROM your_table; -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] question about php with sql database
Again, another question better-asked on the PHP-DB list, so it's being CC'd there. Responses in-line On Wed, Mar 19, 2008 at 1:08 AM, Sudhakar [EMAIL PROTECTED] wrote: instead of using mysql database which is conventionally used as database with php, if sql server database is used with php are there any major differences to keep in mind. There are going to be some SQL syntax differences, yes. Despite the name Standard Query Language, it's not really standard by anything but the most basic of queries. 1. are the connection statements ex = $conn = mysql_connect($hostname, $user, $dbpassword); etc does these remain the same or are they different. No, that's for MySQL, hence the name of the function, mysql_connect(). You'll want to use mssql_connect() and the mssql_() family of functions. RTFM: http://php.net/mssql If you're on a *NIX-like box, you'll also need to build and install FreeTDS. 2. unlike in mysql with phpmyadmin which is browser based to access databases and tables how to access sql server for the same functionality STFW before asking here: http://www.google.com/search?q=phpmyadmin+sql+server 3. can anyone provide a link about a manual for using sql database with php Again, STFW and RTFM. http://www.google.com/search?q=php+sql+server http://php.net/mysql http://php.net/mssql Also, keep in mind that you'll have to rewrite all parts of your code that currently utilize MySQL to convert it to MSSQL/SQL Server. -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Fastest way to get table records' number
On Wed, Mar 19, 2008 at 1:19 PM, Andrew Ballard [EMAIL PROTECTED] wrote: On Wed, Mar 19, 2008 at 1:04 PM, TG [EMAIL PROTECTED] wrote: It seems that count(*) pulls all the data from the row then performs a count increment whereas count(did) only pulls the 'did' column. Again, I don't believe COUNT(*) pulls any data. If there is a row, it simply counts it. The row could be full of NULLS (if allowed by your schema - yikes) and it will still be counted. I'd guess that COUNT(1) does the same thing. COUNT(did) does only examine the `did` column, but NULL values are excluded from the count. You are correct, sir! COUNT(*) doesn't look into the data at all, it just counts all rows. Keep in mind that COUNT(*) may very well return a different result than the cardinality of the table, since COUNT(*) couldn't care less if the row is unique or not. I wonder if count(did) is the same speed as count(1) or if it will depend on how much/what type of data is in 'did'. I also wonder why count() takes a parameter. Isn't it always going to count +1 for the row? I'll have to look that up sometime. It takes a parameter because it depends on what you want to count. COUNT(*) will return the number of rows matching the WHERE clause. COUNT(`column_name`) will return the number of non-NULL values in the column `column_name`. You could have a million rows in the table, but if every row has NULL in `column_name`, the COUNT() will return 0. There is also COUNT(DISTINCT `column_name`), which counts the number of distinct, non-NULL values in the column. You can extend a SELECT COUNT(*) query almost exactly like you would a basic SELECT query. Examples: SELECT COUNT(*) FROM users WHERE username LIKE '%dan%'; SELECT COUNT(DISTINCT color) FROM products; SELECT COUNT(*) FROM table LIMIT 0,1; Any limits or the like on the query (such as in the last example) will pretty much be ignored, though, because COUNT(*) only returns the number of matching rows, not any other data whatsoever. -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Query table / results to an array
On Fri, Feb 29, 2008 at 12:22 AM, Ron Piggott [EMAIL PROTECTED] wrote: $reference_number = mysql_result($search_result,$i,reference_number); $description = mysql_result($search_result,$i,description); ? $sql = SELECT reference_number FROM table WHERE this='whatever' OR that NOT LIKE '%whatever%' LIMIT 0,1; $result = mysql_query($sql); $row = mysql_fetch_array($result); ? Just mind the line-wrapping in this message. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] str_replace removing unwanted characters...
On Fri, Feb 29, 2008 at 2:18 PM, VanBuskirk, Patricia [EMAIL PROTECTED] wrote: Someone from this list (sorry I cannot remember the name), a while back, gave me the following function to use to get rid of unwanted characters coming in on forms: function convert_smart_quotes($string) { $search = array(chr(145), chr(146), chr(147), chr(148), chr(151), #, ;, [, ], {, // Note the missing } closing curly bracket here , , =, URL=http://;); Above, there are only 14 search terms, but below, there are 15 replace terms. Below the line I commented, add: }, $replace = array(', ', '', '', -, number, ,, , , , , , , equals, ); return str_replace($search, $replace, $string); } [snip!] 2. New VM Tree Greeting 1- Need NEW DN for this!!! (Please coordinate with Suzanne for recordings). See the parentheses above? I'll bet dollars to donuts that's your killswitch. See my updated arrays at the end of this email. [snip!] Also, we are getting back for example I\'m hoping... Somehow the slashes are coming through in the field and in the emails. I am not even sure what is putting them in, as I don't see that in the replace function. There's either an addslashes() function somewhere or a missing stripslashes(). Prior to inserting the data into the database, you should sanitize it using mysql_real_escape_string(). So, for example, if your SQL query looks like this: $body = convert_smart_quotes($string); $sql = INSERT INTO email(body) VALUES($body); It should be changed to: $body = mysql_real_escape_string(stripslashes(convert_smart_quotes($string))); $sql = INSERT INTO email(body) VALUES($body); And if that's not fixing the error for emails being sent, then find where the mail() function resides and replace the message body variable with something similar to: $message = stripslashes($message); Finally, the new arrays (rewritten function) I promised. function convert_smart_quotes($string) { $search = array(chr(145), chr(146), chr(147), chr(148), chr(151), #, ;, [, ], {, }, (, ), !, , , =, URL=http://;); $replace = array(', ', '', '', -, number, ,, , , , , , , ., , , , equals, ); return str_replace($search,$replace,$string); } -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To
Re: [PHP-DB] Password Reset
On Wed, Feb 27, 2008 at 1:52 AM, Nasreen Laghari [EMAIL PROTECTED] wrote: Hi, I have encrypted password in database and I encrypted using MD5(). As it is a one-way Hash so I cant get password back to original text !!! What encrypting technique I used to encrypt password so if user forget, I can decrypt password and email it. There are a bunch you could use, from the sickeningly simple (ROT-13) to a key-based reversible algorithm (Blowfish/Twofish). However, your best bet would just be to generate a new, random password, and email it to the user. Then, when they successfully retrieve the new password and log in, require them to change their password. This will also allow them to go back to the password they were using, should they choose to do so. ADDED BONUS! Lesson in Terminology: ;-P Encryption: CAN be decrypted. Blowfish, Twofish, DES, et cetera. Hash:CAN NOT be de-hashed. MD5, SHA1, *nix salts, et cetera. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP, MySQL and Lookups
On Wed, Feb 27, 2008 at 9:52 AM, Tobias Franzén [EMAIL PROTECTED] wrote: Consider this, if you have not already: What if two users happen to have the same password? It is wrong to assume that no two users will never have the same password. Doing an update like that, just based on the password column, is an accident waiting to happen. You should have a uniquely distinguished name or designation for each user, and validate the user and password combination. Also, such a designation should be unique, and keeping entries in a column unique can be enforced with MySQL. It's also safe to presume, however, that - since the OP said, Basically, what I'm trying to do is give a load of users an individual password - by individual password he means that the password *will* be the unique key. Just a thought. ;-P For all other intents and purposes, however, you're 100% correct. Using a unique auto_increment key would be your best bet. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SELECT query with multiple WHERE Clause
On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: I am creating a SEARCH, by only using one table. The search form is same as Inserting item (search has form of all fields in table ), difference is SEARCH page doesnt have validation . Therefore user can enter information in any of field. I would like to know how to write a SELECT query which has multiple where clause with OR operator. SELECT * FROM tableName WHERE (colA LIKE '%value%' OR colB='1'); --- more --- SELECT fieldA,fieldR,fieldT,fieldX FROM tableName WHERE (colA='value' OR colB LIKE 'Hello%') AND colC='Active'; -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP, MySQL and Lookups
On Tue, Feb 26, 2008 at 8:55 AM, Henry Felton [EMAIL PROTECTED] wrote: Hi everyone, I'm just getting into PHP at the moment and was wondering; what code would I need to look at a field value entered in a form, then if that value is found in my table, enter all the other information entered in the form, to the other fields on that record. Basically, what I'm trying to do is give a load of users an individual password that they enter, with various other pieces of information such as year of birth, single/married or whatever, into a form. In MySQL I have a table with three fields, but only the password one has any data in them. A script will then took in the table to find the password entered in the form, and then append all the other information (i.e. data for the other two fields) to the particular record that holds the password value entered. Henry (AKA: Max), Try this: ? include('config.php'); // Your database configuration and connection information if($_POST) { $dob = mysql_real_escape_string($_POST['dob']); $married = mysql_real_escape_string($_POST['married']); $pass = mysql_real_escape_string($_POST['pass']); // When designing the database, call the password field `pass` (without quotes). // The word `password` is a MySQL reserved word and could cause errors. $sql = UPDATE table_name SET dob='.$dob.', married='.$married.' WHERE pass='.$pass.' LIMIT 1; mysql_query($sql) or die(Incorrect password specified. Please try again.); // If we've reached here, then we can do whatever we want to acknowledge. // Let's redirect to a thank you page, sending the variables as a GET request // to be parsed by the thank you page script. header(Location: thankyou.php?dob=.$dob.married=.$married); exit; } ? form method=post action=?=$_SERVER['PHP_SELF'];? / Password: input type=password name=pass /br / Date of birth (mm/dd/): input type=text name=dob /br / Status: input type=radio name=married value=Married /Married input type=radio name=married value=Single /Single input type=radio name=married value=Widowed /Widowed input type=radio name=married value=Divorced /Divorced input type=radio name=married value=Wishing /Wishing I Was Singlebr / input type=submit value=Process Now / /form -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] INSERT query with Primary and foreign key
On Mon, Feb 25, 2008 at 8:15 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: Hi, I need help to insert date into two tables when tables have primary and foreign key relationship using php. I tried simple INSERT query but foreign key colum is storing NULL. What's your SQL query string, Nasreen? -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL replication delaying issue
On Tue, Feb 26, 2008 at 10:49 AM, Lasitha Alawatta [EMAIL PROTECTED] wrote: Hello Everybody, We have 6 multi-master MySql instances within a LAN , that are replicating is a sequential manner. Server Environment : Six identical Linux Enterprise version 4 running, servers with having MySQL version 6. we are using MySQL multi-master replication method for database replication. There is a delay (5-7 minutes) of that data replication process. We notice that it's because of MySQL table locking. Your comments are highly appreciated. Ask on a MySQL list. It has nothing to do with PHP. http://lists.mysql.com/ Specifically: Replication - http://lists.mysql.com/replication -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How to recognize which 'case' is being echoed by switch statement
On Fri, Feb 22, 2008 at 6:01 AM, Tim Daff [EMAIL PROTECTED] wrote: Hi, This is my first time using php in my site navigation, I have the code for all the pages in one file and I am using the switch statement to change between them. [snip!] None of your code included a case/switch piece. This is probably what you mean: ? $page = basename($_SERVER['PHP_SELF']); switch($page) { case contact.php: $css = li id=\contact-active\/li; break; case portfolio.php: $css = li id=\portfolio-active\/li; break; case whoweare.php: $css = li id=\whoweare-active\/li; break; default: $css = li id=\home-active\/li; break; } ? -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Uploading Image using PHP and mySQL
On Feb 18, 2008 6:56 PM, Chris [EMAIL PROTECTED] wrote: Which bit breaks exactly? Nobody's going to read through 200 lines of code.. Normally, you're right but today I did just to be a jerk and prove you wrong. ;-P Nasreen Laghari wrote: Hi All, First of all A very big thank you to all of you for solving my Password() encryption problem. Now I'm stuck on new problem which is image not uploading. I'm using the following code. [snip!] $allowedImageTypes = array(gif,jpg,png); if(empty($_FILES['image_file']['tmp_name'])){ echo File not uploaded; } else { $fileType = $_FILES['file']['name']; if(in_array(getfileType($fileType), $allowedImageTypes)){ [snip!] Nasreen, The above code depends on two things: a.) The getfiletype() response exactly matches at least one of the entries in the array $allowedImageTypes b.) The response and array entry are matched cAsE-sEnSiTiVeLy If you're uploading an image that was created in Windows Paint, for example, the extension will be CAPITALIZED (imagename.JPG) by default. Try using a strtolower() in your getfiletype() function to see if it clears things up. $query = INSERT INTO artist (name,about_u,imgdata, profile_url) VALUES('$aname','$aboutu','$uploadedImage','$url_provided'); You have an sql injection problem here. Read up about that on the phpsec.org site: http://phpsec.org/projects/guide/3.html#3.2 and a really good basic guide here: http://unixwiz.net/techtips/sql-injection.html -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Uploading Image using PHP and mySQL
On Feb 18, 2008 6:56 PM, Chris [EMAIL PROTECTED] wrote: $query = INSERT INTO artist (name,about_u,imgdata, profile_url) VALUES('$aname','$aboutu','$uploadedImage','$url_provided'); You have an sql injection problem here. Read up about that on the phpsec.org site: http://phpsec.org/projects/guide/3.html#3.2 and a really good basic guide here: http://unixwiz.net/techtips/sql-injection.html And in addition to the links Chris suggested, also RTFM on mysql_real_escape_string(). It'll be your new best friend (unless you're already using mysqli). -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Best ORM?
On Feb 19, 2008 5:46 PM, D Unit [EMAIL PROTECTED] wrote: Hi, I have an existing database and an existing set of classes. As my code base is growing, manually writing SQL to map between the two is getting old. My classes/database do not match up ActiveRecord style. Which is the best ORM for mapping between the two? You were on Nabble, you should've searched the archives. If you check in the archives, you'll see we had a discussion on this just a few days ago. You should get some pretty good answers on there, and if not, come back and ask any questions you need to clarify. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Password decryption
On Feb 16, 2008 10:17 PM, Nasreen Laghari [EMAIL PROTECTED] wrote: Hi, I'm junior in PHP and stuck on Encryption. I have encrypted password using SQL : $query = insert into user (userid,password,) values ('$username',Password('$pass'));; It's a one-way encryption method, so you won't be able to see the plain-text equivalent of the password again, but you can use this when testing a login: SELECT * FROM user WHERE userid='.$username.' AND password=PASSWORD('.$pass.'); Also, to correct your $query above, some things to note: PASSWORD is a reserved word in MySQL, so you shouldn't name any columns or databases as such. You have a comma after `userid,password,` in your column bracket. With PHP, you shouldn't end your MySQL query with a semicolon. The code needs it to terminate the line, the query doesn't. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Help with MySql float
On Feb 17, 2008 10:59 AM, Velen [EMAIL PROTECTED] wrote: Hi Guys, When inserting a value like 123567.8956 in my table it is rounding it to 2 decimal place. The field type is set as float. Can anyone tell me why it's not taking all the decimals? and How to insert the number with all the decimals? That's a MySQL question, not a PHP question, but my guess is that the column is set as FLOAT(x,2) (where x is any real number). Try changing that to FLOAT(10,4). The first number is everything to the left of the decimal, while the second is the number of places to count after the decimal. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP help question
On Feb 13, 2008 10:52 AM, Rudy sleiman [EMAIL PROTECTED] wrote: To whom it may concern I'm working on a network, i don't have internet access and the application i'm working on is not published online. Platform used: PHP with MySQL. The Database is created on PC A... I'm working on PC B... and my problem is that i am not able to connect to the PC A Database using the IP address as a host (since the database is not on my machine). but if i'm on PC A i can connect with the localhost. The question is that: do i need any configuration so i can access the database? What error message is being kicked out by PHP when you do mysql_connect() or mysql_query() with an `or die(mysql_error())` condition? Ensure that the firewall is allowing remote connections to port 3306 on PC A. If it is, then the problem is likely in the MySQL internal permissions. If that's the case, do the following (substituting your info in place). As root (or another authorized user of the database you want to use): USE database_name; GRANT ALL ON database_name TO database_username@'%' IDENTIFIED BY 'zxcvbnm'; FLUSH PRIVELEGES; Replace database_name with the name of your database; replace database_username with a username of your choice (doesn't have to be an existing account, MySQL will create it on the fly); replace '%' with the hostname/IP of PC B (using single-quotes around it) or leave it as '%' (with the quotes) to allow ALL hosts (wildcard); replace 'zxcvbnm' (with quotes) with a password of your choice. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Copying an image from one server to another
On Feb 5, 2008 9:49 AM, ioannes [EMAIL PROTECTED] wrote: OK but I could execute the script on the target server, which is also mine. So the jpg on the source is actually the remote server, I would be reading a remote file and writing it to the server which is executing the script. Then you could do something like this: ? $filename = http://www.remote.come/image.jpg;; exec('wget '.$filename); ? As always, sanitizing and customizing are up to you. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Copying an image from one server to another
On Feb 5, 2008 2:57 PM, ioannes [EMAIL PROTECTED] wrote: Am I right in thinking that exec() executes a string as a call to a program which executes in a shell? So am I to write: $callthis=the contents of my rsynch file; exec($callthis); Filtered :-\ -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Copying an image from one server to another
On Feb 4, 2008 11:03 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Feb 3, 2008 11:03 PM, Chris [EMAIL PROTECTED] wrote: FTP. There's no way fopen is going to be able to write to a remote url, that'd just be such a huge security issue it's not funny. I must've missed when the W3C and IETF forced a disable on POST. ;-P Whoops! I must've also missed reading comprehension in school. I glanced over it too quickly and missed the specific reference to fopen(). Sorry! -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Copying an image from one server to another
On Feb 3, 2008 11:03 PM, Chris [EMAIL PROTECTED] wrote: FTP. There's no way fopen is going to be able to write to a remote url, that'd just be such a huge security issue it's not funny. I must've missed when the W3C and IETF forced a disable on POST. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] [Fwd: Kesalahan posting: Don Komo]
2008/1/31 Evert Lammerts [EMAIL PROTECTED]: Is anybody else getting similar emails after sending an email to the php-db list? I don't understand any of this 2006 google group with 5 members. Original Message Subject:Kesalahan posting: Don Komo Date: Thu, 31 Jan 2008 09:17:40 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] [snip] Yes, you're not the only one. I've been getting the same thing with every post to the PHP-DB list. I just figured it was someone on an extended vacation (or maybe who died before turning off the autoresponse :-\ ). I never even bothered to look at the links. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] md5() function
On Jan 14, 2008 2:26 PM, Miguel Guirao [EMAIL PROTECTED] wrote: Hi!! I'm using the md5() function to encrypt a password and store it into a database. Now I want to retrieve that MD5 password and convert it into it's human readable condition. Is there a function opposite to md5()?? Negative. Once it's hashed with an MD5, SHA1, or similar encryption method, it's (as of now) impossible to reverse. You could create a table with a column of unencrypted phrases, characters, and combinations, with a second column containing the correlating hashed string, but that's about it. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] forms and method POST - variables
On Jan 9, 2008 11:25 AM, Lukáš Moravec [EMAIL PROTECTED] wrote: Hi, I have one question about forms and php (which I use for Mysql too). Do I need for variables from any form in html and method POST (then in php script) to set these variables with: $variable=$_POST['variable']; [snip!] That's a question that should be asked on the PHP-General list, actually. I'm forwarding the response to that list with this message. Are you receiving any errors? Are any messages displayed when you have the following at the beginning of the script? ?php error_reporting(E_ALL); ? $_GET and $_POST are predefined superglobal variables, which have been available in PHP since dinosaurs roamed the Earth. -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since 1979.
Re: [PHP-DB] Another new PHP programmer question...
On Jan 3, 2008 3:56 AM, Ben Stones [EMAIL PROTECTED] wrote: Hello, Thank you for your help previously everyone, I was able to fix that problem. The thing now, is that I want to add smileys to the messages; i.e. :) would equal to a smiley image when posting a message. Where you want that, add this: ? $smile = array(':-)' = 'smile', ':)' = 'smile', ';-)' = 'wink', ';)' = 'wink', ':-P' = 'tongue', ':P' = 'tongue'); foreach($smile as $p = $v) { // The following is done to allow the regexp to function normally. $p = str_replace(')','\)',str_replace('(','\(',$p)); $post = preg_replace('/'.$p.'/U','img src=/graphics/smileys/'.$v.'.gif /',$post); } ? This assumes that you have smiley images in /graphics/smileys/ and that they're .gif images named as shown in the second part of each array item. Also, keep in mind that, before you insert ANY user-posted data into your database, you should escape it. For example: $post = mysql_real_escape_string($post); -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] XSS
On Dec 26, 2007 3:05 PM, Mad Unix [EMAIL PROTECTED] wrote: Am facig problem with XSS cross Site scripting general on our web site, and i think its a coding issue since our dedicated server run Linux with apache mysql and php... any recommendation to resolve this issue Recode the site, and next time you need help, ask a more specific question and provide details. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] What is country codes?
On Dec 20, 2007 3:09 AM, $$$jame [EMAIL PROTECTED] wrote: hi what is country codes Where can I find a database of country codes? I came across this really cool website called Google, where I can find all kinds of things! Country codes are generally the ISO two-letter representations of countries. Here's a site that has some MySQL imports of ISO-standard country codes: http://27.org/isocountrylist/ -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Credit Card Encryption
On Dec 19, 2007 11:59 PM, Bastien Koert [EMAIL PROTECTED] wrote: I take the view that I warn our customers about the dangers, and if really concerning ask for an indemnity or a very formal request for change. I really try to convince them of the correct path and keep any emails regarding the issues as backup I was going to say the same thing. If PCI is really becoming that big of an issue where there's even the slightest threat of backlash to the developer, an indemnification clause (Santa's European cousin) should probably be the course of action. That said, I think I'm going to peruse the compliance information at that link you sent earlier. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Credit Card Encryption
On Dec 19, 2007 2:41 AM, Keith Spiller [EMAIL PROTECTED] wrote: Ok I've done some research and some thinking. What about storing orders in the database (product info and customer info) and then using GnuPG or PGP to send the credit card info to the merchant? This way the credit card information is not stored on the server or in the database but only in printed format by the merchant. Since my client processes all of the credit card orders by hand this seems like an ideal solution. I had a client that did offline (manual) processing of credit card orders as well. With liability issues and the problems that others have already pointed out, storing the credit card information was not an option, yet my client still needed some way of having the data available offline. Consider the following: ISSUERLENGTH Diner's Club/Carte Blanche 14 American Express 15 VISA 13 or 16 MasterCard16 Discover 16 Security checks aside (like making sure they selected the type of card and that it matched the algorithm - VISA beginning with 4 and being strlen($_POST['cardnum']) == 13 or 16, MasterCard being 16, beginning with 51xx to 55xx, et cetera), I then had a hybrid of storage and delivery. Mail the first ? rand(4,6); ? digits to the sales email address(es) on file. Three addresses on two domains were used for redundancy in this case. Store the remaining digits in the database. You could write your own encryption algorithm or use one that is publicly-available and reversible (Blowfish is what I was using, at 128, key length of 56 lower ASCII characters, padded with 7 on the key and four on the output - MD5, SHA1, et al are NOT options here). The sales department then received the first digits of the credit card number via email, which stated it was an order key. Again, in my case, I wrote an algorithm that would encrypt these digits prior to sending, using the actual order number as a key. The accounting software I wrote (all in PHP) would then retrieve the latter half of the credit card number from the database, decrypt the first part of the credit card number from the email (entered by the sales team on an SSL-encrypted page), and the credit card number would be displayed in full on the screen, to print, process, or verify. The downside is that, if there are any problems with email and delivery, the first $n digits of the card might not be received by the sales department. While, to date, I'm not aware of this having been a problem for my client (knock on wood), it's still a possibility. For this reason, you need to be sure to either have the email address confirmed prior to processing the order, or require a valid telephone number, so that you can reach the customer in the event of a failure. To assure the customer that you are calling legitimately, you will still have the last digits of the credit card, as well as the expiration data and CVV number (also stored in the database), the billing address, and the date and time the order was placed. It may not work for you, but that's how I created the system for my client in 2004, and it's still being used today, with almost $8 Million in online sales. [pats self on back] ;-P Now if I could just go back and renegotiate my contract for that gig -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Credit Card Encryption
On Dec 19, 2007 4:45 PM, Bastien Koert [EMAIL PROTECTED] wrote: Nope, I still would not recommmend it. The only place the CC data should travel to is the payment gateway. Anything else is a security risk. Why does your client process by hand? They should be using a payment gateway. That's true, Bastien, but if for whatever reason it's not an option for them, what? Tell them it's tough cookies and they're SOL? Our job as programmers - especially freelance - is to make things happen as safely and securely as we can, but as a bottom line, make it happen. I'm sure we (most of us) take the responsibility to discourage a client from making such choices, and to educate them on alternatives that are better for their interests, but still - at the end of the day, we're still just code monkeys. We're expected to build what the client needs, or else they'll find someone else to do it for them. And I don't really like to go hungry. ;-) -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] force to download file
On Dec 17, 2007 3:13 PM, Hiep Nguyen [EMAIL PROTECTED] wrote: hi all, i have this on top of my php page: header(Content-Type: application/vnd.ms-excel); header(Content-Disposition: inline; filename=excelfile.xls); but it is not prompt to save the file instead it opens right in IE. my question is how do i force the browser prompts to save the file? thanks Hiep, This is a question that should've been asked on the PHP General list, so I'm reply-all'ing and sending it to the General list for the archives as well. Here's a function I use that should help you out. ? function force_download($filename,$dir='./') { if ((isset($file))(file_exists($dir.$file))) { header(Content-type: application/force-download); header('Content-Disposition: inline; filename='.$dir.$filename.''); header(Content-Transfer-Encoding: Binary); header(Content-length: .filesize($dir.$filename)); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.$filename.''); readfile($dir.$filename); } else { echo No file selected; } } ? -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Form mail() problem
On Dec 10, 2007 1:05 AM, Tim Daff [EMAIL PROTECTED] wrote: [snip!] Here is the error code I am getting: Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] in C:\Domains\logosunlimited.com.au \wwwroot\contact\processquote3.php on line 284 [snip!] To me, this says that your code is probably still fine, but that the server on which the logosunlimited.com.au domain is hosted may not realize that the domain lu.com.au (presuming the `lu` stands for `logosunlimited`, and is another of your domain names) is a local domain, if it is. I'm not exactly certain how you'd handle that with Exchange (you're using Windows, so I ignorantly assume you're using Exchange), but in Linux, using Exim, Qmail, or a similar system, you'd need to modify /etc/localdomains. Either way, it looks like it's not a PHP issue, which might get you off the hook with your boss but have your server/network admin take a look at why lu.com.au isn't on the permissible relay list. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php