Re: [PHP-DB] Mysql autentication problem
Hi, So it works from PHP w/o a password, but with a password does not? What are you using for a password? I don't mean post it here, but are there any 'funny' characters in it? I've had trouble because of that before, on other systems. Try a dumb, obviously OK password, like 'apples' and see if that works. Increase the password complexity from there... Ted On 3/2/07, Roberto F Tavares Neto [EMAIL PROTECTED] wrote: Hello, I'm trying to do a very simple thing: create a database and a user to use it. So, initially, I use the web interface phpmyadmin. Logged as root, I created the database, and the user with some password. But, I could not login using phpmyadmin. Either any php-based system could connect to the BD. So, I make sure that I got the [EMAIL PROTECTED] and [EMAIL PROTECTED] created, with permissions and same password. Nothing. But I *can* log on mysql shell. One more info: when the user is set without password, it works fine on PHP. Does anyone can give me a clue of what is happening? Thanks! Roberto -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Mysql autentication problem
Hi, When you're connecting from your PHP script, are you connecting from the same machine that the db is on, or a different one? If a different one, you'll need to do grant commands like: grant all privileges on mydbname.* to 'mydbuser'@'myhostname.mycompany.net' identified by 'mypassword'; Ted On 3/2/07, Roberto F Tavares Neto [EMAIL PROTECTED] wrote: Ted, I try the classic abc and had the same problem... Roberto Ted Fines escreveu: Hi, So it works from PHP w/o a password, but with a password does not? What are you using for a password? I don't mean post it here, but are there any 'funny' characters in it? I've had trouble because of that before, on other systems. Try a dumb, obviously OK password, like 'apples' and see if that works. Increase the password complexity from there... Ted On 3/2/07, Roberto F Tavares Neto [EMAIL PROTECTED] wrote: Hello, I'm trying to do a very simple thing: create a database and a user to use it. So, initially, I use the web interface phpmyadmin. Logged as root, I created the database, and the user with some password. But, I could not login using phpmyadmin. Either any php-based system could connect to the BD. So, I make sure that I got the [EMAIL PROTECTED] and [EMAIL PROTECTED] created, with permissions and same password. Nothing. But I *can* log on mysql shell. One more info: when the user is set without password, it works fine on PHP. Does anyone can give me a clue of what is happening? Thanks! Roberto -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Roberto Fernandes Tavares Neto Prof. Assistente Departamento de Engenharia de Produção Universidade Federal de São Carlos [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] tel +55 16 3351-9240 http://www.dep.ufscar.br/docentes_desc.php?uid=165
[PHP-DB] mysql_connect problem
Hi, I've setup an Apache 2.2.3, PHP 5.2.0, MySQL 5.0.27 on a Solaris 9 system. The install appeared to go well. To test the Apache/PHP/MySQL integration, I added a simple test.php to the Apache document folder, consisting of: ?php phpinfo(); ? When I access the URL/test.php, it displays as expected. That is, I see the PHP version, date, configure command and detail about all of the modules, including curl, gd, IMAP, and MySQL. Looks like a perfectly normal rendition of phpinfo(). So it looks great, like everything works. But then I try to load a web app on the server, like SMF or phpBB, they both tell me that I don't have MySQL configured. I don't understand why the phpinfo() command would show the MySQL config info, yet the web apps would think that MySQL was not configured. So I created another test php file, mysqltest.php, with these lines: ?php $link = mysql_connect('localhost', 'testuser', '***'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ? Now, as testuser, I can login to the database using the command line mysql -u testuser -p and entering the password. But when I try accessing the above file, I get no output in the browser, but in the apache errlog file, I get: PHP Fatal error: Call to undefined function: mysql_connect() in /opt/apache-php/apache/htdocs/mysqltest.php on line 2 So it looks like my PHP install just doesn't even know about the 'mysql_connect' function. extensions_dir = /opt/apache-php/php4/lib/php/extensions, and that dir does contain the mysql.so file. If I move it out of that folder and rerun phpinfo(), it displays without showing any MySQL config data. Any help? I'm just stuck! My directive for MySQL inclusion for the PHP ./configure command was: --with-mysql=shared,$BLIB/mysql ...where $BLIB was set to /opt/apache-php/libs Thanks, Ted
[PHP-DB] PHP-MySQL CMS Generator
Does anyone know of a program that can generate a good Content Management System? For example, it would ask which fields to add to a database table, the types of the fields, etc and create the database in MySQL and php's to manage the data. I did find a few such programs already (AppGini, PHPRunner) but they don't allow custom templates.I'd like to control how the pages look. Thanks. -t
Re: [PHP-DB] If else Question
Jennifer: Did you ever get your If else Question answered? On Mon, 25 Mar 2002, Jennifer Downey wrote: Hi all, I have a table called pets, here is a partial dump: At this time this is all I am working with. uid int(10) NOT NULL default '0', num_pet tinyint(1) NOT NULL default '1', There are three steps to adding the pet into the db Step 1 create the record, this is in create.php. And yes believe it or not this does work. $query_update = INSERT INTO pets (uid) SELECT uid FROM users WHERE uid={$session[uid]}; $result = mysql_query($query_update) or die(Unable to insert into the database); Step 2 Check to see if there is already a pet record this is in process.php. $query=SELECT num_pet FROM pets WHERE uid={$session[uid]}; $ret = mysql_query($query); while(list($num_pet)= mysql_fetch_row($ret)) // echo the number in the db, it should = 1 until submit button clicked echo $num_pet $number_pet = $num_pet; if($number_pet == 0 ) { print (Sorry you can't add another pet); }else{ this does all the updating of the record ? form action=petdata.php method=post Click to continueBR INPUT TYPE=submit VALUE=Submit NAME=submit /form ? } Step three update num_pet after submit is clicked, this is in petdata.php $db = update pets set num_pet = 0 where uid={$session[uid]}; $ret = mysql_query($db) or die(db_error()); Now here is my question, If the submit button is clicked and num_pets is updated to 0 and you try to add another record shouldn't this print- Sorry you can't add another pet? I am at a loss as to why it will keep adding records. Anyone want to take a stab at it? TIA Jen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and Foxpro Databases
Does FoxPro have an ODBC module? I'm in the midst of putting a web front-end on an Access database; we've put MySQL as the back end to Access using the ODBC connection. Then PHP can process queries on the MySQL db and the local operators see it as an Access db. We first tried PostgreSQL because of its more mature status -- but the case sensitive text queries were a killer for Access' completion function. MySQL works like a charm. On Thu, 28 Mar 2002, John Clarke wrote: I am thinking about providing real time web access to our coach reservations system. The reservations system is on Foxpro2.6 on a SCO Unix 5.0.2 server. I am considering setting up the web server with FreeBSD, Apache and PHP. Our reservations system is used by up to 60 operators almost 24 hours per day via dumb terminals and telnet sessions. I am interested in any experience anyone may have had with this type of project and whether there are any major hurdles to overcome or limitations of the OS's or the Foxpro RDMS. In particular I am interested in any experience anyone may have had with reading, writing, and locking Foxpro dbf's using PHP from the web server while other in house users are doing the same via their terminals and telnet sessions connected directly to the SCO Unix server. I have had some negative experiences with locking Foxpro dbf's via NFS and as such I am wary about it's limitations. Any comments at all would be greatly appreciated. Kind regards, John Clarke -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Beginner query about mysql...
The manual is at http://www.php.net/manual/en The function you need is mysql_insert_id. On Mon, 18 Feb 2002, michele wrote: I have a table with a ID field 'auto_increment', when i insert a record in the table, how can i know the value of the ID inserted by the mySQL? Thank's, Michele. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with mail function
Hi, Faye. There's a parm in the configuration file (php.ini) cleverly called max_execution_time. Its default setting is 30. There's also a set_time_limit() function that allows massaging this variable. Does this help? On Mon, 14 Jan 2002, Faye Keesic wrote: Don't know anything about ole 30 second timeout... what does it do? I checked out phpbuilder, and tried the sleep function after each loop iteration (didn't seem to work), so now am trying to send out the headlines in groups of 50... Sounds like others have the same problem. mail() is a php weakness??? -- Faye Keesic Computer Programmer Analyst/Web Page Design From: [EMAIL PROTECTED] Date: Mon, 14 Jan 2002 09:51:54 -0800 (PST) To: Faye Keesic [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Problem with mail function Is it the ole 30-second timeout thang? Changeable in php.ini? On Mon, 14 Jan 2002, Faye Keesic wrote: Hi there... I have a problem mailing out approx. 180 emails (no attachments) using the mail() php function. I loop through the email table once, sending the email to everyone in the list. The problem is that my page seems to time out when I send the emails, and it refreshes itself. So if I don't manually stop the browser after say, 10 seconds, the recipients in the email table get the email more than one time. Maybe I shouldn't be trying to send that many emails at a time. I am on apache using mysql and php... -- Faye Keesic Computer Programmer Analyst/Web Page Design -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000
Yes. PostgreSQL. On Sun, 13 Jan 2002, Boaz Yahav wrote: It's not just that... For example, when I want to backup the MySQL server (and we are talking of a few GB of data) the server is practically dead while making the dump. MSSQL Server 2000 (for example) does that in the background and you can keep working... Any ideas? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP/MySQL Library Catalog System
I just saw this which is new on Hotscripts PhpMyLibrary http://www.hotscripts.com/Detailed/13279.html On Thursday 10 January 2002 15:26, Daniel Barton wrote: Hi all, I've noted that a least a couple of people on this list work with library catalog systems - I'm interested in finding out whether any of these systems are open-source or are available for a nominal fee. I'm familiar enough with PHP/MySQL to make one, but I'd also like to avoid re-inventing the wheel if possible, particularly since I'm not a librarian :-). The non-profit that I work for has a significant biological science library that we would like to create a/use an existing web-based catalog system for. Also, I'm aware that there is specific funding available for doing this @ non-profits... I was wondering if anyone else had endeavored along these lines. Thanks, db -- -- Dan Barton Terrestrial Program Biologist Asst. Data Manager Point Reyes Bird Observatory http://www.prbo.org [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] How to insert to DB from txt??? Please help
egrep_split? But then, there's the learning curve for grep... On Fri, 4 Jan 2002, Leotta, Natalie (NCI/IMS) wrote: There are a few ways to split up text based on a delimiter. I recommend you look at split and explode on the PHP.net site and see what seems to be best for your situation. Once you go to one of them they link you to other functions that do similar things. I believe explode is faster but I can't remember for sure. -Natalie -Original Message- From: Kelvin [SMTP:[EMAIL PROTECTED]] Sent: Friday, January 04, 2002 11:44 AM To: [EMAIL PROTECTED] Subject:[PHP-DB] How to insert to DB from txt??? Please help Hi everyone, I have a txt file which is contained the following: ,aaa,ccc,ddd ,aaa,ccc,ddd .etc. Now, I need to read the data from that file and than insert it into the table. insert into Table (name,pass,phone,somethingelse) Could someone help me out here, How to write the code? I know how to read from a txt file, but I don't know how to separate the data determine by , Please help, I'll be very appreciate.Thanks Kelvin. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Date problem with new year
Did you convert the dates to PHP's Julian format before subtracting? On Wed, 2 Jan 2002, Faye Keesic wrote: I have a db site that always displays the most recent occurrence of news stories The last occurrence of stories was last year (2001-12-31) and up to the new year rolling over, I had no difficulty subtracting days, etc. Is there a bug in Mysql? PHP that I don't know of.. Please help. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP+ postgresql help?
print_r? Am I about to learn something new? Be still, my beating heart! On Tue, 21 Aug 2001, speedboy wrote: $conn = pg_connect (host=localhost user=username password=password bname=dbname); $sql = SELECT * FROM database where lower('$name%') order by last;; $result = pg_exec($conn, $sql); for ($i = 0; $i pg_numrows($result); $i++) { $row = pg_fetch_array($result, $i); echo pre; print_r($row); echo /pre; } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Stress tesing a DB
I'm gathering data on open-source databases... is there a program that can provide comparisons between databases, such as MySQL and PostgreSQL? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] cites/states data
It's public info, so free, and Hah! Try to get the 9-digit ZIP code stuff. Developed with tax dollars and sold by (I believe) a private corporation. Isn't it great that we're not getting all of the government we're paying for? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Subtracting times?
check out http://www.php.net/manual/en/function.mktime.php If you still need assistance, I'm here. On Sun, 24 Jun 2001, Matthew Cothier wrote: I really need help here. What I am trying to do is the following. - $today = date(m.d.y); $time = date(g:i a); if($row[3] == $today){ if(($row[4] $time) and ($time $row[6])){ print(Now Showing); } else { print(Today at $row[4]); } } else { print($row[3] at $row[4]); } $row[3] -- Date stored in database i.e 06.23.01 $row[4] -- Start time stored in database i.e 7.00 pm $row[6] -- End time stored in database i.e 7.30 pm My problem is that when it looks for the difference in time it works fine with say : start time = 7:00 pm end time = 8:00 pm But as soon as I go into: start time = 7:00 pm end time = 7.35 pm it mucks up! Please help!! What do I need to do? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Testing MySQL failed ???
Mysql isn't up? On Sun, 1 Apr 2001, Szeto wrote: Hello The code below i use in testing the connection (written in php4) ? if(!mysql_connect("localhost","khaimun","akyweb")) { print "could not connect to mysql!"; } mysql_select_db("focalmail"); ? --- Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/test/test-db.php4 on line 2 could not connect to mysql! Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/test/test-db.php4 on line 5 Warning: MySQL: A link to the server could not be established in /var/www/html/test/test-db.php4 on line 5 Note : The above error i get in executing the code -- -- Any suggestions would be appreciated. Thank You Khai Mun, Ng -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Testing MySQL failed ???
Excellent diagnosis, sir! However, it is woefully and pitifully short on curative information. On Sun, 1 Apr 2001, Felix Kronlage wrote: On Sun, Apr 01, 2001 at 06:50:24PM +0800, Szeto wrote: I am new to Linux environment so what. You could still read the error-message: | Warning: MySQL Connection Failed: Can't connect to local MySQL server | through socket '/var/lib/mysql/mysql.sock' (111) in this suggests, that you take a look at /var/lib/mysql to see if mysql.sock is there. -fkr -- gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | |all your base are belong to us | shame on me | fkr@IRCnet | -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Storing sensitive information in MySQL
Ahhh my favorite subject. Privacy. There are two PHP functions that do _exactly_ what you're looking for. Mcrypt_encrypt and mcrypt_decrypt. If you're looking for just enough encryption to keep the curious out, use a single password for all encryption. If you want military-grade encryption, have each person choose a (strong) password. I'd suggest Rinjdael or twofish as the encrypting algorithm. On Thu, 1 Mar 2001, Dreamvale wrote: Hi, I have a situation where some sensitive information need to be stored in a database, eg salary, medical info, etc. the data are only meant for the particular employees. however, the root user will have all the power to retrieve both the key (stored somewhere either in a file, or php scripts, or db), and the database too, hence can (not necessary will) read the sensitivie information. is there any techniques, or products to be used to solve this problem? thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]