Re: [PHP-DB] debugging pg_connect
I suspect that PostgreSQL would log anything related to a network connection problem if the error logging level was set correctly. If you don't see any of those perhaps it is a networking issue. You might need to try an ethernet capture tool like Wireshark or perhaps something like tcpflow. John On Apr 26, 2007, at 4:26 AM, [EMAIL PROTECTED] wrote: Hello, since we upgraded to the latest php and PostgreSQL - we started to get frequent pg_connect() errors. What is sure is that they are not caused by insufficient connections - PostgreSQL reports 100 connections available and less than 10 used when the pg_connect fails. pg_last_error() and the other error handling functions operate on connection. So they do not seem useful when pg_connect() fails. In the PostgreSQL documentation I could find out how to log successful connections, but not how to login failed connections. Could somebody advice me on possible ways to test? John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] debugging pg_connect
Hello, since we upgraded to the latest php and PostgreSQL - we started to get frequent pg_connect() errors. What is sure is that they are not caused by insufficient connections - PostgreSQL reports 100 connections available and less than 10 used when the pg_connect fails. pg_last_error() and the other error handling functions operate on connection. So they do not seem useful when pg_connect() fails. In the PostgreSQL documentation I could find out how to log successful connections, but not how to login failed connections. Could somebody advice me on possible ways to test? Thank you, Iv -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Debugging
On think I'm looking to figure out is how much it takes for an http process to connect. On Dec 2, 2005, at 3:17 PM, Benjamin Adams wrote: Can anyone give me an ideas or ways for me to find out a problem on my website? Its either the Invision power boards code, apache config or MySQL config. I'm having trouble figuring out which one is causing the problems, can someone lead me to some good tips or programs to help me figure this out. 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
Re: [PHP-DB] Debugging
zend studio client/server work hand in hand and are the best debugging tools i have found ;) install zend studio server on the web server and use the zend studio client locally to debug. -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 [EMAIL PROTECTED]
[PHP-DB] Debugging
Can anyone give me an ideas or ways for me to find out a problem on my website? Its either the Invision power boards code, apache config or MySQL config. I'm having trouble figuring out which one is causing the problems, can someone lead me to some good tips or programs to help me figure this out. THANKS -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] debugging / help required urgently.
Hi, I have a MAJOR problem with PHP mail() function, one that is odd and very frustrating as I have no idea what is causing it. I have used the one script to send emails out in the past and they have been sucessfully sent out, but as of a few days ago and now they are bouncing, some are actually being sent and some just simply won't go out. So let me explain. I have an admin area of my site where I have all users in a mysql database. Their email address, names, address, etc. The admin side allows me to do many tasks like send out text-based emails via PHP mail() function and HTML emails. What it does is I type in the field boxes and saves to a mysql table, than I run a cronjob to grab the email data and email addresses and send out using PHP mail(). The script worked fine in the past, no problems but now I get the following message when I attempt to send emails: --- This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: [EMAIL PROTECTED] unrouteable mail domain "cashgrace.com" --- But that's not all, it comes up as that for all domains, like yahoo.com, hotmail.com, bigpond.com etc... All of them, even though they are reachable via webmail. I can go into webmail via CPANEL and send emails and they actually go to the person, so does not seem like a mail server problem or does it? I beleive, but could be wrong, it is somewhere in the mail() function on the root part of the server. But of course I don't have access to it. But the weird thing is this... Some emails 1/10 do actually get sent and delivered, do not bounce, but the other 9 fail. Why? Well I did some more investigating... Well for what I have access to. The Server Load for the Server was flashing RED in the Server Status area. So I persume this is bad? Maybe due to this maybe it's attempting to send emails but looping and not got enough resources to actually do the job and in the end gives up and produces the bounced email? As I said before I could be way off track but worth suggesting and trying to figure it out. Is there a way to DEBUG my mail() function I call in the cronjob? The joy of the CRONJOB is that it's written in PHP also, so I can view it on a webpage. So if there is a way to DEBUG it I should see where the error is? Or won't I? Any suggestions? I've looked long and hard, emailed my admin and they are optimistic with the problem also so thought I'd post here and see what can be done and if we can get some outside help. As I said before the script for the mail() has NEVER been changed. So it can't be my code as it has worked in the past. Must be server side somewhere... Unless my admin has done an update and something has gone wrong. But I thought someone on here would know what could cause the error, at least we can investigate it instead of having no idea what is causing the problem. All the help is needed here if people can provide it. Thanks in advance, and sorry for the long email. But this problem is really giving me the 'you know what' now. Jerry http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Debugging/monitoring traffic to MySQL
On 7/18/02 8:30 PM, "Clive Bruton" <[EMAIL PROTECTED]> wrote: > Is there a way to see the traffic between PHP and MySQL, ie see the > statements/raw data that is sent between the two processes. > > I've tried running the MYSQL client, but there doesn't seem to be any > obvious command to do this. Some other terminal process? > > I'm running MacOS X. If you fire up mysql with the --log option, you can tail the log and watch everything that's going on in your database. Otherwise, if you want to make life difficult, do a packet trace. -- Ed Marczak [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Debugging/monitoring traffic to MySQL
On the MySQL server (could be the same machine) start mysql with -l arguement. Which enables connection and query logging.. YOu can just sit there and tail -f the server.log file to see all the querys/connections being executed in realtime... good look reading anything on a busy server ;) On Fri, 19 Jul 2002, Clive Bruton wrote: > Is there a way to see the traffic between PHP and MySQL, ie see the > statements/raw data that is sent between the two processes. > > I've tried running the MYSQL client, but there doesn't seem to be any > obvious command to do this. Some other terminal process? > > I'm running MacOS X. > > TIA. > > > -- Clive > > -- > 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] Debugging/monitoring traffic to MySQL
Is there a way to see the traffic between PHP and MySQL, ie see the statements/raw data that is sent between the two processes. I've tried running the MYSQL client, but there doesn't seem to be any obvious command to do this. Some other terminal process? I'm running MacOS X. TIA. -- Clive -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] debugging?
Your $sql already contains a mysql_query. Why are you running it against it again, unless you have changed something. If $sql only contains your delete statement(without calling mysql_query), then do not put quotes around $sql,$dbh Otherwise, come back with what $sql and $dbh are assigned to be. That would probably help determine what the problem is. MB jas <[EMAIL PROTECTED]> said: > Ok now that the sql statement is working I am getting an error on my result > function... here is the result function > $result = mysql_query("$sql, $dbh") or die(mysql_error()); > and here is the error I am recieving > You have an error in your SQL syntax near '1, 1' at line 1 > I dont know enough about php and mysql to understand what this means... is > there some kind of chart or definitions for error messages? I tried looking > on mysql.org and couldnt find anything specific. In any event, thanks in > advance. > Jas > <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Here is what your delete statement should look like: > > > > $sql = mysql_query("DELETE FROM $table_name WHERE id = '$id'",$dbh) or > > die(mysql_error()); > > > > Note the field name without the $ in front of it and the variable you are > > comparing it to with the $. > > > > One other note, in your table, you have id as a varchar(30) > auto_increment. > > As far as I know, auto_increment can only be used on INT() field types, > > unless I missed something there. If you do end up changing the field type > to > > INT, make sure you take the '' around the $id out. > > > > HTH > > > > MB > > > > > > > > > > jas <[EMAIL PROTECTED]> said: > > > > > Ok now that I can see the error message how can I fix it... the syntax > looks > > > correct and the error I am recieving is as follows > > > > > > You have an error in your SQL syntax near '= 'id'' at line 1 > > > > > > And this is my statement, > > > $sql = mysql_query("DELETE FROM $table_name WHERE $id = 'id'",$dbh) or > > > die(mysql_error()); > > > Is there anywhere on php.net or mysql.org that give exact error > meanings? > > > Thanks again, > > > Jas > > > "Olinux" <[EMAIL PROTECTED]> wrote in message > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > jas, > > > > > > > > Try this: > > > > - Remove the @, it suppresses the error > > > > - change die("Could not execute query, please try > > > > again later"); to die(mysql_error()); > > > > > > > > > > > > $sql = mysql_query("DELETE FROM $table_name WHERE $id > > > > = 'id'",$dbh) or > > > > die(mysql_error()); > > > > > > > > olinux > > > > > > > > --- jas <[EMAIL PROTECTED]> wrote: > > > > > Can someone tell me how I can find out why I am > > > > > getting errors executing > > > > > queries when I try to delete items from a table? I > > > > > have 2 files... > > > > > file 1. - Queries database, displays results with > > > > > option to delete record > > > > > using a check box, code is as follows... > > > > > > > > > > > > > > > > > > > > __ > > > > Do You Yahoo!? > > > > Yahoo! Sports - Coverage of the 2002 Olympic Games > > > > http://sports.yahoo.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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] debugging?
Ok jas > Ok now that I can see the error message how can I fix it... the syntax looks > correct and the error I am recieving is as follows > > You have an error in your SQL syntax near '= 'id'' at line 1 > > And this is my statement, > $sql = mysql_query("DELETE FROM $table_name WHERE $id = 'id'",$dbh) or > die(mysql_error()); > Is there anywhere on php.net or mysql.org that give exact error meanings? Possible confusion between PHP code and SQL. Do you really mean "...WHERE id = '$id' "? =dn > Thanks again, > Jas > "Olinux" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > jas, > > > > Try this: > > - Remove the @, it suppresses the error > > - change die("Could not execute query, please try > > again later"); to die(mysql_error()); > > > > > > $sql = mysql_query("DELETE FROM $table_name WHERE $id > > = 'id'",$dbh) or > > die(mysql_error()); > > > > olinux > > > > --- jas <[EMAIL PROTECTED]> wrote: > > > Can someone tell me how I can find out why I am > > > getting errors executing > > > queries when I try to delete items from a table? I > > > have 2 files... > > > file 1. - Queries database, displays results with > > > option to delete record > > > using a check box, code is as follows... > > > > > > > > > > __ > > Do You Yahoo!? > > Yahoo! Sports - Coverage of the 2002 Olympic Games > > http://sports.yahoo.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
Re: [PHP-DB] debugging?
Ok now that the sql statement is working I am getting an error on my result function... here is the result function $result = mysql_query("$sql, $dbh") or die(mysql_error()); and here is the error I am recieving You have an error in your SQL syntax near '1, 1' at line 1 I dont know enough about php and mysql to understand what this means... is there some kind of chart or definitions for error messages? I tried looking on mysql.org and couldnt find anything specific. In any event, thanks in advance. Jas <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Here is what your delete statement should look like: > > $sql = mysql_query("DELETE FROM $table_name WHERE id = '$id'",$dbh) or > die(mysql_error()); > > Note the field name without the $ in front of it and the variable you are > comparing it to with the $. > > One other note, in your table, you have id as a varchar(30) auto_increment. > As far as I know, auto_increment can only be used on INT() field types, > unless I missed something there. If you do end up changing the field type to > INT, make sure you take the '' around the $id out. > > HTH > > MB > > > > > jas <[EMAIL PROTECTED]> said: > > > Ok now that I can see the error message how can I fix it... the syntax looks > > correct and the error I am recieving is as follows > > > > You have an error in your SQL syntax near '= 'id'' at line 1 > > > > And this is my statement, > > $sql = mysql_query("DELETE FROM $table_name WHERE $id = 'id'",$dbh) or > > die(mysql_error()); > > Is there anywhere on php.net or mysql.org that give exact error meanings? > > Thanks again, > > Jas > > "Olinux" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > jas, > > > > > > Try this: > > > - Remove the @, it suppresses the error > > > - change die("Could not execute query, please try > > > again later"); to die(mysql_error()); > > > > > > > > > $sql = mysql_query("DELETE FROM $table_name WHERE $id > > > = 'id'",$dbh) or > > > die(mysql_error()); > > > > > > olinux > > > > > > --- jas <[EMAIL PROTECTED]> wrote: > > > > Can someone tell me how I can find out why I am > > > > getting errors executing > > > > queries when I try to delete items from a table? I > > > > have 2 files... > > > > file 1. - Queries database, displays results with > > > > option to delete record > > > > using a check box, code is as follows... > > > > > > > > > > > > > > > __ > > > Do You Yahoo!? > > > Yahoo! Sports - Coverage of the 2002 Olympic Games > > > http://sports.yahoo.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
Re: [PHP-DB] debugging?
Here is what your delete statement should look like: $sql = mysql_query("DELETE FROM $table_name WHERE id = '$id'",$dbh) or die(mysql_error()); Note the field name without the $ in front of it and the variable you are comparing it to with the $. One other note, in your table, you have id as a varchar(30) auto_increment. As far as I know, auto_increment can only be used on INT() field types, unless I missed something there. If you do end up changing the field type to INT, make sure you take the '' around the $id out. HTH MB jas <[EMAIL PROTECTED]> said: > Ok now that I can see the error message how can I fix it... the syntax looks > correct and the error I am recieving is as follows > > You have an error in your SQL syntax near '= 'id'' at line 1 > > And this is my statement, > $sql = mysql_query("DELETE FROM $table_name WHERE $id = 'id'",$dbh) or > die(mysql_error()); > Is there anywhere on php.net or mysql.org that give exact error meanings? > Thanks again, > Jas > "Olinux" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > jas, > > > > Try this: > > - Remove the @, it suppresses the error > > - change die("Could not execute query, please try > > again later"); to die(mysql_error()); > > > > > > $sql = mysql_query("DELETE FROM $table_name WHERE $id > > = 'id'",$dbh) or > > die(mysql_error()); > > > > olinux > > > > --- jas <[EMAIL PROTECTED]> wrote: > > > Can someone tell me how I can find out why I am > > > getting errors executing > > > queries when I try to delete items from a table? I > > > have 2 files... > > > file 1. - Queries database, displays results with > > > option to delete record > > > using a check box, code is as follows... > > > > > > > > > > __ > > Do You Yahoo!? > > Yahoo! Sports - Coverage of the 2002 Olympic Games > > http://sports.yahoo.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
Re: [PHP-DB] debugging?
Ok now that I can see the error message how can I fix it... the syntax looks correct and the error I am recieving is as follows You have an error in your SQL syntax near '= 'id'' at line 1 And this is my statement, $sql = mysql_query("DELETE FROM $table_name WHERE $id = 'id'",$dbh) or die(mysql_error()); Is there anywhere on php.net or mysql.org that give exact error meanings? Thanks again, Jas "Olinux" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > jas, > > Try this: > - Remove the @, it suppresses the error > - change die("Could not execute query, please try > again later"); to die(mysql_error()); > > > $sql = mysql_query("DELETE FROM $table_name WHERE $id > = 'id'",$dbh) or > die(mysql_error()); > > olinux > > --- jas <[EMAIL PROTECTED]> wrote: > > Can someone tell me how I can find out why I am > > getting errors executing > > queries when I try to delete items from a table? I > > have 2 files... > > file 1. - Queries database, displays results with > > option to delete record > > using a check box, code is as follows... > > > > > __ > Do You Yahoo!? > Yahoo! Sports - Coverage of the 2002 Olympic Games > http://sports.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] debugging?
jas, Try this: - Remove the @, it suppresses the error - change die("Could not execute query, please try again later"); to die(mysql_error()); $sql = mysql_query("DELETE FROM $table_name WHERE $id = 'id'",$dbh) or die(mysql_error()); olinux --- jas <[EMAIL PROTECTED]> wrote: > Can someone tell me how I can find out why I am > getting errors executing > queries when I try to delete items from a table? I > have 2 files... > file 1. - Queries database, displays results with > option to delete record > using a check box, code is as follows... > __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] debugging?
Can someone tell me how I can find out why I am getting errors executing queries when I try to delete items from a table? I have 2 files... file 1. - Queries database, displays results with option to delete record using a check box, code is as follows... Current Inventory"; $count = -1; while ($myrow = mysql_fetch_row($result)) { $count ++; echo "Type Of Car: "; printf(mysql_result($result,$count,"car_type")); echo "remove \n"; echo "Model Of Car: "; printf(mysql_result($result,$count,"car_model")); echo "\n"; echo "Year Of Car: "; printf(mysql_result($result,$count,"car_year")); echo "\n"; echo "Price Of Car: $"; printf(mysql_result($result,$count,"car_price")); echo "\n"; echo "VIN Of Car: "; printf(mysql_result($result,$count,"car_vin")); echo "\n"; } echo ""; ?> file 2. - takes variable of checkbox and then queries db trying to delete any record based on the id. code is as follows... I have been trying everything under the sun and cannot get this to work. please help. Jas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php