Re: [PHP-DB] MySQL problem..
okay.. i'm stumped. what client libraries? using php 5, so is it php_mysql.dll??? i'm using a canned script, so i have to make the changes there too? i checked out the mysql help link. i even started the mysqld with the --old-passwords parameter... still getting the error... thanks... Bastien Koert wrote: Check the mysql website. Have you upgraded from 4.0x to 4.1 recently. If so you need to update the client libraries that come with mysql. There are significant protocol changes from 4.0x to 4.1. Bastien From: ian [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem.. Date: Mon, 08 Nov 2004 17:02:53 + Any body met this error? Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/html/poems/browse.php on line 15 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL problem..
Any body met this error? Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/html/poems/browse.php on line 15 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL problem..
Check the mysql website. Have you upgraded from 4.0x to 4.1 recently. If so you need to update the client libraries that come with mysql. There are significant protocol changes from 4.0x to 4.1. Bastien From: ian [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem.. Date: Mon, 08 Nov 2004 17:02:53 + Any body met this error? Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/html/poems/browse.php on line 15 -- 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] MySQL problem..
ian wrote: Any body met this error? Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/html/poems/browse.php on line 15 http://dev.mysql.com/doc/mysql/en/Old_client.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL problem..
thnx ya'll... :) On Mon, 2004-11-08 at 17:52, Bastien Koert wrote: Check the mysql website. Have you upgraded from 4.0x to 4.1 recently. If so you need to update the client libraries that come with mysql. There are significant protocol changes from 4.0x to 4.1. Bastien From: ian [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem.. Date: Mon, 08 Nov 2004 17:02:53 + Any body met this error? Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/html/poems/browse.php on line 15 -- 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
[PHP-DB] MySQL: Problem optimizing multi-table row deletion ... errors out :(
hi gang I'm working on optimizing the SQL for my forum system, but have run into a problem trying to optimize the function for deleting a thread with accompanying stats data and posts from the database using 1 query. The current function, that works, looks like this: // delete all traces of a thread function delThread($threadID) { $result = mysql_query(DELETE FROM hf_threads WHERE `threadID`='$threadID'); $result = mysql_query(DELETE FROM hf_thread_stats WHERE `threadID`='$threadID'); $result = mysql_query(DELETE FROM hf_posts WHERE `threadID`='$threadID'); } I went through the MySQL manual, to try and find a way to optimize this, and came up with this variant: // delete all traces of a thread function delThread($threadID) { $result = mysql_query(DELETE FROM hf_threads,hf_thread_stats,hf_posts WHERE `threadID`='$threadID') or die('Unable to delete threadbr'.mysql_error()); } only it doesn't work at all ... the error output says this: Unable to delete thread You have an error in your SQL syntax near 'hf_thread_stats,hf_posts WHERE `threadID`='85'' at line 1 (Obviously I attempted to delete the thread with ID 85 here) I'm dealing with MySQL 3.23.56-log and PHP 4.3.0 ... Any ideas for optimizing this will be greatly appreciated, esp since I'm not all that great with the more complex SQL syntax... TIA Rene -- Rene Brehmer aka Metalbunny If your life was a dream, would you wake up from a nightmare, dripping of sweat, hoping it was over? Or would you wake up happy and pleased, ready to take on the day with a smile? http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums at http://forums.metalbunny.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL: Problem optimizing multi-table row deletion ... errors out :(
If the threadID column is an int, you don't need to wrap the $threadID variable in quotes. HTH ~randy On Tue, 14 Sep 2004 00:05:56 +0200, -{ Rene Brehmer }- [EMAIL PROTECTED] wrote: hi gang I'm working on optimizing the SQL for my forum system, but have run into a problem trying to optimize the function for deleting a thread with accompanying stats data and posts from the database using 1 query. The current function, that works, looks like this: // delete all traces of a thread function delThread($threadID) { $result = mysql_query(DELETE FROM hf_threads WHERE `threadID`='$threadID'); $result = mysql_query(DELETE FROM hf_thread_stats WHERE `threadID`='$threadID'); $result = mysql_query(DELETE FROM hf_posts WHERE `threadID`='$threadID'); } I went through the MySQL manual, to try and find a way to optimize this, and came up with this variant: // delete all traces of a thread function delThread($threadID) { $result = mysql_query(DELETE FROM hf_threads,hf_thread_stats,hf_posts WHERE `threadID`='$threadID') or die('Unable to delete threadbr'.mysql_error()); } only it doesn't work at all ... the error output says this: Unable to delete thread You have an error in your SQL syntax near 'hf_thread_stats,hf_posts WHERE `threadID`='85'' at line 1 (Obviously I attempted to delete the thread with ID 85 here) I'm dealing with MySQL 3.23.56-log and PHP 4.3.0 ... Any ideas for optimizing this will be greatly appreciated, esp since I'm not all that great with the more complex SQL syntax... TIA Rene -- Rene Brehmer aka Metalbunny If your life was a dream, would you wake up from a nightmare, dripping of sweat, hoping it was over? Or would you wake up happy and pleased, ready to take on the day with a smile? http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums at http://forums.metalbunny.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- randy [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql problem importing data
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hello Mark, I have tryed it by splitting the file into pices and then insert it with the help of phpmyadmin. This woked. however, I do have some more files to upload, and this seems to be not the fastest way:-) I tryed this: mysql LOAD DATA INFILE 'Hotel_Description.txt'INTO TABLE test.hotels_descriptionFIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'; ERROR 2013: Lost connection to MySQL server during query mysql 030806 02:08:37 mysqld ended As you can see, my db server creashed! Nothing special about this file. I am running MySQL 3.23.49 without problems so far. Merlin Mark [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] You could use mysqlimport with --fields-terminated-by=; or you could open it in something like Excel, parse it there (text to columns), and save it as a CSV or you could read it line by, line into PHP, explode each line on the ;, then insert the data into MySQL or you could write a YourFavLanguageHere script that does a string substitution of ; to , Lots ofother options, too, which I haven't thought of. --- Merlin [EMAIL PROTECTED] wrote: Hi there, I have a data file with data seperated by semicolons. It is about 8MB big. Now I just want to import it into mysql. I tryed several things. First I took phpmyadmin, which resulted in a white page without error msg. Then I tryed it by hand with load data. This did not work as well. No I installed myodbc and tryed to export it from MS Access. This completly crashes my database server with this message: /usr/local/mysql/bin/safe_mysqld: line 1: 1067 Segmentation fault nice --5 nohup /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/home/m ysqladm/data --user=mysql --pid-file=/home/mysqladm/var/mysqld.pid --skip-lo cking -u mysqladm /home/mysqladm/data/SARATOGA.err 21 030807 00:00:45 mysqld ended Has anybody an idea on how to import that data? Its nicely seperated by ; Thanx for any help, Merlin I assume here that when you say the data is separated by semicolons, you mean that the fields are separated by semicolons. In that case you should be able to use LOAD DATA INFILE and tell it that the fields are terminated by semicolons, not tabs as in the example you show above. -- Quod subigo farinam $email =~ s/oz$/au/o; A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql problem importing data
You could use mysqlimport with --fields-terminated-by=; or you could open it in something like Excel, parse it there (text to columns), and save it as a CSV or you could read it line by, line into PHP, explode each line on the ;, then insert the data into MySQL or you could write a YourFavLanguageHere script that does a string substitution of ; to , Lots ofother options, too, which I haven't thought of. --- Merlin [EMAIL PROTECTED] wrote: Hi there, I have a data file with data seperated by semicolons. It is about 8MB big. Now I just want to import it into mysql. I tryed several things. First I took phpmyadmin, which resulted in a white page without error msg. Then I tryed it by hand with load data. This did not work as well. No I installed myodbc and tryed to export it from MS Access. This completly crashes my database server with this message: /usr/local/mysql/bin/safe_mysqld: line 1: 1067 Segmentation fault nice --5 nohup /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/home/m ysqladm/data --user=mysql --pid-file=/home/mysqladm/var/mysqld.pid --skip-lo cking -u mysqladm /home/mysqladm/data/SARATOGA.err 21 030807 00:00:45 mysqld ended Has anybody an idea on how to import that data? Its nicely seperated by ; Thanx for any help, Merlin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql problem importing data
Hi there, I have a data file with data seperated by semicolons. It is about 8MB big. Now I just want to import it into mysql. I tryed several things. First I took phpmyadmin, which resulted in a white page without error msg. Then I tryed it by hand with load data. This did not work as well. No I installed myodbc and tryed to export it from MS Access. This completly crashes my database server with this message: /usr/local/mysql/bin/safe_mysqld: line 1: 1067 Segmentation fault nice --5 nohup /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/home/m ysqladm/data --user=mysql --pid-file=/home/mysqladm/var/mysqld.pid --skip-lo cking -u mysqladm /home/mysqladm/data/SARATOGA.err 21 030807 00:00:45 mysqld ended Has anybody an idea on how to import that data? Its nicely seperated by ; Thanx for any help, Merlin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem -- new to PHP
Thanks for all the help everyone sent me on this. However, nothing seems to make any difference whatsoever (except putting the 'localhost' part in quotes). I am still getting permission denied errors based on the user credentials. I have entered a user into the user table with host='localhost', user='php' and a password. I have entered these credentials into the db table also, and given the various privileges for this user to the specific database. I have run both mysqladmin reload and mysqladmin flush-privileges. I have even rebooted the machine. I have also tried typing GRANT SELECT,INSERT,DELETE,UPDATE TO php@localhost IDENTIFED BY ***, but this just throws up an error at the MySQL prompt. My PHP page can still not connect to the database. It just says: MySQL Connection Failed: Access denied for user: 'php@localhost' (Using password: YES) I know the problem is a permissions thing, because if I connect to the test database as 'nobody', there is no problem. Again, any and all help will be appreciated. This is ridiculously frustrating, especially since I have no problem connecting to the database from a perl script. I am tempted to stop trying to learn PHP and build my entire web site using perl cgi instead. Thanks Evan Morris [EMAIL PROTECTED] Tel: +27 11 792 2777 Fax: +27 11 792 2711 Cell: +27 82 926 3630 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem -- new to PHP
On Fri, 14 Feb 2003 11:30:03 +0200 [EMAIL PROTECTED] (Evan Morris) wrote: Thanks for all the help everyone sent me on this. However, nothing seems to make any difference whatsoever (except putting the 'localhost' part in quotes). I am still getting permission denied errors based on the user credentials. I have entered a user into the user table with host='localhost', user='php' and a password. I have entered these credentials into the db table also, and given the various privileges for this user to the specific database. I have run both mysqladmin reload and mysqladmin flush-privileges. I have even rebooted the machine. I have also tried typing GRANT SELECT,INSERT,DELETE,UPDATE TO php@localhost IDENTIFED BY ***, but this just throws up an error at the MySQL prompt. Try: GRANT ALL PRIVILEGES ON *.* TO php@localhost IDENTIFIED BY 'pass' WITH GRANT OPTION; To give user php admin access for testing (you may want to revoke this later). Remember to: FLUSH PRIVILEGES; to put the new privileges into affect. My PHP page can still not connect to the database. It just says: MySQL Connection Failed: Access denied for user: 'php@localhost' (Using password: YES) I know the problem is a permissions thing, because if I connect to the test database as 'nobody', there is no problem. Can you connect as php from the prompt? Again, any and all help will be appreciated. This is ridiculously frustrating, especially since I have no problem connecting to the database from a perl script. I am tempted to stop trying to learn PHP and build my entire web site using perl cgi instead. You might want to create a new user for testing using the GRANT command above, don't enter anything into the host or db tables as I suspect this is where things are fouled. -- Mike Registered Linux User #247123 It was all very well going about pure logic and how the universe was ruled by logic and the harmony of numbers, but the plain fact was that the disc was manifestly traversing space on the back of a giant turtle and the gods had a habit of going round to atheists' houses and smashing their windows. (Colour of Magic) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL problem -- new to PHP
Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL problem -- new to PHP
Looks like is to do with MySQL permissions. Check your host's (the one you are trying to connect from) permissions to the server. To change permissions, from the MySQL prompt type; GRANT ALL ON * TO username@host IDENTIFIED BY password; Substitute in username, host and password for your ones. Easier to use PHPMyAdmin or SQLYog (www.sqlyog.com) if you're new to it. I'm pretty new, so learning all the time. A couple of links to get you started; http://www.mysql.com/doc/en/GRANT.html http://www.mysql.com/doc/en/GRANT.html Good luck, Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 13:20 To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem -- new to PHP Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL problem -- new to PHP
PHPMyAdmin is just a web-based tool for administering MySQL and it's pretty intuitive, assuming you've used similar tools before. You can download it and read more here http://www.phpwizard.net/projects/phpMyAdmin/ I would recommend SQLYog as an alternative; http://www.webyog.com/sqlyog/index.html as it's VERY intuitive and pretty simple to use. But then you can't beat going straight into the MySQL prompt and learning from there Here are some good links for tutorials and examples; www.php.net and www.mysql.com for searching on specific functions - unless you have the memory of a few Cray computers ;o) http://www.evilwalrus.com http://www.zend.com/zend/tut/ http://www.devshed.com/Server_Side/MySQL/ http://www.devshed.com/Server_Side/PHP/ There are tons out there, but they are good starting points. Good luck, Nick -Original Message- From: Mark Loewenberg [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 14:01 To: Clarkson, Nick Subject: Re: [PHP-DB] MySQL problem -- new to PHP Well you opened up my question! Do you know where to learn PHPMyAdmin? Thanks in advance, Mark Clarkson, Nick wrote: Looks like is to do with MySQL permissions. Check your host's (the one you are trying to connect from) permissions to the server. To change permissions, from the MySQL prompt type; GRANT ALL ON * TO username@host IDENTIFIED BY password; Substitute in username, host and password for your ones. Easier to use PHPMyAdmin or SQLYog (www.sqlyog.com) if you're new to it. I'm pretty new, so learning all the time. A couple of links to get you started; http://www.mysql.com/doc/en/GRANT.html http://www.mysql.com/doc/en/GRANT.html Good luck, Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 13:20 To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem -- new to PHP Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- Mark Loewenberg 770 428 1071 [EMAIL PROTECTED] http://www.ITSbiz.net Affordable Website Design Website Hosting @ $9.95/month ITSbiz also provides: IT Solutions Phone Systems Phone Data Wiring Services This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL problem -- new to PHP
If you cut and pasted your code, try to put localhost into quotes as well. Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 7:20 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem -- new to PHP Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem -- new to PHP
When changing/adding permissions to the mysql db for specific users, dont forget to do 'flush privileges'... my 2 cents On Thu, 2003-02-13 at 07:19, Evan Morris wrote: Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- Mignon Hunter Web Developer Toshiba International 713.466.0277 x 3461 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL problem with RedHat 8
Hi! I'm trying to connect to my mysql database using something like mysql_connect( 'localhost', 'root', 'thepassword' ) or die ( 'Unable to connect to server.' ); But I get the error message: Fatal error: Call to undefined function: mysql_connect() in /home/daniel/public_html/index.php on line 21 I have: [root@p85 /]# rpm -qa |grep sql php-mysql-4.2.2-8.0.5 mysql-3.23.52-3 mysql-server-3.23.52-3 mysql-devel-3.23.52-3 and: [root@p85 /]# rpm -q php php-4.2.2-8.0.5 Someone mentioned these two settings in php.ini, which I tried with no success: register_globals = On short_open_tag = On phpinfo() says that php was compiled with '--with-mysql=shared,/usr' Can someone help me please? regards, -- Daniel Elenius [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql problem
Hello all! I am new to php and I am trying to update a mySQL table using php v4.2.3 for Windows. I am using the command: mysql_query(insert into tblquotehits (qoption,referer,browser,remoteaddr,dt) values ($quotetype,$referer,$browser,$remoteaddress,$currentdtstring),$db); I have read the documentation and found some notes on the topic but none seemed to solve my problem. I have tried other variations of the command such as inserting a semicolon at the end of the insert statement before the closing double quotes. All variables are defined and all columns are actually columns in the table ... I have checked all of this. I have also returned the result to a variable and echoed it to the screen ... the result printed is Resource id #2. This is driving me crazy as I know it must be something quite simple that I am overlooking. Any help is greatly appreciated! TIA Bill -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] mysql problem
Hi you need quotes around the values mysql_query(insert into tblquotehits (qoption,referer,browser,remoteaddr,dt) values ('$quotetype','$referer','$browser','$remoteaddress','$currentdtstring'),$d b); HTH Peter --- Excellence in internet and open source software --- Sunmaia Birmingham UK www.sunmaia.net tel. 0121-242-1473 International +44-121-242-1473 --- -Original Message- From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 22:56 To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql problem Hello all! I am new to php and I am trying to update a mySQL table using php v4.2.3 for Windows. I am using the command: mysql_query(insert into tblquotehits (qoption,referer,browser,remoteaddr,dt) values ($quotetype,$referer,$browser,$remoteaddress,$currentdtstring),$db); I have read the documentation and found some notes on the topic but none seemed to solve my problem. I have tried other variations of the command such as inserting a semicolon at the end of the insert statement before the closing double quotes. All variables are defined and all columns are actually columns in the table ... I have checked all of this. I have also returned the result to a variable and echoed it to the screen ... the result printed is Resource id #2. This is driving me crazy as I know it must be something quite simple that I am overlooking. Any help is greatly appreciated! TIA Bill -- 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] mysql problem
So what's the problem? The data doesn't appear in the table? Did you try to see if mysql_error() had anything in it after your query? ---John Holmes... -Original Message- From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 28, 2002 5:56 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql problem Hello all! I am new to php and I am trying to update a mySQL table using php v4.2.3 for Windows. I am using the command: mysql_query(insert into tblquotehits (qoption,referer,browser,remoteaddr,dt) values ($quotetype,$referer,$browser,$remoteaddress,$currentdtstring),$db); I have read the documentation and found some notes on the topic but none seemed to solve my problem. I have tried other variations of the command such as inserting a semicolon at the end of the insert statement before the closing double quotes. All variables are defined and all columns are actually columns in the table ... I have checked all of this. I have also returned the result to a variable and echoed it to the screen ... the result printed is Resource id #2. This is driving me crazy as I know it must be something quite simple that I am overlooking. Any help is greatly appreciated! TIA Bill -- 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
[PHP-DB] MySQL Problem
Hi, I have a problem with an MySQL statement that is driving me mad, I'm using php to connect to the database. this is it : - SELECT LINE,SUM(IF(MONTH=2,WB.TEU,0)) AS '2' ,SUM(IF(MONTH=3,WB.TEU,0)) AS '3' ,SUM(IF(MONTH=4,WB.TEU,0)) AS '4' ,SUM(IF(MONTH=5,WB.TEU,0)) AS '5' ,SUM(IF(MONTH=6,WB.TEU,0)) AS '6' ,SUM(IF(MONTH BETWEEN 2 AND 6,WB.TEU,0)) AS '2 TO 6' FROM WB WHERE EAST_PORT='A' AND WEST_PORT='B' GROUP BY LINE what I want to produce with this is this : - LINE2 3 4 5 6 2 TO 6 A 133511181260139512766384 B 432 469 451 480 555 2387 C 504 554 575 517 764 2914 however what I get is this : - LINE2 3 4 5 6 2 TO 6 A 111812601395127663846384 B 469 451 480 555 23872387 C 554 575 517 764 29142914 the last column of figures (2 TO 6) has been replicated under 6 and pushed the values that were in 6 into 5 and so on! I can not see for the life of me why this should or could be happening, especially as the equivalent code in MS Access : - SELECT LINE, Sum(IIf(MONTH=2,TEU,0)) AS ['2'], Sum(IIf(MONTH=3,TEU,0)) AS ['3'], Sum(IIf(MONTH=4,TEU,0)) AS ['4'], Sum(IIf(MONTH=5,TEU,0)) AS ['5'], Sum(IIf(MONTH=6,TEU,0)) AS ['6'], SUM(IIF(MONTH BETWEEN 2 AND 6,TEU,0)) AS 'FEB TO JUNE' , SUM(IIF(MONTH BETWEEN 1 AND 6,TEU,0)) AS 'YTD' FROM DUMP WHERE (((DUMP.[EAST PORT])='HONG KONG') AND ((DUMP.[WEST PORT])='UK')) GROUP BY DUMP.LINE; gives the correct results. If anyone has any idea of what is going on here please let me know, I'm hoping its something simple I'm missing.. Thanks Dan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL Problem
Maybe I'm missing something - but the MySQL statement looks right ... How are you displaying the results? -Original Message- From: Griffiths, Daniel [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 16:37 To: PHP List Subject: [PHP-DB] MySQL Problem Hi, I have a problem with an MySQL statement that is driving me mad, I'm using php to connect to the database. this is it : - SELECT LINE,SUM(IF(MONTH=2,WB.TEU,0)) AS '2' ,SUM(IF(MONTH=3,WB.TEU,0)) AS '3' ,SUM(IF(MONTH=4,WB.TEU,0)) AS '4' ,SUM(IF(MONTH=5,WB.TEU,0)) AS '5' ,SUM(IF(MONTH=6,WB.TEU,0)) AS '6' ,SUM(IF(MONTH BETWEEN 2 AND 6,WB.TEU,0)) AS '2 TO 6' FROM WB WHERE EAST_PORT='A' AND WEST_PORT='B' GROUP BY LINE what I want to produce with this is this : - LINE2 3 4 5 6 2 TO 6 A 133511181260139512766384 B 432 469 451 480 555 2387 C 504 554 575 517 764 2914 however what I get is this : - LINE2 3 4 5 6 2 TO 6 A 111812601395127663846384 B 469 451 480 555 23872387 C 554 575 517 764 29142914 the last column of figures (2 TO 6) has been replicated under 6 and pushed the values that were in 6 into 5 and so on! I can not see for the life of me why this should or could be happening, especially as the equivalent code in MS Access : - SELECT LINE, Sum(IIf(MONTH=2,TEU,0)) AS ['2'], Sum(IIf(MONTH=3,TEU,0)) AS ['3'], Sum(IIf(MONTH=4,TEU,0)) AS ['4'], Sum(IIf(MONTH=5,TEU,0)) AS ['5'], Sum(IIf(MONTH=6,TEU,0)) AS ['6'], SUM(IIF(MONTH BETWEEN 2 AND 6,TEU,0)) AS 'FEB TO JUNE' , SUM(IIF(MONTH BETWEEN 1 AND 6,TEU,0)) AS 'YTD' FROM DUMP WHERE (((DUMP.[EAST PORT])='HONG KONG') AND ((DUMP.[WEST PORT])='UK')) GROUP BY DUMP.LINE; gives the correct results. If anyone has any idea of what is going on here please let me know, I'm hoping its something simple I'm missing.. Thanks Dan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ This message has been checked for all known viruses by the MessageLabs Virus Control Centre. This message has been checked for all known viruses by the MessageLabs Virus Control Centre. * Notice: This email is confidential and may contain copyright material of Ocado Limited (the Company). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. Company reg. no. 3875000. Swallowdale Lane, Hemel Hempstead HP2 7PY * -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL Problem
the statement runs without errors, its just the output thats wrong (see the two tables) I'm displaying the results by doing a simple dump of the query, through my own code and have also tried through phpMyAdmin. -Original Message- From: Michael Hazelden [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 16:41 To: Griffiths, Daniel; PHP List Subject: RE: [PHP-DB] MySQL Problem Maybe I'm missing something - but the MySQL statement looks right ... How are you displaying the results? -Original Message- From: Griffiths, Daniel [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 16:37 To: PHP List Subject: [PHP-DB] MySQL Problem Hi, I have a problem with an MySQL statement that is driving me mad, I'm using php to connect to the database. this is it : - SELECT LINE,SUM(IF(MONTH=2,WB.TEU,0)) AS '2' ,SUM(IF(MONTH=3,WB.TEU,0)) AS '3' ,SUM(IF(MONTH=4,WB.TEU,0)) AS '4' ,SUM(IF(MONTH=5,WB.TEU,0)) AS '5' ,SUM(IF(MONTH=6,WB.TEU,0)) AS '6' ,SUM(IF(MONTH BETWEEN 2 AND 6,WB.TEU,0)) AS '2 TO 6' FROM WB WHERE EAST_PORT='A' AND WEST_PORT='B' GROUP BY LINE what I want to produce with this is this : - LINE2 3 4 5 6 2 TO 6 A 133511181260139512766384 B 432 469 451 480 555 2387 C 504 554 575 517 764 2914 however what I get is this : - LINE2 3 4 5 6 2 TO 6 A 111812601395127663846384 B 469 451 480 555 23872387 C 554 575 517 764 29142914 the last column of figures (2 TO 6) has been replicated under 6 and pushed the values that were in 6 into 5 and so on! I can not see for the life of me why this should or could be happening, especially as the equivalent code in MS Access : - SELECT LINE, Sum(IIf(MONTH=2,TEU,0)) AS ['2'], Sum(IIf(MONTH=3,TEU,0)) AS ['3'], Sum(IIf(MONTH=4,TEU,0)) AS ['4'], Sum(IIf(MONTH=5,TEU,0)) AS ['5'], Sum(IIf(MONTH=6,TEU,0)) AS ['6'], SUM(IIF(MONTH BETWEEN 2 AND 6,TEU,0)) AS 'FEB TO JUNE' , SUM(IIF(MONTH BETWEEN 1 AND 6,TEU,0)) AS 'YTD' FROM DUMP WHERE (((DUMP.[EAST PORT])='HONG KONG') AND ((DUMP.[WEST PORT])='UK')) GROUP BY DUMP.LINE; gives the correct results. If anyone has any idea of what is going on here please let me know, I'm hoping its something simple I'm missing.. Thanks Dan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ This message has been checked for all known viruses by the MessageLabs Virus Control Centre. This message has been checked for all known viruses by the MessageLabs Virus Control Centre. * Notice: This email is confidential and may contain copyright material of Ocado Limited (the Company). Opinions and views expressed in this message may not necessarily reflect the opinions and views of the Company. If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. Company reg. no. 3875000. Swallowdale Lane, Hemel Hempstead HP2 7PY * -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL Problem
Still think we need to see the PHP code before determining that it is an SQL problem. Regards, J -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 11:55 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL Problem On Friday 22 November 2002 00:46, Griffiths, Daniel wrote: the statement runs without errors, its just the output thats wrong (see the two tables) I'm displaying the results by doing a simple dump of the query, through my own code and have also tried through phpMyAdmin. Not sure if this could be the problem -- where are you getting MONTH from and does it start at 0 or 1? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I saw Lassie. It took me four shows to figure out why the hairy kid never spoke. I mean, he could roll over and all that, but did that deserve a series? */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL Problem
the month starts at 1, at the moment I'm just hard coding the month into the statment. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 16:55 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL Problem On Friday 22 November 2002 00:46, Griffiths, Daniel wrote: the statement runs without errors, its just the output thats wrong (see the two tables) I'm displaying the results by doing a simple dump of the query, through my own code and have also tried through phpMyAdmin. Not sure if this could be the problem -- where are you getting MONTH from and does it start at 0 or 1? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I saw Lassie. It took me four shows to figure out why the hairy kid never spoke. I mean, he could roll over and all that, but did that deserve a series? */ -- 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
[PHP-DB] MySql problem..............
Hi People. I need import some data from a Paradox table, i used the script below, it worked just fine..but all the data was imported without the ç or á or é , understand??? portuguese words all this changes to some wierd caracter is there a way to fix this, since my table is a Paradox 4 ANSI INTL850. am i fried?? ? $conexao = odbc_connect(rodrigo,,) or die(); $query = odbc_exec($conexao,Select * from clientes) or die(); include(link_db_pratic.php); $delete = mysql_query(delete from cli); while (odbc_fetch_row($query)) { $clirep = odbc_result($query,1); $clicod = odbc_result($query,2); $cliemp = odbc_result($query,3); $clinom = odbc_result($query,4); $cliend = odbc_result($query,5); $clitel = odbc_result($query,6); $clifax = odbc_result($query,8); $cliema = odbc_result($query,9); $clibai = odbc_result($query,10); $clicid = odbc_result($query,11); $cliest = odbc_result($query,12); $clicep = odbc_result($query,13); $cliins = odbc_result($query,14); $clifat = odbc_result($query,17); $clicgc = odbc_result($query,19); $clicta = odbc_result($query,21); $clilic = odbc_result($query,22); $clidia = odbc_result($query,25); echo$clirepbr; echo$clicodbr; $insert = mysql_query(INSERT INTO cli (clirep, clicod, cliemp, clinom, cliend, clitel, clifax, cliema, clibai, clicid, cliest, clicep, cliins,clifat, clicgc, clicta, clilic, clidia) VALUES('$clirep', '$clicod', '$cliemp', '$clinom', '$cliend', '$clitel', '$clifax', '$cliema', '$clibai', '$clicid', '$cliest', '$clicep', '$cliins', '$clifat', '$clicgc', '$clicta', '$clilic', '$clidia');); } ? Equipe Pratic Sistemas Rodrigo Corrêa Fone: (14) 441-1700 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [PHP-DB] MySQL problem on Yellow Dog Linux
Woo-hoo! Fixing the extensions directory worked. I am now all set with MySQL support ... Thanks for all the help! -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem on Yellow Dog Linux
On Saturday 08 June 2002 05:29, Garrett Nelson wrote: I now downloaded php-mysql-4.1.2-1a.ppc.rpm from rpmfinder, and again I get rpm -ivh php-mysql* Preparing...### [100%] package php-mysql-4.1.2-1a is already installed (Same error with -Uvh, too) So I suppose it's something else. Do I have to uninstall PHP first? Or, again, could it be something wrong with the PHP configs? Is php.ini the only config file that might need to be edited? Check in your httpd.conf file that you have these lines: LoadModule php4_modulemodules/libphp4.so AddModule mod_php4.c -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* To err is human, to moo bovine. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem on Yellow Dog Linux
On Saturday 08 June 2002 23:20, Garrett Nelson wrote: I have both the lines in httpd.conf. As I said, PHP is working fine, it's just an issue with MySQL support I believe. Sorry my mistake. Check in php.ini for this line: extension=mysql.so -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A tautology is a thing which is tautological. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem on Yellow Dog Linux
On Sunday 09 June 2002 01:28, Garrett Nelson wrote: Well, we're getting closer now, maybe. I added the line extension=mysql.so, and I still get the same error when trying to run the web-based PHP apps, but in the command line when I type php I get back, PHP Warning: Unable to load dynamic library './mysql.so' - ./mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Does that help at all in identifying what may be wrong? In php.ini check/add the line extension_dir = /path/to/directory/containing-mysql.so -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Euch ist becannt, was wir beduerfen; Wir wollen stark Getraenke schluerfen. -- Goethe, Faust */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem on Yellow Dog Linux
On 6/6/02 4:48 PM, Jason Wong [EMAIL PROTECTED] wrote: On Friday 07 June 2002 04:36, Garrett Nelson wrote: I'm a relative newbie to the Linux/web server world, having worked with Macs most of my life. I recently installed the Server install of Yellow Dog Linux, with no window managers, CLI only. Everything is working pretty much correctly, except PHP interaction with MySQL. When I tried to install Invision Board, I got the following error Fatal error: Call to undefined function: mysql_connect() in /var/www/default/forums/sm_install.php on line 249 It means there's no support in php for mysql I figured this meant MySQL or PHP was configured incorrectly so I installed PhpMyAdmin to see if that would work, and I got the error message cannot load MySQL extension, please check PHP Configuration. ditto What needs to be configured? I was under the impression that MySQL support was built into PHP now and that it needs no extension. Yes and no. PHP has 'builtin' support for MySQL but it needs to be enabled at compile time. I downloaded the RPM of PHP 4.1.2 (the latest PPC RPM available at rpmfind) and it told me it was already installed. I then installed MySQL 3.23.41 to no effect. So what can I do to fix this? Try looking for an RPM with both 'php' and 'mysql' in its name. Eg for Redhat a suitable rpm would be named: php-mysql-4.1.2-7.i386.rpm. Hrm I now downloaded php-mysql-4.1.2-1a.ppc.rpm from rpmfinder, and again I get rpm -ivh php-mysql* Preparing...### [100%] package php-mysql-4.1.2-1a is already installed (Same error with -Uvh, too) So I suppose it's something else. Do I have to uninstall PHP first? Or, again, could it be something wrong with the PHP configs? Is php.ini the only config file that might need to be edited? -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL problem on Yellow Dog Linux
I'm a relative newbie to the Linux/web server world, having worked with Macs most of my life. I recently installed the Server install of Yellow Dog Linux, with no window managers, CLI only. Everything is working pretty much correctly, except PHP interaction with MySQL. When I tried to install Invision Board, I got the following error Fatal error: Call to undefined function: mysql_connect() in /var/www/default/forums/sm_install.php on line 249 I figured this meant MySQL or PHP was configured incorrectly so I installed PhpMyAdmin to see if that would work, and I got the error message cannot load MySQL extension, please check PHP Configuration. What needs to be configured? I was under the impression that MySQL support was built into PHP now and that it needs no extension. I downloaded the RPM of PHP 4.1.2 (the latest PPC RPM available at rpmfind) and it told me it was already installed. I then installed MySQL 3.23.41 to no effect. So what can I do to fix this? -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem on Yellow Dog Linux
on 6/6/02 4:36 PM, Garrett Nelson at [EMAIL PROTECTED] appended the following bits to my mbox: What needs to be configured? I was under the impression that MySQL support was built into PHP now and that it needs no extension. I downloaded the RPM of PHP 4.1.2 (the latest PPC RPM available at rpmfind) and it told me it was already installed. I then installed MySQL 3.23.41 to no effect. Well, the MySQL library comes bundled with PHP, but to actually build in support, you need to configure it with --with-MySQL. I'm not a big RPM guy, but you should probably look for an RPM for PHP that mentions MySQL as well. HTH. Sincerely, Paul Burney http://paulburney.com/ ?php // the statement formerly known as prince if ($the_elevator == 'tries to bring you down') { go_crazy('punch a higher floor'); } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL Problem
Hi, i've a problem with MySQL in my PHP pages. My PHP version is 4.0.1 i think. it's been installed with Redhat Linux 7.2 with default MySQL support. (I've verified it). when i want to connect to my sample MySQL database, it give me error : Call to undifined function mysql_connect with all MySQL functions, i've the same error. what's problem? and what i can do? please somebody help me. Many thanks, Alan mail2web - Check your email from the web at http://mail2web.com/ . -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL Problem
That means PHP is not compiled with the MySQL support... Configure it with mysql support, I bbelieve there were a lot of questions about this in the list, so you may wanna search the archives.. Gurhan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 8:49 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL Problem Hi, i've a problem with MySQL in my PHP pages. My PHP version is 4.0.1 i think. it's been installed with Redhat Linux 7.2 with default MySQL support. (I've verified it). when i want to connect to my sample MySQL database, it give me error : Call to undifined function mysql_connect with all MySQL functions, i've the same error. what's problem? and what i can do? please somebody help me. Many thanks, Alan mail2web - Check your email from the web at http://mail2web.com/ . -- 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
[PHP-DB] MySQL problem
I keep on getting this error statement: Warning: Supplied argument is not a valid MySQL result resource in /usr/local/www/data/phone/insert2.php on line 10 2 Can someone tell me what is wrong with the code below, I just cannot figure it out... Thank you very much in advance. I am using php4. html ? session_start(); include(info.inc.php); mysql_connect($host,$user,$pass) || die(mysql_error()); mysql_select_db($db) || die(mysql_error()); $q = mysql_query(SELECT FName, LName FROM user_info WHERE (FName='$FName' LName='$LName')) || die(1); $view = mysql_fetch_array($q) || die(2); ? ?=$view[0]? /html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem
On Fri, 2002-02-22 at 09:37, Caleb Walker wrote: I keep on getting this error statement: Warning: Supplied argument is not a valid MySQL result resource in /usr/local/www/data/phone/insert2.php on line 10 2 Can someone tell me what is wrong with the code below, I just cannot figure it out... Thank you very much in advance. I am using php4. html ? session_start(); include(info.inc.php); mysql_connect($host,$user,$pass) || die(mysql_error()); mysql_select_db($db) || die(mysql_error()); $q = mysql_query(SELECT FName, LName FROM user_info WHERE (FName='$FName' LName='$LName')) || die(1); Try this out: $q = mysql_query(SELECT FName, LName FROM user_info WHERE (FName='$FName' LName='$LName'),$db) || die(1); ^^^ It might help. Or it might not :) Cheers, Markus -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL - Problem with multiple INSERTs?
I did change the id fields from TINYINT to INT (that was just a careless error), and fixed something else. But I still have the same problems. The new table schemas are below, along with the queries that don't work. I'd love for someone to reproduce the error. As a possible workaround, everything seems to be fine when I prime the tables by adding a record; they only seem to have a problem when the tables are empty. Thanks, Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id int(11) NOT NULL auto_increment, idProject int(11) DEFAULT '0' NOT NULL, idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) );
Re: [PHP-DB] MySQL - Problem with multiple INSERTs?
Try this changes: $con_id = mysql_connect("localhost", "myusername", "mypassword"); if($con_id){ mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (0, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (0, 'sysmsg9.txt', 'Some file')"); } else echo("Connection failed"); -Mensagem Original- De: Chris [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 6 de maro de 2001 16:13 Assunto: Re: [PHP-DB] MySQL - Problem with multiple INSERTs? I did change the id fields from TINYINT to INT (that was just a careless error), and fixed something else. But I still have the same problems. The new table schemas are below, along with the queries that don't work. I'd love for someone to reproduce the error. As a possible workaround, everything seems to be fine when I prime the tables by adding a record; they only seem to have a problem when the tables are empty. Thanks, Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id int(11) NOT NULL auto_increment, idProject int(11) DEFAULT '0' NOT NULL, idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL - Problem with multiple INSERTs?
Have you put an echo with mysql_error() after performing each query ? Jayme. -Mensagem Original- De: Chris [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: segunda-feira, 5 de maro de 2001 05:04 Assunto: [PHP-DB] MySQL - Problem with multiple INSERTs? Howdy, I'm getting weird problems trying to INSERT to two different tables, in consecutive mysql_queries. Before, I had 3 queries going, and only 2 would work at any time. It seemed like it was 'rotating' the bad query - first the 1st query would fail (the other two were fine), then I'd empty all my tables and refresh, and this time the 2nd query was the problem, and if I did it again the 3rd was. All queries worked fine in phpMyAdmin, both individually and when executed en masse. I've boiled it down to just two queries that don't work. I've included everything below (including table schemata), to enable reproduction. It seems like a bug to me - the question is, is the bug in PHP, MySQL, or my brain? This is driving me CRAZY - Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id tinyint(4) NOT NULL auto_increment, idProject tinyint(4) DEFAULT '0' NOT NULL, name tinyint(4) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); (P.S. I've tried things like using SET syntax, using mysql_query instead of mysql_db_query, etc. Nothing helps.) -- 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] MySQL - Problem with multiple INSERTs?
Howdy, I'm getting weird problems trying to INSERT to two different tables, in consecutive mysql_queries. Before, I had 3 queries going, and only 2 would work at any time. It seemed like it was 'rotating' the bad query - first the 1st query would fail (the other two were fine), then I'd empty all my tables and refresh, and this time the 2nd query was the problem, and if I did it again the 3rd was. All queries worked fine in phpMyAdmin, both individually and when executed en masse. I've boiled it down to just two queries that don't work. I've included everything below (including table schemata), to enable reproduction. It seems like a bug to me - the question is, is the bug in PHP, MySQL, or my brain? This is driving me CRAZY - Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id tinyint(4) NOT NULL auto_increment, idProject tinyint(4) DEFAULT '0' NOT NULL, name tinyint(4) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); (P.S. I've tried things like using SET syntax, using mysql_query instead of mysql_db_query, etc. Nothing helps.)