[PHP] Re: Problem with MySQL

2005-01-08 Thread JHollis
Try running mysqld without the -opt.  Check out this site 
www.apachefriends.org  it has a great all in one package that can be 
installed on Windows and Linux.  If you install it on Windows it has the 
option to setup mysql and apache to run as services.  This XAMPP package 
is a no brainer!!

Hope this helps.
Andrew Maxwell wrote:
Hello,
Im fairly new to PHP and I am running an Apache web server on my
computer, set up as localhost, and i recently installed MySQL 4.1 . I
am having trouble making a DB and a table in the DB.  when i try to
create it from a command prompt it tells me this:
C:\mysql\binmysqld-opt
C:\mysql\binmysqladmin create userDB
mysqladmin: connect to server at 'localhost; failed
error: 'Can't connect to MySQL server on 'localhost' (10061)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'
and when I try to connect using Telnet it gives me this error
Microsoft Telnet open localhost 3306
Connecting to localhost...Could not open connection to the host, on
port 3306: Connection failed
And when i run services.msc it shows that mysql is running, so i dont
know what the problem is. Anyone have any ideas?
~Andrew
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Problem with MySQL Query

2003-07-24 Thread Mikael Jansson
Hi Phil,
What I can see in your question there is a missing space between fieldname
type and the operator !=

I tested on my machine and it works fine when using both != and 
operators, but it will not work with the NOT operator.

Hope the missing space will do some good.

br

/Mikael

Phillip Blancher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Problem with mySQL Query
This is the query I have:

$dbqueryshipping1 = select * from tempuserpurchase where
(usersessionid=\$User_Shopping_Id\) and day=\1\ and type!=\Meal+Plans\
;

What I want to do is to select everything from tempuserpurchase that matchs
the user session and the day, so long as type is not Meal Plans

However it is not excluding Meal Plans

Any Suggestions.

Thanks in advance,

Phil


__


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Problem with MySQL Query

2003-07-24 Thread Curt Zirzow
* Thus wrote Mikael Jansson ([EMAIL PROTECTED]):
 Hi Phil,
 What I can see in your question there is a missing space between fieldname
 type and the operator !=
 
 I tested on my machine and it works fine when using both != and 
 operators, but it will not work with the NOT operator.
 
 Hope the missing space will do some good.

there is no difference between:

select * from table where column !=value
vs.
select * from table where column != value

At this point, I would inspect the data to see if it is really the
value that I'm looking for.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: problem with mysql persistent connections; already read the FAQ!

2002-03-08 Thread michael kimsal

Dustin Puryear wrote:
 We are running Apache 1.3.20 with PHP 4.0.6/rfc1876-patch built as a
 module. We are using PHP on a load-sharing cluster with n web servers.
 Our cluster supports an application that makes extensive use of mysql
 connections via the PHP mysql_* functions.
 
 The application was tested on a single web server, and the programmers
 are trying to use persistent connections to increase efficiency.
 First, I want to confirm in my own mind whether this will have any
 real benefit in our situation because we are using a cluster
 environment, correct?
 
 Second, the programmers are using mysql_connect() and not
 mysql_pconnect(). Does that mean they are in fact not using persistent
 connections? (BTW, we do have persistent connections turned on in
 php.ini.)

If they are not using the mysql_pconnect functions, then you are not 
using persistent connections.  The .ini file setting simply allows them 
to be used or not - no version I've seen has an option to override to
always use them.



 
 Finally, the programmers showed me how they see that persistent
 connections are in fact working. On the development server they are
 doing the following:
 
 mysql_open()
 mysql_query() 
 ...
 mysql_close()
 mysql_query()
 
 On their server the second mysql_query() works! 

What is the specific syntax they are using?  Is there any chance that 
they have opened more than one handle to mysql?  The mysql_close() would
only close one, and if there are more than one handles open, only one 
will close and others will be free to handle _query() functions.

I'm going to assume they are using mysql_connect() as I can't find 
refernce to a mysql_open() function.

The mysql_query function *may* be simply reopening another connection 
with the previous information.

 From the manual:
mysql_query() sends a query to the currently active database on the 
server that's associated with the specified link identifier. If 
link_identifier isn't specified, the last opened link is assumed. If no 
link is open, the function tries to establish a link as if 
mysql_connect() was called with no arguments, and use it.






(They are using Apache
 1.3.20 as well, but I was told they may have compiled PHP into Apache
 rather than as a module, and I'm not exactly sure of the version, but
 I'm pretty sure it is 4.0.6.) But on the cluster the second
 mysql_query() returns:
 
 Warning: 1 is not a valid MySQL-Link resource in /some/path/pers.php
 on line 11 could not execute 'select zipcod from zip'

Does that second machine have access to the database?  The database may 
be only allowing 'localhost' connections or connections from a specific IP.

 
 Should this be working on our cluster? If not, what do we need to do.

Yes

 Can this work? 

Yes
  Will persistent connections even be effective in a
 cluster environment?

It depends.  In the Apache situation, using persistent connections will 
cause *each* Apache child to hold a connection open to MySQL.  So if you 
have 150 apache processes on 3 servers, that's 450 connections the 
database server needs to have open for MySQL.  ~50k per connection, 
that's about 23 meg - should be doable on most machines to start.  If 
you're running lots of big queries, get loads of RAM.  You'll need to 
tune mysql to handle more than the default 100 concurrent connections, 
and make sure your OS can handle the maximum resources it may require as 
well.

Yes, they can be effective.  On a fast network with a light loaded 
machine using mysql, you often can't tell much of a difference between 
pconnect and connect.  As the load grows heavier, the pconnects come in 
more handy, but at a price of consuming resources you may otherwise need.

If 150 apache processes are serving up HTML and PHP and graphics, one 
server may end up holding 150 persistant connections open for a long 
time, even though you may only be serving 10-20-30 PHP pages at any one 
time.  Although the other Apache children are serving graphics/HTML, 
they may earlier have run a PHP script with pconnect and will now hold 
it open until they die.  We tell Apache children to only handle 
5000-1 requests and then specifically die, which should kill the 
connection to mysql (some drivers seem to not handle this - freetds had 
a problem letting go of handles on the apache exit cycle).

In short, if you're looking to load balance a high load, pconnects can 
help, but smart web serving architecture can help too (possibly moreso 
all around).

 
 I did read the alt.comp.lang.php FAQ, but it didn't actually address
 this issue.
 
 Any help or information is appreciated!


Hope that helps some.

--
Michael Kimsal
http://www.phphelpdesk.com
Taking the ? out of ?php
734-480-9961


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Problem in mysql connection

2002-01-26 Thread Alan McFarlane

What is the error message? (It will help us a lot G)



Uma Shankari T. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...



 Hello,

 I have installed php4 rpm in my machine.while connecting php with
 mysql it is giving fatal error.I have given like this

 mysql_connect($servername,$username,$password);

 Why it is so ..

 Is there any other files i have to install to access the database??



 Regards,
 Uma





-- 
PHP General 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]