, January 07, 2003 5:06 PM
Subject: Re: [PHP] Re: PHP and MySQL bug
@mysql_select_db(be); -- this failed
do echo mysql_error(); to see what went wrong
Nuno Lopes wrote:
I done a echo of Mysql_error and it returned:
'Nenhum banco de dados foi selecionado'
(I have the mysql server
4:12 PM
Subject: RE: [PHP] Re: PHP and MySQL bug
Since nobody is jumping in to say it is some simple configuration/setting
personally my next step would be to shut down all services on the box that
aren't absolutely necessary and stop everything in the registry under run
and stop anything
:28 PM
Subject: RE: [PHP] Re: PHP and MySQL bug
This definitely sounds like a buggy installation or there may be some
problem with the communication between the web server and the mysqld. Is
the db on a different machine? Try using mysql_pconnect instead of
connect
just to see what result you
')
- Original Message -
From: David Freeman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 05, 2003 10:29 PM
Subject: RE: [PHP] Re: PHP and MySQL bug
@MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this
query doesn't work
Personally, I'd call it bad programming
I'm using Windows 2000.
- Original Message -
From: Cleber [EMAIL PROTECTED]
To: Nuno Lopes [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 10:23 AM
Subject: Re: [PHP] Re: PHP and MySQL bug
Try add to /etc/hosts the name and ip of DB is located
- Original Message -
From
, January 05, 2003 10:29 PM
Subject: RE: [PHP] Re: PHP and MySQL bug
@MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this
query doesn't work
Personally, I'd call it bad programming practice to do a database update
and not check to see if it worked or not. In this case, how are you
The problem is if I close the connection and reopen it the query is done,
but if I remain with the same connection has the previous query, mysql
returns an error.
- Original Message -
From: Larry Brown [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Sunday, January 05, 2003 4:16
: Monday, January 06, 2003 10:09 AM
To: MySQL List; [EMAIL PROTECTED]
Subject: Re: PHP and MySQL bug
The problem is if I close the connection and reopen it the query is done,
but if I remain with the same connection has the previous query, mysql
returns an error.
- Original Message -
From
Here is the source code:
?
@MYSQL_CONNECT(localhost, nlopes, testing) or die(Erro 1);
@mysql_select_db(be);
$r=MYSQL_QUERY(SELECT n,u,m,h FROM d WHERE id='$id');
if (mysql_num_rows($r)==0) {
die (Erro);
} else {
$re=mysql_fetch_array($r, MYSQL_NUM);
$nome=$re[0];
$url=$re[1];
$mirrors=$re[2];
@MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this
query doesn't work
Personally, I'd call it bad programming practice to do a database update
and not check to see if it worked or not. In this case, how are you
determining that the query did not work? Are you manually checking
You really should be using a $link variable...it's good habit:
$link = mysql_connect(...);
mysql_select_db( mydb , $link);
$query = mysql_query( select... , $link );
$result = mysql_fetch_array($query);
Lewis
Nuno Lopes [EMAIL PROTECTED] wrote in message
Personally I say get yourself a good simple dbconnect class and make life easy.
Also if you ever change users, database name etc, you onlu have one place to replace
it in your code.
I wrote mine based on http://www.vtwebwizard.com/tutorials/mysql/
Take a look at it. Nice and simple.
Mike
Personally I think the problem lies somewhere between the chair and the keyboard
(Sorry, couldn't resist) :-)
*** REPLY SEPARATOR ***
On 04/01/2003 at 4:58 PM Stefan Hinz, iConnect (Berlin) wrote:
It doesn't work because of the /* Some code including ... */ part ;-)
Nuno,
$r=MYSQL_QUERY(SELECT n,u,m,h FROM d WHERE id='$id');
/* Some code including mysql_num_rows and mysql_fetch_array($r,
MYSQL_NUM)
And the another query:
*/
MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id');
/* i don't know why but this doesn't work!*/
It doesn't work because of the
14 matches
Mail list logo