User and permissions/grants - HELP!

2003-10-25 Thread C. Reeve
Hi,

I just installed MySQL version 4 and as usual, trying to set up users
and grant permissions is a nightmare.
I followed the instructions in the MySQL manual and granted permissions
to a user, like below:

GRANT ALL PRIVILEGES ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY
'12345678' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO newuser@% IDENTIFIED BY '12345678' WITH
GRANT OPTION;

I can log in with this user, but I can't do anything (i.e. create a
database). There is also no mysql database (there is though if I log in
as root).

So what am I doing wrong.?

TIA




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



Sorting question

2003-07-30 Thread C. Reeve
Hi, 

I have a database with 5 teams and each team has 'n' categories and each
category has 5 sub-categories.

i.e TeamOne = Ottawa, Category 1 = Player Name, Sub-Categories = Goals,
assists, ppg, gwg, points.

Team0ne
Category 1 
Sub 1
Sub 2
Sub 3
Sub 4
Sub 5
Category 2 
Sub 1
Sub 2
Sub 3
Sub 4
Sub 5
Etc.


From the examples above I am trying to add the all the sub-categories
together for each category for each team in descending order. 

To put it simpler - I want a total of all the goals scored for each team
and display them in descending order. I have been able to put a query
together that gets me the totals, but I can not get them in decending
order.

The query below is in a for loop in PHP and cycles through each team and
does give me the totals, just not in descending order (actually the
order is the way they are numbered in the database);

$query = select team.name, sum(goals) from roster join reference join
team where team.idn=reference.idn and reference.idp=roster.idp and
position = 'F' and team.idn = 1 group by team.name;

Now the query here may not be the problem, but the way the for loop
works, but any help is appreciated.

TIA



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



Select Limit question

2003-07-19 Thread C. Reeve
This is probably easy, but I just can't to put my finger on it. I have a
list of numbers (i.e. 1 to 175) and I want to do a select statement to
get the highest number. I have tried the limit thing but not getting the
right output. Can someone shed some light on this?

TIA 


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



MySQL query problems

2003-07-16 Thread C. Reeve

Hi,

Not sure if the problem here is PHP or MySQL, but here we go. I am
trying to do two queries on a database - one after the other, but the
second one never seems to get executed. The two queries are identical
except for two variables. I have checked my form and they are correct
and are being sent to the PHP script the way they should be.

The variables are $playerto, $playerfrom, $nameto, $namefrom. The 'TO'
query is the one that doesn't work.

Here is my code. Any help is appreciated.

if ($namefrom != $nameto) {
if ($playerfrom != $playerto) {

include(2004server.inc); 
if($error) { 
include(trades-input.php);
exit;
}

$query1 = select manager.idn, manager.total,
roster.idp, position, points from roster join reference
join manager where manager.idn=reference.idn and
reference.idp=roster.idp and manager.idn like '$namefrom' and
roster.idp like '$playerfrom';  

$result1 = mysql_query($query1) or $mysqlerror =
mysql_error();
if ($mysqlerror) { 
$error = $d_base_error$email_error;
include(trades-input.php);
exit;
}   

$line = mysql_fetch_row($result1);

mysql_free_result($result1);

$query2 = select manager.idn, manager.total,
roster.idp, position, points from roster join reference
join manager where manager.idn=reference.idn and
reference.idp=roster.idp and manager.idn like '$nameto' and
roster.idp like '$playerto'; 

$result2 = mysql_query($query2) or $mysqlerror =
mysql_error();
if ($mysqlerror) { 
$error = $d_base_error$email_error;
include(trades-inputs.php);
exit;
}   
 
$row = mysql_fetch_array($result2);

mysql_free_result($result2);
}
}


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



RE: MySQL query problems

2003-07-16 Thread C. Reeve
Since the first query works, the second one should also work as it is
virtually the same. It is querying the same database using the exact
same query. The only difference is the variable names passed to it by
the form.

i.e. 

$playerfrom may = Hossa
$playerto may = Alfredsson
$namefrom may = Bill
$nameto may = John

If I change the from and the to values to the opposite of the above
example I get the same thing. The second query does not work (which
works if I use it as the first query). Even if I use the exact same
query for both - the second one will not work.

Hope this makes sense. 

-Original Message-
From: Jef S [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2003 12:50 PM
To: [EMAIL PROTECTED]
Subject: RE: MySQL query problems


Have you checked the query in an editor to see if they are working? Just
substitute known values in the place of the variables you are using.


Jef

 -Original Message-
 From: C. Reeve [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 16, 2003 10:16 AM
 To: [EMAIL PROTECTED]
 Subject: MySQL query problems
 
 
 Hi,
 
 Not sure if the problem here is PHP or MySQL, but here we go. I am 
 trying to do two queries on a database - one after the other, but the 
 second one never seems to get executed. The two queries are identical 
 except for two variables. I have checked my form and they are correct 
 and are being sent to the PHP script the way they should be.
 
 The variables are $playerto, $playerfrom, $nameto, $namefrom. The 'TO'

 query is the one that doesn't work.
 
 Here is my code. Any help is appreciated.
 
 if ($namefrom != $nameto) {
   if ($playerfrom != $playerto) {
 
   include(2004server.inc);
   if($error) {
   include(trades-input.php);
   exit;
   }
 
   $query1 = select manager.idn, manager.total,
 roster.idp, position, points from roster join reference
   join manager where manager.idn=reference.idn and 
 reference.idp=roster.idp and manager.idn like '$namefrom' and
   roster.idp like '$playerfrom';
 
   $result1 = mysql_query($query1) or $mysqlerror =
mysql_error();
   if ($mysqlerror) {
   $error = $d_base_error$email_error;
   include(trades-input.php);
   exit;
   }
 
   $line = mysql_fetch_row($result1);
 
   mysql_free_result($result1);
 
   $query2 = select manager.idn, manager.total,
 roster.idp, position, points from roster join reference
   join manager where manager.idn=reference.idn and 
 reference.idp=roster.idp and manager.idn like '$nameto' and
   roster.idp like '$playerto';
 
   $result2 = mysql_query($query2) or $mysqlerror =
mysql_error();
   if ($mysqlerror) {
   $error = $d_base_error$email_error;
   include(trades-inputs.php);
   exit;
   }
 
   $row = mysql_fetch_array($result2);
 
   mysql_free_result($result2);
   }
 }
 
 
 --
 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]


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



What's up with this GATOR crap?

2003-07-10 Thread C. Reeve
Hi,

I have noticed recently that every time I go to the MySQL manual page I
get prompted to install Gator spyware. If MySQL condones or is going to
use spyware, I may have to consider using another database.

This may sound extreme, but I do not condone the use of spyware in any
form and would hope that others feel the same way.

Comments



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



Re: Fw: Help, Insert not working.

2003-03-27 Thread C. Reeve
Would you care to elaborate on that - Using PHP there is no error or return
code - it just goes along happily saying the record was inserted. If there
is a way to do this, please explain.

TIA

- Original Message -
From: gerald_clark [EMAIL PROTECTED]
To: C. Reeve [EMAIL PROTECTED]
Cc: MySQL List [EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 9:32 AM
Subject: Re: Fw: Help, Insert not working.


 Try reading your return codes.
 You got a duplicate key error that you were ignoring.
 C. Reeve wrote:

 I got it - stupid me has a unique field that I wasn't using in the test
 script I was using - so every I tried to add an entry this field was a
 duplicate and as such did not add the record.  Is there a way to put
 something in so mysql would tell me this - 2 hours pissing around for an
 oversight.
 
 TIA
 
 - Original Message -
 From: C. Reeve [EMAIL PROTECTED]
 To: MySQL List [EMAIL PROTECTED]
 Sent: Thursday, March 27, 2003 1:47 AM
 Subject: Help, Insert not working.
 
 
 
 
 Can anyone explain why this isn't working? It will not input the info
into
 the database.
 
 $db = mysql_connect($serverhost, $serveruser, $serverpass);
 mysql_select_db($database_name);
 
 The variables in the above two rows are correct - I can do selects and
it
 works fine.
 
 This is the data to be inserted and they are there
 
echo BR.$entered_email;
echo BR.$entered_passwd;
echo BR.$name;
 
 Nothing happens.
 
  mysql_query (INSERT INTO userdata (email, passwd, firstname, alias)
 
 
 VALUES
 
 
 ('$entered_email','$entered_passwd','$name','Hello'));
 
 
 TIA
 
 
 
 
 
 
 
 
 






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



Help, Insert not working.

2003-03-26 Thread C. Reeve
Can anyone explain why this isn't working? It will not input the info into
the database.

$db = mysql_connect($serverhost, $serveruser, $serverpass);
mysql_select_db($database_name);

The variables in the above two rows are correct - I can do selects and it
works fine.

This is the data to be inserted and they are there

   echo BR.$entered_email;
   echo BR.$entered_passwd;
   echo BR.$name;

Nothing happens.

 mysql_query (INSERT INTO userdata (email, passwd, firstname) VALUES
('$entered_email','$entered_passwd','$name'));


TIA




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



Fw: Help, Insert not working.

2003-03-26 Thread C. Reeve
I got it - stupid me has a unique field that I wasn't using in the test
script I was using - so every I tried to add an entry this field was a
duplicate and as such did not add the record.  Is there a way to put
something in so mysql would tell me this - 2 hours pissing around for an
oversight.

TIA

- Original Message -
From: C. Reeve [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 1:47 AM
Subject: Help, Insert not working.


 Can anyone explain why this isn't working? It will not input the info into
 the database.

 $db = mysql_connect($serverhost, $serveruser, $serverpass);
 mysql_select_db($database_name);

 The variables in the above two rows are correct - I can do selects and it
 works fine.

 This is the data to be inserted and they are there

echo BR.$entered_email;
echo BR.$entered_passwd;
echo BR.$name;

 Nothing happens.

  mysql_query (INSERT INTO userdata (email, passwd, firstname, alias)
VALUES
 ('$entered_email','$entered_passwd','$name','Hello'));


 TIA





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



Remote Administration

2003-03-14 Thread C. Reeve
Hi,

How would I go about setting up remote administration of MySQL. MySQL is
running on Windows 2000 and I will be connecting from Windows XP. I saw
something in the MySQL docs about using an SSH client like Secure CRT, but
it loses me at the linking OBDC.

Any help on this or another similar way to do remote administration is
appreciated..




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Part Mysql part PHP question....

2003-03-08 Thread C. Reeve
Hi,

I have a hockey database with players names in it and I want to be able to
update their stats one after the other. To be more clear - when the page is
first entered I want the first players name to automatically appear showing
his current stats (this will be in a form). Then you can update the record
and write it back to the database, then the next player will show up with
his stats showing, and the process continues until all the players have been
done. Setting up the database and forms is no problem, but I'm not sure how
I would keep count of what player has been done so the next one
automatically appears (and if there should be a power failure orWindows
crashes, or whatever else - I want the process to start at the last player
being updated - I don't want to have to start again from player one).  I'm
not sure if this is more a PHP or MySQL question - or both - so I have sent
it to both lists.

Thanks

C. Reeve



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Using SUM in a select statement.

2003-03-02 Thread C. Reeve
Hi, Not sure how to explain this - but here is what I need.   I have a
hockey pool database with three tables - one has the players and their
stats, one has the team owner, and the 3rd is the reference file that ties
the two together.

I want to be able to do a query for all the players on a particular team
that are forwards and get a grand total of all their points. I already have
a query that does something similar, but it just displays the individual
players stats.

Example:

Team 1PlayerPosition GoalsPoints

*Bob Bonk  F   2250
HossaF3341

Total5591  This is what
I want to achieve - and then the same for the rest of the teams.

*This is my query that get the individual players points.

$query = select team.name, player, position, gp, goals, ppg, gwg, shg, ass,
pm, shots, pim, points from roster join reference join  team where
team.idn=reference.idn and reference.idp=roster.idp and team.idn = '$team'
and position like '$position' order by points desc;

TIA



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: Using SUM in a select statement.

2003-03-02 Thread C. Reeve
Hmm, after seeing this it looks as if the way I have it is a lot simpler and
easier to handle. Currently I just put them in a PHP array and sum the
array. Thanks for the input.


- Original Message -
From: Tore Bostrup [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 1:12 PM
Subject: Re: Using SUM in a select statement.


 What you are looking for appears to be report layout.  Keep in mind that
SQL
 will only return multiple rows, all with the same columns populated.

 To even get close to what you want, you can create a query that returns:

 TeamOwner, Player, Position, Goals, Points

 And then your application can massage it into the output format you want.

 A query to return BOTH detail information on players AND summary
information
 on owners would have to be a union of two queries - one returning the
player
 information and the other returning owner summary information (UNION
 requires version 4.0):

 SELECT O.OwnerName,
 1 as SortOrder,
 P.Player,
 P.Position,
 Goals,
 Points
 FROM owners as O
 INNER JOIN teamplayers as T
 ON O.OwnerID = T.OwnerID
 INNER JOIN players as P
 ON T.PlayerID = P.PlayerID

 UNION

 SELECTO.OwnerName,
 2 as SortOrder,
 'Total' as Player,
 P.Position,
 Sum(Goals) as Goals,
 Sum(Points) as Points
 FROM owners as O
 INNER JOIN teamplayers as T
 ON O.OwnerID = T.OwnerID
 INNER JOIN players as P
 ON T.PlayerID = P.PlayerID
 GROUP BY O.OwnerName,
 SortOrder,
 Player,
 P.Position

 ORDER BY O.OwnerName,
 SortOrder,
 Player,
 P.Position


 Based on this, it is basically a question of suppressing repeated values
of
 OwnerName.

 Adjust the query to match your actual situation.  If you are using version
 3.23, AFAIK you'll either have to use two separate queries or calculate
the
 totals in your app from the detail data.

 HTH,
 Tore.


 - Original Message -
 From: C. Reeve [EMAIL PROTECTED]
 To: MySQL List [EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 11:54 AM
 Subject: Using SUM in a select statement.


  Hi, Not sure how to explain this - but here is what I need.   I have a
  hockey pool database with three tables - one has the players and their
  stats, one has the team owner, and the 3rd is the reference file that
ties
  the two together.
 
  I want to be able to do a query for all the players on a particular team
  that are forwards and get a grand total of all their points. I already
 have
  a query that does something similar, but it just displays the individual
  players stats.
 
  Example:
 
  Team 1PlayerPosition GoalsPoints
 
  *Bob Bonk  F   2250
  HossaF3341
 
  Total5591  This is
 what
  I want to achieve - and then the same for the rest of the teams.
 
  *This is my query that get the individual players points.
 
  $query = select team.name, player, position, gp, goals, ppg, gwg, shg,
 ass,
  pm, shots, pim, points from roster join reference join  team where
  team.idn=reference.idn and reference.idp=roster.idp and team.idn =
'$team'
  and position like '$position' order by points desc;
 
  TIA
 
 
 
  -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
[EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Testing

2003-02-10 Thread C. Reeve
Testing - Mysql


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Select question

2003-02-09 Thread C. Reeve
Hi,

 I have a database with 3 names in it. In each of these names is 5
categories  that have numbers in them. I want to be able to do a select and
get the top  number from each category for each name and display them from
most to least.  I have checked all the docs on the select statement, but
this is escaping me  at the moment.

 TIA

 i.e

 This is what is in the database.

 Bill  3620504670
John2630324846
Fred8740196242

This is what I want to be able to show:

Fred   87
Bill 70
John   48


SPAM bypass:  sql, query, queries, smallint



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Select question

2003-02-09 Thread C. Reeve
Hi again,

After some struggling, I have managed to get the problem below 99% working,
the problem now is that I can't get them in descending order. Here is my
select statement.

   $query = select manager.name, position, MAX(goals) from roster join
reference join manager where
   manager.idn=reference.idn and reference.idp=roster.idp and position like
'F'
   GROUP BY manager.name order by goals desc;

Using the example below, this is what I get:

Bill 70
John   48
Fred   87

This is what I want:

Fred   87
Bill 70
John   48

TIA
- Original Message -
From: C. Reeve [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Friday, February 07, 2003 1:57 PM
Subject: Select question


 Hi,

  I have a database with 3 names in it. In each of these names is 5
 categories  that have numbers in them. I want to be able to do a select
and
 get the top  number from each category for each name and display them from
 most to least.  I have checked all the docs on the select statement, but
 this is escaping me  at the moment.

  TIA

  i.e

  This is what is in the database.

  Bill  3620504670
 John2630324846
 Fred8740196242

 This is what I want to be able to show:

 Fred   87
 Bill 70
 John   48


 SPAM bypass:  sql, query, queries, smallint




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Fw: Problem on WinXP

2003-01-14 Thread C. Reeve
Nope, same thing - and XP's firewall is not enabled, so this is not an
issue. Also, it works on port 3306 fine. When I run a netstat it says it is
listening on port 3308 and I get 'mysqld: ready for connections', however,
that port is not active. When I scan my PC this port is not open. I can't
telnet to it or see it in any other way.

Beauford

- Original Message -
From: miguel solórzano [EMAIL PROTECTED]
To: C. Reeve [EMAIL PROTECTED]; MySQL List
[EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 3:49 AM
Subject: Re: Fw: Problem on WinXP


At 01:29 14/01/2003 -0500, C. Reeve wrote:
Hi,

I just uninstalled and reinstalled and got it to work on port 3306, but I
can't get it to work on any other port. As I said, I have changed this in
my.ini. Is there something else I should be doing to get this to work on a
non-standard port.?

Of course:

Microsoft Windows 2000 [Versão 5.00.2195]
(C) Copyright 1985-1999 Microsoft Corp.

c:\mysql\binmysqld --standalone --console --port=3308
mysqld: ready for connections

in another DOS screen:

Microsoft Windows 2000 [Versão 5.00.2195]
(C) Copyright 1985-1999 Microsoft Corp.

c:\mysql\binnetstat -a -n

Conexões ativas

   Proto  Endereço local Endereço externo   Estado
   TCP0.0.0.0:1350.0.0.0:0  LISTENING
   TCP0.0.0.0:4450.0.0.0:0  LISTENING
   TCP0.0.0.0:1025   0.0.0.0:0  LISTENING
   TCP0.0.0.0:1026   0.0.0.0:0  LISTENING
   TCP0.0.0.0:1029   0.0.0.0:0  LISTENING
   TCP0.0.0.0:2523   0.0.0.0:0  LISTENING
   TCP0.0.0.0:3308   0.0.0.0:0  LISTENING
   TCP0.0.0.0:3372   0.0.0.0:0  LISTENING
   TCP0.0.0.0:4873   0.0.0.0:0  LISTENING
   TCP192.168.0.75:139   0.0.0.0:0  LISTENING

If you are having problems on XP, I guess your problem is the
the XP's own built fire-wall.


--
Regards,
__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /Miguel Angel Solórzano [EMAIL PROTECTED]
  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   São Paulo - Brazil
___/   www.mysql.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Notice: Undefined index:

2003-01-14 Thread C. Reeve
Hi,

Anyone know why I would be receiving this error in Windows. I have a small
PHP script that accesses a MySQL database and prints out a couple lines.
This works fine in LinuxI have searched google and found many users with
the same problem, but not one solution.

TIA

Notice: Undefined index: lastname in E:\IIS Webs\index.php on line 29

?

PRINT HTML;
PRINT HEAD;
PRINT TITLEADDRESSES/title;

PRINT /HEAD;

PRINT BODY BGCOLOR=white TEXT=#00 LINK=#FF VLINK=#66
aLINK=#FF;

mysql_pconnect(127.0.0.1:3308, user, pass) or
die(could not connect);
mysql_select_db(address);

$query = SELECT lastname, firstname, city FROM data;
$result = mysql_query ($query);

while ($line = mysql_fetch_row($result)) {

echo BR.$line['lastname'];
echo BR.$line['firstname'];
echo BR.$line['city'].BR;

}

?



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Problem on WinXP

2003-01-13 Thread C. Reeve
Hi,

I just installed MySQL on my WinXP box and not sure what's going on. The
server starts (or so it says it does) but I get an error saying I can't
connect to localhost. Not sure what else to say. I have included some info
below (note that I changed the port to 3308 in my.ini as Linux Mysql is
using 3306 - although using 3306 does nothing for Windows). A scan of my
Windows machine shows that neither of these ports are open. I am also behind
a Linksys router and have forwarding directed to Windows on port 3308. Any
info is appreciated.

I have done some searches on this error and have not come up with anything
that works.

TIA

D:\Language\MySQL 3.23\binnet start mysql
The MySql service is starting.
The MySql service was started successfully.

D:\Language\MySQL 3.23\binmysqladmin create dbtest
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'

D:\Language\MySQL 3.23\binmysql
ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)

[mysqld]
basedir=D:/Language/MySQL 3.23
#bind-address=192.168.1.100
datadir=D:/Language/MySQL 3.23/data
#language=D:/Language/MySQL 3.23/share/your language directory
#slow query log#=
#tmpdir#=
port=3308
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=D:/Language/MySQL 3.23/bin/mysqld-nt.exe
user=xxx
password=xxx
QueryInterval=10




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Fw: Problem on WinXP

2003-01-13 Thread C. Reeve
Hi,

I just uninstalled and reinstalled and got it to work on port 3306, but I
can't get it to work on any other port. As I said, I have changed this in
my.ini. Is there something else I should be doing to get this to work on a
non-standard port.?

TIA

- Original Message -
From: C. Reeve [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 12:54 AM
Subject: Problem on WinXP


 Hi,

 I just installed MySQL on my WinXP box and not sure what's going on. The
 server starts (or so it says it does) but I get an error saying I can't
 connect to localhost. Not sure what else to say. I have included some info
 below (note that I changed the port to 3308 in my.ini as Linux Mysql is
 using 3306 - although using 3306 does nothing for Windows). A scan of my
 Windows machine shows that neither of these ports are open. I am also
behind
 a Linksys router and have forwarding directed to Windows on port 3308. Any
 info is appreciated.

 I have done some searches on this error and have not come up with anything
 that works.

 TIA

 D:\Language\MySQL 3.23\binnet start mysql
 The MySql service is starting.
 The MySql service was started successfully.

 D:\Language\MySQL 3.23\binmysqladmin create dbtest
 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'

 D:\Language\MySQL 3.23\binmysql
 ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)

 [mysqld]
 basedir=D:/Language/MySQL 3.23
 #bind-address=192.168.1.100
 datadir=D:/Language/MySQL 3.23/data
 #language=D:/Language/MySQL 3.23/share/your language directory
 #slow query log#=
 #tmpdir#=
 port=3308
 #set-variable=key_buffer=16M
 [WinMySQLadmin]
 Server=D:/Language/MySQL 3.23/bin/mysqld-nt.exe
 user=xxx
 password=xxx
 QueryInterval=10




 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: MySQL and PHP question

2002-12-18 Thread C. Reeve
Thanks for the info. I tried using mysql_free_result()  and mysql_close($db)
and opening the DB again for the second query with the same results. I
haven't tried using a different variable for $result.

- Original Message -
From: Steve Yates [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 1:32 AM
Subject: Re: MySQL and PHP question


 On Wed, 18 Dec 2002 22:54:53 -0500, C. Reeve wrote:
 while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
 $num1 = $line['number'];
 }

 Loop through the result and return the value from the last row?
  Did you want select sum(number) as SubTotal1 from table1 where
 userid=$user1?

 $query select number from table2 where userid=$user2;
 $result = mysql_query($query) or die(Query failed);

 You re-used the same variable $result.  Offhand I would try
 using a second variable, and/or using mysql_free_result() in between.

  - Steve Yates
  - My hard disk is full!  Maybe I'll try this message section thing.

 ~ Taglines by Taglinator - www.srtware.com ~


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




$Variables and Select statements

2002-12-18 Thread C. Reeve
Hi,

From the code below $wk  gets the values (w1, w2, w3, etc.) as it goes
through the 'for' loop. w1, w2, etc. are also colums in the table manager.
What I can't figure out is why the select statement fails (no error, just no
data) when I use $wk as apposed to hardcoding w1, w2, etc. Is this possible
or am I missing something?

Note: the colums w1, w2, etc contain numbers which I am trying to select.

TIA

$db = mysql_connect(xx,xx,xx);
mysql_select_db(database);

echo TABLE ALIGN=center WIDTH=200 BORDER=0TR\n;

for ($i = 1; $i  26; $i++) {

$wk = w$i;

echo TR Width=200TD ALIGN=center COLSPAN=2BWeek
.$i./B/TD/TR\n;
echo TR Width=200TD COLSPAN=2HR SIZE=5/TD/TRTR\n;
echo TR WIDTH=100TD ALIGN=leftBName/B/TDTD
ALIGN=rightBPoints/B/TD;
echo TR Width=100TD/TD/TR\n;

$query = select name, $wk from manager order by $wk desc;
$result = mysql_query($query) or die(Query failed);

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {

echo TR WIDTH=150TD ALIGN=left.$line['name']./TDTD
ALIGN=right.$line['$wk']./TD;

}

echo TR Width=200TD COLSPAN=2HR SIZE=5/TD/TR\n;


}



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: $Variables and Select statements

2002-12-18 Thread C. Reeve
Thanks for the information, I will try that in this situation, however, I
have done this in other select statements and it has worked fine. I will
follow-up in the PHP list if I still have problems.

Please note also that since I assumed this was a MySQL problem I posted it
to this group. Since these two programs are so closely interlinked, it is
hard for us newbies to tell where the problem may lie. I have in the past
posted a question to both groups as I wasn't sure of it either. These lists
are for those that know and those that don't and both have to be tolerant of
the other.

Beauford

- Original Message -
From: Basil Hussain [EMAIL PROTECTED]
To: C. Reeve [EMAIL PROTECTED]; MySQL List
[EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 11:57 AM
Subject: RE: $Variables and Select statements


 Hi,

  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
 
  echo TR WIDTH=150TD
  ALIGN=left.$line['name']./TDTD
  ALIGN=right.$line['$wk']./TD;
 
  }

 Here is your problem. Your are indeed substituting $wk into the query
 correctly, but when you go to output the result rows you are not.

 You should simply remove the quote marks from:

 $line['$wk']

 so that it is:

 $line[$wk]

 PHP does not interpret variable names in single-quoted strings - only in
 double-quoted strings. With your current code, PHP is only looking for an
 array element called '$wk', which doesn't exist!

 In future, may I suggest you that post questions like this to the PHP
 mailing list, as this is nothing to do with MySQL.

 Regards,

 Basil Hussain
 ---
 Internet Developer, Kodak Weddings
 E-Mail: [EMAIL PROTECTED]


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




MySQL and PHP question

2002-12-17 Thread C. Reeve
Hi,

Why is it that I can not use two mysql queries in the same PHP file. I have
tried to do this several times trying to put my site together and have had
nothing but problems.

The recent one is this:

I use a SELECT statement to get some info from a table, then I modify that
info and use an UPDATE statement to update another table. The update does
not work (all variables used by PHP contain the proper values as does the
info selected from the table).

I get no errors as it appears the update worked, but the table was not
updated.

I have also found that I can not do two select statements in the same PHP
file, as the second one will not contain any data . The query does not fail,
there is just no data.

Any info is appreciated.

TIA





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: MySQL and PHP question

2002-12-17 Thread C. Reeve
 I've since deleted the code and did it another way. The code however went
something like this. This is just a mock up (there is more being selected
etc and there are some joins, but the syntax is exact).

So what happens is the select statement with $user1 in it gets the proper
values (the first one in the example), the other one doesn't, but if I
change $user1 and $user2 around the second select will get the values.

So on the surface it sounds like a problem with $user2, but I have run
extensive tests and $user2 gets the proper values (they both come from a
form).

In another project I am doing, I tried a similar feat with totally different
values and got the same results. This time I was trying to do one SELECT and
one UPDATE.

If anyone has any ideas it would be appreciated. Also, if there is a better
way to do the following this would also be appreciated.

$query select number from table1 where userid=$user1;
$result = mysql_query($query) or die(Query failed);

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$num1 = $line['number'];
}

$query select number from table2 where userid=$user2;
$result = mysql_query($query) or die(Query failed);

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$num2 = $line['number'];
}

$total = $num1 + $num2;

mysql_query(UPDATE table3 SET total = '$total' WHERE userid=$user);

TIA

- Original Message -
From: Steve Yates [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 5:12 PM
Subject: Re: MySQL and PHP question


 On Wed, 18 Dec 2002 16:05:35 -0500, C. Reeve wrote:

 I can not use two mysql queries in the same PHP file

 Please post code snippets, this is possible.

  - Steve Yates
  - Burger Borg:  We do it our way; yours is irrelevant.

 ~ Taglines by Taglinator - www.srtware.com ~


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Select / Calculate question

2002-12-16 Thread C. Reeve
Hi,

I have one table with an id1 column and a number column, these numbers
correspond to another table with an id2 column and a name column and a total
column. I also have a reference table with ties the two together (an id1 and
id2 column).

 I want to be able to select all numbers in the first table that correspond
to the name in the second column and add them together and place them in the
total column of the second table, but whatever I have done has failed.

 Can anyone suggest a way of doing this?

 TIA

 Table1Table2Reference

 id1  number id2nametotalid1id2

 1101John   6011
1202Mary  9022
130etc.   etc.
240
250
etc.

























(MySQL, Query)



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




What is wrong with this Alter statement?

2002-12-15 Thread C. Reeve
From the MySQL Manual:

ALTER TABLE tbl_name MODIFY [COLUMN] create_definition [FIRST | AFTER
column_name]

I have also tried CHANGE instead of MODIFY.

My Statement:

alter table manager change column w1 decimal(8,2) not null after moves;

The problem is the AFTER statement, if I omit it I have no problem. Now I'm
probably reading this wrong but in any event I need my columns to be in a
certain order and their not. Without deleting them and re-adding them (and
the data) - how do I get them in the order I need?

i.e w1, w2, w3, w4 .. w25  not  w13, w21, w2, w9  w4, w1. (I have no
idea how they even got messed up as I created them in order. Up arrow,
change number, up arrow, change numberetc, etc.

I'm ranting, but this is really ticking me.

TIA



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php