Re: [PHP-DB] Newbie with mail problem
Use a real hostname, not 'localhost'.- -- Atte, Andrés G. Montañez Técnico en Redes y Telecomunicaciones Montevideo - Uruguay -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Cannot connect to local MySQL -- Client does not support authentication protocol
I am trying to set up my laptop to run PHP and MySQL together.My system summary is:Win 2000 (localhost)PHP 4.3.11MySQL Server 4.1.12MySQL Client 5.0.0MySQL Admin 1.0.9I can connect to my local MySQL host using MySQL client tools.I can connect to a remote MySQL server (don't know the exact version) from PHP in a very simple connect/select template.But I cannot connect to my local MySQL Server from my local PHP installation.Using phpMyAdmin version 2.2.7-pl1, the error message is:MySQL said: Client does not support authentication protocol requested by server; consider upgrading MySQL clientPHP BB gives a similar message:Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\inetpub\wwwroot\phpbb2\db\mysql4.php on line 48Can anyone suggest how to solve this problem? I've spent the better part of every evening for th epast week trying to get PHP and MySQL to work...I'm at wits end.ThanksScott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: [PHP-DB] Cannot connect to local MySQL -- Client does not support authentication protocol
MySQL's instructions, while 'clear'(upgrade the client library), don't tell you where to get the damn library. If anyone has a link to the new mysql client libraries, I'd appreciate it. I tend to simply downgrade the password string to the old 16bit style run this command: SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); Bastien From: Scott Powell [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Cannot connect to local MySQL -- Client does not support authentication protocol Date: Tue, 7 Jun 2005 07:43:23 -0700 (PDT) I am trying to set up my laptop to run PHP and MySQL together.My system summary is:Win 2000 (localhost)PHP 4.3.11MySQL Server 4.1.12MySQL Client 5.0.0MySQL Admin 1.0.9I can connect to my local MySQL host using MySQL client tools.I can connect to a remote MySQL server (don't know the exact version) from PHP in a very simple connect/select template.But I cannot connect to my local MySQL Server from my local PHP installation.Using phpMyAdmin version 2.2.7-pl1, the error message is:MySQL said: Client does not support authentication protocol requested by server; consider upgrading MySQL clientPHP BB gives a similar message:Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\inetpub\wwwroot\phpbb2\db\mysql4.php on line 48Can anyone suggest how to solve this problem? I've spent the better part of every evening for th epast week trying to get PHP and MySQL to work...I'm at wits end.ThanksScott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Cannot connect to local MySQL -- Client does not support authentication protocol
I tried the use old passwords flag in the my.ini file. That has completely crashed out the Admin GUI (GPF writing to ntdll.dll) and not corrected the problem. I'll try this too. Bastien Koert [EMAIL PROTECTED] wrote: MySQL's instructions, while 'clear'(upgrade the client library), don't tell you where to get the damn library. If anyone has a link to the new mysql client libraries, I'd appreciate it. I tend to simply downgrade the password string to the old 16bit style run this command: SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); Bastien From: Scott Powell To: php-db@lists.php.net Subject: [PHP-DB] Cannot connect to local MySQL -- Client does not support authentication protocol Date: Tue, 7 Jun 2005 07:43:23 -0700 (PDT) I am trying to set up my laptop to run PHP and MySQL together.My system summary is:Win 2000 (localhost)PHP 4.3.11MySQL Server 4.1.12MySQL Client 5.0.0MySQL Admin 1.0.9I can connect to my local MySQL host using MySQL client tools.I can connect to a remote MySQL server (don't know the exact version) from PHP in a very simple connect/select template.But I cannot connect to my local MySQL Server from my local PHP installation.Using phpMyAdmin version 2.2.7-pl1, the error message is:MySQL said: Client does not support authentication protocol requested by server; consider upgrading MySQL clientPHP BB gives a similar message:Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\inetpub\wwwroot\phpbb2\db\mysql4.php on line 48Can anyone suggest how to solve this problem? I've spent the better part of every evening for th epast week trying to get PHP and MySQL to work...I'm at wits end.ThanksScott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[PHP-DB] Re: Cannot connect to local MySQL -- Client does not support authentication protocol
I think it is not just a matter of upgrading the library. You can get it if I remember well from the source distribution of MySql. The problem is that PHP comes pre-compiled with the older MySql client version so you would need recompile PHP. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Newbie with mail problem
Andrés G. Montañez [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Use a real hostname, not 'localhost'.- Will give that a try. Thank you. -- Atte, Andrés G. Montañez Técnico en Redes y Telecomunicaciones Montevideo - Uruguay -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] User Auth and More...
Good Day! I am trying to create a page that will start off asking for a username and password, verify the entry against a MySQL database, and depending on what the access level is in the table, so one of five or six files on a page for downloading. I have the login script working for another purpose, but I can't seem to get it to work for me here. Any thoughts on a direction I should go? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] User Auth and More...
Yeah, I could give directions, but you won't like them ;-) Better to post a more accurate decription of what is(n't) working and perhaps some code. The words 'but I can't seem to get it to work for me here' just doesn't help much Bastien From: Chase [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] User Auth and More... Date: Tue, 7 Jun 2005 12:09:57 -0600 Good Day! I am trying to create a page that will start off asking for a username and password, verify the entry against a MySQL database, and depending on what the access level is in the table, so one of five or six files on a page for downloading. I have the login script working for another purpose, but I can't seem to get it to work for me here. Any thoughts on a direction I should go? Thanks! -- 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] Can someone help me out?
I am having a problem getting a sql statement to run. I have this in a table called stat_categories, in a field called sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc limit '$display' when I try to display this I get this error: 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 ''$display'' at line 8 I tried removing the s but this didnt help. If I put in the sql instead of the variable, it works fine. What am I doing wrong? Any help would be greatly appreciated. Thanks -Rich
RE: [PHP-DB] Can someone help me out?
Jason, After looking at this a little more, the variable aren't being changed into their value. The echo looks like this: select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = $pos and b.year = $year and a.team_div = $div group by a.name order by Results desc limit '$display' As you can see the variables aren't being changed, any ideas? Thanks -Rich -Original Message- From: Jason Walker [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 6:54 PM To: 'ReClMaples' Subject: RE: [PHP-DB] Can someone help me out? In your PHP page, can you echo the actual query variable to the browser and send that to the mail group? I don't necessary see anything 'wrong' with your query but see the three variables, as they are interpreted by PHP, may help. Thanks, -Original Message- From: ReClMaples [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 4:05 PM To: PHP Subject: [PHP-DB] Can someone help me out? I am having a problem getting a sql statement to run. I have this in a table called stat_categories, in a field called sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc limit '$display' when I try to display this I get this error: 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 ''$display'' at line 8 I tried removing the ''s but this didn't help. If I put in the sql instead of the variable, it works fine. What am I doing wrong? Any help would be greatly appreciated. Thanks -Rich -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.6.5 - Release Date: 6/7/2005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Can someone help me out?
Is your query wrapped in single quotes, instead of double quotes? Variable expansion, of course, doesn't occur under single quotes. :) ReClMaples wrote: I am having a problem getting a sql statement to run. I have this in a table called stat_categories, in a field called sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc limit '$display' when I try to display this I get this error: 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 ''$display'' at line 8 I tried removing the s but this didnt help. If I put in the sql instead of the variable, it works fine. What am I doing wrong? Any help would be greatly appreciated. Thanks -Rich -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Can someone help me out?
can you show the code around it? are you using single quotes in defining the sql statement? or double quotes? Bastien From: ReClMaples [EMAIL PROTECTED] To: Jason Walker [EMAIL PROTECTED] CC: PHP php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? Date: Tue, 7 Jun 2005 19:00:59 -0500 Jason, After looking at this a little more, the variable aren't being changed into their value. The echo looks like this: select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = $pos and b.year = $year and a.team_div = $div group by a.name order by Results desc limit '$display' As you can see the variables aren't being changed, any ideas? Thanks -Rich -Original Message- From: Jason Walker [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 6:54 PM To: 'ReClMaples' Subject: RE: [PHP-DB] Can someone help me out? In your PHP page, can you echo the actual query variable to the browser and send that to the mail group? I don't necessary see anything 'wrong' with your query but see the three variables, as they are interpreted by PHP, may help. Thanks, -Original Message- From: ReClMaples [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 4:05 PM To: PHP Subject: [PHP-DB] Can someone help me out? I am having a problem getting a sql statement to run. I have this in a table called stat_categories, in a field called sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc limit '$display' when I try to display this I get this error: 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 ''$display'' at line 8 I tried removing the ''s but this didn't help. If I put in the sql instead of the variable, it works fine. What am I doing wrong? Any help would be greatly appreciated. Thanks -Rich -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.6.5 - Release Date: 6/7/2005 -- 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] Can someone help me out?
All, Here is the code that I'm using. I have a form that feeds that top values to this page: ?php $pos = $_POST['sel_pos_name']; $year = $_POST['sel_year_name']; $cat_name = $_POST['sel_cat_name']; $display = $_POST['display']; $div = $_POST['Div']; //MySql and Database Connection $conn = mysql_connect(, , ) or die(mysql_error()); mysql_select_db(,$conn) or die(mysql_error()); //Gets the id,cat_name,sql1 field sql2 field and cat_descript from the table $get_cat_info = select Id,Cat_Name,Cat_Descript,sql1,sql2 from stat_categories where Cat_Name = '$cat_name'; $get_cat_info_res = mysql_query($get_cat_info) or die(mysql_error()); while ($recss = mysql_fetch_array($get_cat_info_res)) { $id = $recss['Id']; $cat_name1 = $recss['Cat_Name']; $cat_descript = $recss['Cat_Descript']; $sql1 = $recss['sql1']; $sql2 = $recss['sql2']; } //Displays the top of the table echo bResults for $cat_name/b; echo table border='1' cellpadding='1' cellspacing='1'; echo tr; echo td bgcolor=\#C0C0C0\centerbPlayer Name/b/center/td; echo td bgcolor=\#C0C0C0\centerbPosition/b/center/td; echo td bgcolor=\#C0C0C0\centerbTeam/b/center/td; echo td bgcolor=\#C0C0C0\centerb$cat_descript/b/center/td; echo /tr; if ($div == 'NFL') { //sql2 $get_results = $sql2 limit $display; //echo $get_results; $get_results_res = mysql_query($get_results) or die(mysql_error()); while ($res = mysql_fetch_array($get_results_res)) { $player_name = $res['name']; $position = $res['position']; $team = $res['team']; $Results = $res['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } else { //sql1 $get_resultss = $sql1 limit $display; echo $get_results1; $get_results_res1 = mysql_query($get_results1) or die(mysql_error()); while ($res1 = mysql_fetch_array($get_results_res1)) { $player_name = $res1['name']; $position = $res1['position']; $team = $res1['team']; $Results = $res1['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } ? There are no functions and I'm using double quotes. In my table. I have two fields sql1 and sql2. Here are the values in each of the fields: Sql1 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' and a.team_div = '$div' group by a.name order by Results desc Sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc I'm stumped. I have tested each variable and they all come back, except in the variables sql1 and sql2. Thanks -Rich -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 7:21 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? can you show the code around it? are you using single quotes in defining the sql statement? or double quotes? Bastien From: ReClMaples [EMAIL PROTECTED] To: Jason Walker [EMAIL PROTECTED] CC: PHP php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? Date: Tue, 7 Jun 2005 19:00:59 -0500 Jason, After looking at this a little more, the variable aren't being changed into their value. The echo looks like this: select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = $pos and b.year = $year and a.team_div = $div group by a.name order by Results desc limit '$display' As you can see the variables aren't being changed, any ideas? Thanks -Rich -Original Message- From: Jason Walker [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 6:54 PM To: 'ReClMaples' Subject: RE: [PHP-DB] Can someone help me out? In your PHP page, can you echo the actual query variable to the browser and send that to the mail group? I don't necessary see anything 'wrong' with your query but see the three variables, as they are interpreted by PHP, may help. Thanks, -Original Message- From: ReClMaples [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 4:05 PM To: PHP Subject: [PHP-DB] Can someone help me out? I am having a problem getting a sql statement to run. I have this in a table called stat_categories, in a field called sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num =
RE: [PHP-DB] Can someone help me out?
The default for limit starts at one, so you don't need the two variables. My issue is with the variables not putting their value in. Thanks -Rich -Original Message- From: Isidor Stankov [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 7:56 PM To: ReClMaples Subject: Re: [PHP-DB] Can someone help me out? error is in $limit !!! you need to limit by two variables, starting and how many entities you want to get, for exampe LIMIT '$beggining', '$howmany' Best regards Isidor stankov - Original Message - From: ReClMaples [EMAIL PROTECTED] To: PHP php-db@lists.php.net Sent: Wednesday, June 08, 2005 1:04 AM Subject: [PHP-DB] Can someone help me out? I am having a problem getting a sql statement to run. I have this in a table called stat_categories, in a field called sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc limit '$display' when I try to display this I get this error: 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 ''$display'' at line 8 I tried removing the ''s but this didn't help. If I put in the sql instead of the variable, it works fine. What am I doing wrong? Any help would be greatly appreciated. Thanks -Rich -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Can someone help me out?
eval($recss[sql1]).. variables inside a string have to be expanded manually, since you're storing the variable names inside the DB, you have to manually pull them out.. Sorry for not catching this earlier, I didn't realize the query itself was stored in the DB. ReClMaples wrote: All, Here is the code that I'm using. I have a form that feeds that top values to this page: ?php $pos = $_POST['sel_pos_name']; $year = $_POST['sel_year_name']; $cat_name = $_POST['sel_cat_name']; $display = $_POST['display']; $div = $_POST['Div']; //MySql and Database Connection $conn = mysql_connect(, , ) or die(mysql_error()); mysql_select_db(,$conn) or die(mysql_error()); //Gets the id,cat_name,sql1 field sql2 field and cat_descript from the table $get_cat_info = select Id,Cat_Name,Cat_Descript,sql1,sql2 from stat_categories where Cat_Name = '$cat_name'; $get_cat_info_res = mysql_query($get_cat_info) or die(mysql_error()); while ($recss = mysql_fetch_array($get_cat_info_res)) { $id = $recss['Id']; $cat_name1 = $recss['Cat_Name']; $cat_descript = $recss['Cat_Descript']; $sql1 = $recss['sql1']; $sql2 = $recss['sql2']; } //Displays the top of the table echo bResults for $cat_name/b; echo table border='1' cellpadding='1' cellspacing='1'; echo tr; echo td bgcolor=\#C0C0C0\centerbPlayer Name/b/center/td; echo td bgcolor=\#C0C0C0\centerbPosition/b/center/td; echo td bgcolor=\#C0C0C0\centerbTeam/b/center/td; echo td bgcolor=\#C0C0C0\centerb$cat_descript/b/center/td; echo /tr; if ($div == 'NFL') { //sql2 $get_results = $sql2 limit $display; //echo $get_results; $get_results_res = mysql_query($get_results) or die(mysql_error()); while ($res = mysql_fetch_array($get_results_res)) { $player_name = $res['name']; $position = $res['position']; $team = $res['team']; $Results = $res['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } else { //sql1 $get_resultss = $sql1 limit $display; echo $get_results1; $get_results_res1 = mysql_query($get_results1) or die(mysql_error()); while ($res1 = mysql_fetch_array($get_results_res1)) { $player_name = $res1['name']; $position = $res1['position']; $team = $res1['team']; $Results = $res1['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } ? There are no functions and I'm using double quotes. In my table. I have two fields sql1 and sql2. Here are the values in each of the fields: Sql1 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' and a.team_div = '$div' group by a.name order by Results desc Sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc I'm stumped. I have tested each variable and they all come back, except in the variables sql1 and sql2. Thanks -Rich -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 7:21 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? can you show the code around it? are you using single quotes in defining the sql statement? or double quotes? Bastien From: ReClMaples [EMAIL PROTECTED] To: Jason Walker [EMAIL PROTECTED] CC: PHP php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? Date: Tue, 7 Jun 2005 19:00:59 -0500 Jason, After looking at this a little more, the variable aren't being changed into their value. The echo looks like this: select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = $pos and b.year = $year and a.team_div = $div group by a.name order by Results desc limit '$display' As you can see the variables aren't being changed, any ideas? Thanks -Rich -Original Message- From: Jason Walker [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 6:54 PM To: 'ReClMaples' Subject: RE: [PHP-DB] Can someone help me out? In your PHP page, can you echo the actual query variable to the browser and send that to the mail group? I don't necessary see anything 'wrong' with your query but see the three variables, as they are interpreted by PHP, may help. Thanks, -Original Message- From: ReClMaples [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 4:05 PM To:
RE: [PHP-DB] Can someone help me out?
This makes sense but I can't figure out how it should look in the field, can you help? Here is what I currently have: select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc limit '$display' when I run it like this, I get this in my web server error log: PHP Parse error: parse error in Off_Stat_Leaders.php(35) : eval()'d code on line 1, referer: Offensive_Stat_Search.php Any ideas? Thanks -Rich -Original Message- From: Brad Webb [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 8:37 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Can someone help me out? eval($recss[sql1]).. variables inside a string have to be expanded manually, since you're storing the variable names inside the DB, you have to manually pull them out.. Sorry for not catching this earlier, I didn't realize the query itself was stored in the DB. ReClMaples wrote: All, Here is the code that I'm using. I have a form that feeds that top values to this page: ?php $pos = $_POST['sel_pos_name']; $year = $_POST['sel_year_name']; $cat_name = $_POST['sel_cat_name']; $display = $_POST['display']; $div = $_POST['Div']; //MySql and Database Connection $conn = mysql_connect(, , ) or die(mysql_error()); mysql_select_db(,$conn) or die(mysql_error()); //Gets the id,cat_name,sql1 field sql2 field and cat_descript from the table $get_cat_info = select Id,Cat_Name,Cat_Descript,sql1,sql2 from stat_categories where Cat_Name = '$cat_name'; $get_cat_info_res = mysql_query($get_cat_info) or die(mysql_error()); while ($recss = mysql_fetch_array($get_cat_info_res)) { $id = $recss['Id']; $cat_name1 = $recss['Cat_Name']; $cat_descript = $recss['Cat_Descript']; $sql1 = $recss['sql1']; $sql2 = $recss['sql2']; } //Displays the top of the table echo bResults for $cat_name/b; echo table border='1' cellpadding='1' cellspacing='1'; echo tr; echo td bgcolor=\#C0C0C0\centerbPlayer Name/b/center/td; echo td bgcolor=\#C0C0C0\centerbPosition/b/center/td; echo td bgcolor=\#C0C0C0\centerbTeam/b/center/td; echo td bgcolor=\#C0C0C0\centerb$cat_descript/b/center/td; echo /tr; if ($div == 'NFL') { //sql2 $get_results = $sql2 limit $display; //echo $get_results; $get_results_res = mysql_query($get_results) or die(mysql_error()); while ($res = mysql_fetch_array($get_results_res)) { $player_name = $res['name']; $position = $res['position']; $team = $res['team']; $Results = $res['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } else { //sql1 $get_resultss = $sql1 limit $display; echo $get_results1; $get_results_res1 = mysql_query($get_results1) or die(mysql_error()); while ($res1 = mysql_fetch_array($get_results_res1)) { $player_name = $res1['name']; $position = $res1['position']; $team = $res1['team']; $Results = $res1['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } ? There are no functions and I'm using double quotes. In my table. I have two fields sql1 and sql2. Here are the values in each of the fields: Sql1 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' and a.team_div = '$div' group by a.name order by Results desc Sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc I'm stumped. I have tested each variable and they all come back, except in the variables sql1 and sql2. Thanks -Rich -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 7:21 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? can you show the code around it? are you using single quotes in defining the sql statement? or double quotes? Bastien From: ReClMaples [EMAIL PROTECTED] To: Jason Walker [EMAIL PROTECTED] CC: PHP php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? Date: Tue, 7 Jun 2005 19:00:59 -0500 Jason, After looking at this a little more, the variable aren't being changed into their value. The echo looks like this: select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = $pos
[PHP-DB] Re: sybase_connect(): Sybae:Unable to allocate connection record
Philip Washington wrote: I think that after installation the system needed to be rebooted so that the apache user could see the new environment variables. After further review it appears that the problem was caused by permissions on the /opt/sybase directory. Originally it was set up and had a permission of 700. After being moved and copied the permisions were changed to 755. This appears to have been the problem. Philip Wasshington wrote: After installing php-4.3.9-3.6.src.rpm on RHEL4 I modified the php.spec file to add --with-sybase-ct=/opt/sybase/OCS-12_5 Everything appeared to compile fine but after update installing the rpms I get the error 'Warning: sybase_connect(): Sybase:Unable to allocate connection record.' when attempting to run code. I have done this before on RHEL3 and did not run into this problem. The server is running fine and I can use isql from this server and connect to SYBASESR %configure \ --cache-file=../config.cache \ --with-config-file-path=%{_sysconfdir} \ --with-config-file-scan-dir=%{_sysconfdir}/php.d \ --enable-force-cgi-redirect \ --disable-debug \ --enable-pic \ --disable-rpath \ --enable-inline-optimization \ --with-bz2 \ --with-db4=%{_prefix} \ --with-curl \ --with-exec-dir=%{_bindir} \ --with-freetype-dir=%{_prefix} \ --with-png-dir=%{_prefix} \ --with-gd=shared \ --enable-gd-native-ttf \ --without-gdbm \ --with-gettext \ --with-ncurses=shared \ --with-gmp \ --with-iconv \ --with-jpeg-dir=%{_prefix} \ --with-openssl \ --with-png \ --with-pspell \ --with-xml \ --with-expat-dir=%{_prefix} \ --with-dom=shared,%{_prefix} \ --with-dom-xslt=%{_prefix} --with-dom-exslt=%{_prefix} \ --with-xmlrpc=shared \ --with-pcre-regex=%{_prefix} \ --with-zlib \ --with-layout=GNU \ --enable-bcmath \ --enable-exif \ --enable-ftp \ --enable-magic-quotes \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-track-vars \ --enable-trans-sid \ --enable-yp \ --enable-wddx \ --with-pear=/usr/share/pear \ --with-imap=shared --with-imap-ssl \ --with-kerberos \ --with-ldap=shared \ --with-mysql=shared,%{_prefix} \ %{?_with_oci8:--with-oci8-instant-client=shared} \ %{?_with_mssql:--with-mssql=shared} \ %{?_with_mhash:--with-mhash=shared} \ --with-pgsql=shared \ --with-snmp=shared,%{_prefix} \ --with-snmp=shared \ --enable-ucd-snmp-hack \ --with-unixODBC=shared,%{_prefix} \ --with-sybase-ct=/opt/sybase/OCS-12_5 \ --enable-memory-limit \ --enable-shmop \ --enable-calendar \ --enable-dbx \ --enable-dio \ --enable-mbstring=shared --enable-mbstr-enc-trans \ --enable-mbregex \ --with-mime-magic=%{_datadir}/file/magic.mime \ $* || tail -300 config.log script: $server=SYBASESR; $user=sa; $pass=; $con =sybase_connect($server,$user, $pass); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Can someone help me out?
ReClMaples wrote: All, Here is the code that I'm using. I have a form that feeds that top values to this page: ?php $pos = $_POST['sel_pos_name']; $year = $_POST['sel_year_name']; $cat_name = $_POST['sel_cat_name']; $display = $_POST['display']; $div = $_POST['Div']; //MySql and Database Connection $conn = mysql_connect(, , ) or die(mysql_error()); mysql_select_db(,$conn) or die(mysql_error()); //Gets the id,cat_name,sql1 field sql2 field and cat_descript from the table $get_cat_info = select Id,Cat_Name,Cat_Descript,sql1,sql2 from stat_categories where Cat_Name = '$cat_name'; $get_cat_info_res = mysql_query($get_cat_info) or die(mysql_error()); while ($recss = mysql_fetch_array($get_cat_info_res)) { $id = $recss['Id']; $cat_name1 = $recss['Cat_Name']; $cat_descript = $recss['Cat_Descript']; $sql1 = $recss['sql1']; $sql2 = $recss['sql2']; } //Displays the top of the table echo bResults for $cat_name/b; echo table border='1' cellpadding='1' cellspacing='1'; echo tr; echo td bgcolor=\#C0C0C0\centerbPlayer Name/b/center/td; echo td bgcolor=\#C0C0C0\centerbPosition/b/center/td; echo td bgcolor=\#C0C0C0\centerbTeam/b/center/td; echo td bgcolor=\#C0C0C0\centerb$cat_descript/b/center/td; echo /tr; if ($div == 'NFL') { //sql2 $get_results = $sql2 limit $display; //echo $get_results; $get_results_res = mysql_query($get_results) or die(mysql_error()); while ($res = mysql_fetch_array($get_results_res)) { $player_name = $res['name']; $position = $res['position']; $team = $res['team']; $Results = $res['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } else { //sql1 $get_resultss = $sql1 limit $display; echo $get_results1; $get_results_res1 = mysql_query($get_results1) or die(mysql_error()); while ($res1 = mysql_fetch_array($get_results_res1)) { $player_name = $res1['name']; $position = $res1['position']; $team = $res1['team']; $Results = $res1['Results']; echo tr; echo tdcenter$player_name/center/td; echo tdcenter$position/center/td; echo tdcenter$team/center/td; echo tdcenter$Results/center/td; echo /tr; echo /table; } } ? There are no functions and I'm using double quotes. In my table. I have two fields sql1 and sql2. Here are the values in each of the fields: Sql1 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' and a.team_div = '$div' group by a.name order by Results desc In the past I have run into something similar, I resolved it by if you can echo the $pos and $year and $div here then the following should work. $Sql1 = select a.name,a.position,a.team,sum(b.yards) as Results from; $Sql1 .= player a,passing b where a.player_num = b.player_num ; $Sql1 .= and a.position = '.$pos.' ; $Sql1 .= and b.year = '.$year.' ; $Sql1 .= and a.team_div = '.$div.' ; $Sql1 .= group by a.name ; $Sql1 .= order by Results desc; ;You might echo $Sql here to make sure that it has the correct values echo My Sql statement = $Sql1 br; ;Then run this statement through mysql client and see if you see the ;results you were looking for $theresults = mysql_query($Sql1); Sql2 select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = '$pos' and b.year = '$year' group by a.name order by Results desc I'm stumped. I have tested each variable and they all come back, except in the variables sql1 and sql2. Thanks -Rich -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 7:21 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? can you show the code around it? are you using single quotes in defining the sql statement? or double quotes? Bastien From: ReClMaples [EMAIL PROTECTED] To: Jason Walker [EMAIL PROTECTED] CC: PHP php-db@lists.php.net Subject: RE: [PHP-DB] Can someone help me out? Date: Tue, 7 Jun 2005 19:00:59 -0500 Jason, After looking at this a little more, the variable aren't being changed into their value. The echo looks like this: select a.name,a.position,a.team,sum(b.yards) as Results from player a,passing b where a.player_num = b.player_num and a.position = $pos and b.year = $year and a.team_div = $div group by a.name order by Results desc limit '$display' As you can see the variables aren't being changed, any ideas? Thanks -Rich -Original Message- From: Jason Walker [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07,
RE: [PHP-DB] Re: sybase_connect(): Sybae:Unable to allocate connection record
Philip Wasshington wrote: [snip] After installing php-4.3.9-3.6.src.rpm on RHEL4 I modified the php.spec file to add --with-sybase-ct=/opt/sybase/OCS-12_5 Try adding --with-apxs as well! Cheers, Frank. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php-db Digest 7 Jun 2005 17:56:06 -0000 Issue 2973
Bastien, That seems to have worked. I can see php admin's home page. And it looks like PHP BB got installed. I understand the error message (basically, the compiled-in library is out of date with the server) but it could be A LOT clearer...it sounds like the MySQL client libraries are out of date and they're not. I know PHP and the other tools are all free. But this is a pretty basic compatibility issue that could be VERY easily documented right in the install file for PHP 4.x: if you are using version x.y or greater of MySQL, please be sure... would go a long way to eliminating this confusion. Thanks Scott [EMAIL PROTECTED] wrote: php-db Digest 7 Jun 2005 17:56:06 - Issue 2973 Topics (messages 39594 through 39599): Re: Newbie with mail problem 39594 by: Andrés G. Montañez 39599 by: Wings Cannot connect to local MySQL -- Client does not support authentication protocol 39595 by: Scott Powell 39596 by: Bastien Koert 39597 by: Scott Powell 39598 by: Román Sánchez Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-db@lists.php.net -- Date: Tue, 7 Jun 2005 09:25:58 -0300 From: Andrés G. Montañez [EMAIL PROTECTED] To: php-db@lists.php.net Subject: Re: [PHP-DB] Newbie with mail problem Use a real hostname, not 'localhost'.- -- Atte, Andrés G. Montañez Técnico en Redes y Telecomunicaciones Montevideo - Uruguay To: php-db@lists.php.net From: Wings [EMAIL PROTECTED] Date: Tue, 7 Jun 2005 10:38:24 -0700 Subject: Re: [PHP-DB] Newbie with mail problem Andrés G. Montañez wrote in message news:[EMAIL PROTECTED] Use a real hostname, not 'localhost'.- Will give that a try. Thank you. -- Atte, Andrés G. Montañez Técnico en Redes y Telecomunicaciones Montevideo - Uruguay Date: Tue, 7 Jun 2005 07:43:23 -0700 (PDT) From: Scott Powell [EMAIL PROTECTED] To: php-db@lists.php.net Subject: Cannot connect to local MySQL -- Client does not support authentication protocol I am trying to set up my laptop to run PHP and MySQL together.My system summary is:Win 2000 (localhost)PHP 4.3.11MySQL Server 4.1.12MySQL Client 5.0.0MySQL Admin 1.0.9I can connect to my local MySQL host using MySQL client tools.I can connect to a remote MySQL server (don't know the exact version) from PHP in a very simple connect/select template.But I cannot connect to my local MySQL Server from my local PHP installation.Using phpMyAdmin version 2.2.7-pl1, the error message is:MySQL said: Client does not support authentication protocol requested by server; consider upgrading MySQL clientPHP BB gives a similar message:Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\inetpub\wwwroot\phpbb2\db\mysql4.php on line 48Can anyone suggest how to solve this problem? I've spent the better part of every evening for th epast week trying to get PHP and MySQL to work...I'm at wits end.ThanksScott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From: Bastien Koert [EMAIL PROTECTED] To: [EMAIL PROTECTED], php-db@lists.php.net Date: Tue, 07 Jun 2005 11:47:22 -0400 Subject: RE: [PHP-DB] Cannot connect to local MySQL -- Client does not support authentication protoco MySQL's instructions, while 'clear'(upgrade the client library), don't tell you where to get the damn library. If anyone has a link to the new mysql client libraries, I'd appreciate it. I tend to simply downgrade the password string to the old 16bit style run this command: SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); Bastien From: Scott Powell To: php-db@lists.php.net Subject: [PHP-DB] Cannot connect to local MySQL -- Client does not support authentication protocol Date: Tue, 7 Jun 2005 07:43:23 -0700 (PDT) I am trying to set up my laptop to run PHP and MySQL together.My system summary is:Win 2000 (localhost)PHP 4.3.11MySQL Server 4.1.12MySQL Client 5.0.0MySQL Admin 1.0.9I can connect to my local MySQL host using MySQL client tools.I can connect to a remote MySQL server (don't know the exact version) from PHP in a very simple connect/select template.But I cannot connect to my local MySQL Server from my local PHP installation.Using phpMyAdmin version 2.2.7-pl1, the error message is:MySQL said: Client does not support authentication protocol requested by server; consider upgrading MySQL clientPHP BB gives a similar message:Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\inetpub\wwwroot\phpbb2\db\mysql4.php on line 48Can anyone suggest how to solve this problem? I've spent the better part of every evening for th epast week trying to get PHP and MySQL to work...I'm at wits