Help with query

2005-03-02 Thread Ryan Schefke
Hello,

 

I have two tables:

 

Table2 (listings), columns - listingID, state, preferred, siteAddress,
siteTitle, siteDescription

Table1 (invotes), columns listingID

 

I want to select the listingID of the rows in Table2 where the 'state'
column equals '$st' then count the number of rows in Table1 that have the
same listingID as those selected in Table2. I want to pull the information
from Table2 regardless if there is an entry in Table1 with the same
listingID or not. However, if the listingID is the same in Table1 compared
to Table2 then I want to count the number of rows that have that listing.
More importantly, I need to sort the rows from highest to lowest. 

 

I hope I made sense, this is what I have so far (which will output what I
want but NOT in order of votes ($invotes in my example)

 

 

$query_state = "SELECT
listingID FROM listings WHERE state='$st'"; 

$result_state  =
@mysql_query($query_state);

if
(mysql_num_rows($result_state) > 0) { // if at least one exists



while
($row_state = mysql_fetch_array($result_state, MYSQL_NUM)) {

 



 
$query_category = "SELECT count(*) as hits FROM 

 
invotes WHERE listingID = '$row_state[0]' ORDER BY hits DESC"; 





 
$result_category  = @mysql_query($query_category);





 
$row_category = mysql_fetch_array($result_category, MYSQL_NUM);

 


 


 
$invotes = $row_category[0];

 


 


 
// get listing information

 
$query_client = "SELECT preferred, siteAddress, siteTitle, siteDescription
FROM listings WHERE listingID='$row_state[0]'"; 

 
$result_client  = @mysql_query($query_client);

 
$row_client = mysql_fetch_array($result_client, MYSQL_NUM);

 

...then start printing our information from Table2

 

 

 

Best regards,

Ryan

 



RE: Access Denied, How To Fix This

2004-01-13 Thread Ryan Schefke
I get the following access denied error:

Warning: mysql_pconnect(): Access denied for user:
'[EMAIL PROTECTED]' (Using password: YES) in
C:\Apache\Apache2\html\C2R\catalog\includes\functions\database.php on
line 17
Unable to connect to database server!


Why Is this happening and how can I fix it?


It's been several months since I've done anything with the mysql server,
but I do know that I was able to connect perfectly up until a few weeks
back.  The 192.168.1.102 is the LAN IP address of another computer on my
home network.  My mysql server is called samserver and I believe it used
to log me in as [EMAIL PROTECTED] I'm not sure why it started
denying me access.  I've unplugged my cable modem and that's
all...didn't change any settings through phpadmin or mysql.  

Why Is this happening and how can I fix it?

Please help.

Thanks,
Ryan



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Access Denied, How To Fix This

2004-01-12 Thread Ryan Schefke
Hello,

I'm trying to access phpadmin and another website that I built on my
mysql server and I get the following access denied error:

Warning: mysql_pconnect(): Access denied for user:
'[EMAIL PROTECTED]' (Using password: YES) in
C:\Apache\Apache2\html\C2R\catalog\includes\functions\database.php on
line 17
Unable to connect to database server!


It's been several months since I've done anything with the mysql server,
but I do know that I was able to connect perfectly up until a few weeks
back.  The 192.168.1.102 is the LAN IP address of another computer on my
home network.  My mysql server is called samserver and I believe it used
to log me in as [EMAIL PROTECTED] I'm not sure why it started
denying me access.  I've unplugged my cable modem and that's
all...didn't change any settings through phpadmin or mysql.  

Why Is this happening and how can I fix it?

Please help.

Thanks,
Ryan



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: * HELP * MySQL Connection Issue - Access Denied!!

2003-07-18 Thread Ryan Schefke
Jason - I just tried:

GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY 'X'

on the server machine in a mysql console and I got the following:
ERROR 1045: Access denied for user: '@localhost' 

...in addition to my questions below, why doesn't that work!  Ahhh!


-Original Message-
From: Ryan Schefke [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 18, 2003 11:05 AM
To: 'Jason k Larson'
Subject: RE: * HELP * MySQL Connection Issue - Access Denied!!

Hey Jason - Thanks a ton for your help!  You're a lifesaver!

When I use 'localhost' for the below line:
C:\mysql\bin\mysqladmin -u root -h localhost password 

It seems to work??? because the next line goes back to c:\mysql\bin
...was the password for root successfully changed then?

on the next line, I type
c:\mysql\bin\mysqladmin -u root -h samserver password  

...and oddly enough I get the following:
mysqladmin: connect to server at 'samserver' failed
error: 'Access denied for user: '[EMAIL PROTECTED]' '



Why doesn't it work when I use 'samserver' instead of 'localhost'
In the winmysqladmin 1.4 tool under the environment tab it says my local
host name is 'samserver'...what I named my computer?



 

-----Original Message-
From: Jason k Larson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 17, 2003 7:19 PM
To: Ryan Schefke
Subject: Re: * HELP * MySQL Connection Issue - Access Denied!!

You probably should either a) not use SAMSERVER or b) not specify the
host or c) use 
localhost instead of SAMSERVER.

the mysql> prompt means you have successfully connected to the database
server, which is a 
very good thing.

As for the errors you probably need to create the ryanschefke user.  Or
just use root (not 
recommended).

once you are at the mysql> console try typing the following SQL
statement.
GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY
'your-password-here';

then do:
FLUSH PRIVILEGES;

you should be able to proceed with mySQLAdmin at that point.

--
Jason k Larson


Ryan Schefke wrote:

> Hi Jason,
> 
> When I type: c:\mysql\bin\mysqladmin -u root -h localhost (I use
> 'samserver' for localhost...I hope that's right???)
> 
> I get a whole list of things...version, options, variable, commands...
> 
> 
> When I type: c:\mysql\bin\mysqlc -u root
> 
> I get welcome to the MySQL Monitor...then 'mysql>' shows up.
> 
> 
> ...still getting errors though as mentioned below.
> 
> -Original Message-
> From: Jason k Larson [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 17, 2003 6:08 PM
> To: Ryan Schefke
> Subject: Re: * HELP * MySQL Connection Issue - Access Denied!!
> 
> How about:
> 
> c:\mysql\bin\mysqladmin -u root -h localhost
> 
> or just:
> 
> c:\mysql\bin\mysqlc -u root
> 
> ??
> 
> --
> Jason k Larson
> 
> 
> Ryan Schefke wrote:
> 
> 
>>.I just sent this out to the win32 distribution list but no one has
>>replied.can someone on this list please help?  The issue should be
>>trivial for experienced MySQL users, I'm just a novice,  thanks!
>> 
>> 
>>Anyone - I've been racking my brain for the majority of the day and
>>scouring through the MySQL manual trying to figure out what is
> 
> wrong.can
> 
>>anyone please help?  
>> 
>>Here's my issue:
>> 
>>- Extracted files to C:\MySQL
>>- Ran setup.exe (everything went fine, using MySQL Admin 1.4 I can see
>>'mysql' and 'test' dbs installed)
>>- MySQL is running as a service and MySQL Admin 1.4 shows a green
> 
> light
> 
>> 
>>From the box that is running MySQL I try to set the root password in
> 
> DOS
> 
>>two ways and when I mention the host (believe it's 'SAMSERVER'
> 
> according
> 
>>to MySQL Admin tool) it gives me an error.
>>
> 
>

> 
>>
>>O c:\mysql\bin\mysqladmin -u root password X.. Works fine and
>>the next line goes back to my root directory of c:\mysql\bin
>>O c:\mysql\bin\mysqladmin -u root -h SAMSERVER password X..
>>Gives me the below error!
>> 
>>Mysqladmin: connect to server at 'samserver' failed
>>Error: 'Access denied for user: '[EMAIL PROTECTED]' '
>>
> 
>

> 
>>
>>Also, when I try to connect to the database from another computer via
>>the web using http://samserver.sytes.net:8080/mysqltest.php
>>I get

* HELP * MySQL Connection Issue - Access Denied!!

2003-07-17 Thread Ryan Schefke
.I just sent this out to the win32 distribution list but no one has
replied.can someone on this list please help?  The issue should be
trivial for experienced MySQL users, I'm just a novice,  thanks!
 
 
Anyone - I've been racking my brain for the majority of the day and
scouring through the MySQL manual trying to figure out what is wrong.can
anyone please help?  
 
Here's my issue:
 
- Extracted files to C:\MySQL
- Ran setup.exe (everything went fine, using MySQL Admin 1.4 I can see
'mysql' and 'test' dbs installed)
- MySQL is running as a service and MySQL Admin 1.4 shows a green light
 
>From the box that is running MySQL I try to set the root password in DOS
two ways and when I mention the host (believe it's 'SAMSERVER' according
to MySQL Admin tool) it gives me an error.


O c:\mysql\bin\mysqladmin -u root password X.. Works fine and
the next line goes back to my root directory of c:\mysql\bin
O c:\mysql\bin\mysqladmin -u root -h SAMSERVER password X..
Gives me the below error!
 
Mysqladmin: connect to server at 'samserver' failed
Error: 'Access denied for user: '[EMAIL PROTECTED]' '


Also, when I try to connect to the database from another computer via
the web using http://samserver.sytes.net:8080/mysqltest.php
I get the following error (I've attached my mysqltest.php file too):
'Warning: mysql_connect(): Access denied for user:
'[EMAIL PROTECTED]' (Using password: YES) in
C:\Apache\Apache2\html\mysqltest.php on line 20
Could not connect'
*** Note, I had to change my router settings to forward port 8080 to my
web server ip since my ISP blocks port 80.


Also, I've successfully installed phpMyAdmin 2.5.2-rc2.  When I run
'http://samsever.sytes.net:8080/phpadmin/index.php' I get the following
message:
"Welcome to phpMyAdmin 2.5.2-rc2
phpMyAdmin tried to connect to the MySQL server, and the server rejected
the connection. You should check the host, username and password in
config.inc.php and make sure that they correspond to the information
given by the administrator of the MySQL server.
Error
MySQL said: 
Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)"


Server Settings:
- Under MySQL Admin 1.4 on the Environment tab I see the following
settings:
o Local Host Name: 'SAMSERVER'
o Local User Name: ' Administrator'
o OS Platform: 'Whistler'
o Local IP Address: '192.168.1.102
o ..also, in MyODBC window it finds driver 3.51 and API
level 2 and SQL level 1
 
- Chose 'username' and 'password' for MySQLAdmin.exe application
- MyODBC 3.51.06 installed - MySQL Connector/ODBC 
 
Running These Software Versions:
- Windows XP with service pack 1
- MySQL 4.0.13 for windows
- Apache 2.0.47
- PHP 4.3.2
 
Any help is MUCH appreciated!