RE: PHP Question

2002-04-11 Thread Andreas Frøsting

Hi,

> Ok so this really doesnt have anything to do with MySQL but I 
> thought this
> might be a good placeto ask.

Why?
As you say, it's not in any way related to MySQL.

> reload the page and postthe message again! doh!
> Anyways, has anyone come up against a similar problem and found a
> way around it?

Take a look at the header() function and please make use of the
php-mailinglist next time.

:wq
//andreas
http://phpwizard.dk


-
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: RE: phpMyAdmin issue + looking for php/mysql websites

2002-03-26 Thread Andreas Frøsting

> Your message cannot be posted because it appears to be either spam or
> simply off topic to our filter. To bypass the filter you must include
> one of the following words in your message:
> 
> sql,query

Gaah..

> Hi,
> 
> > I use PHP (cgi) with IIS and phpMyAdmin.  The
> > problem with the header
> > function is just that a couple of the .inc files
> > with phpMyAdmin need to
> > have the extra lines after the ?> deleted.
> 
> If that was the case, phpMyAdmin wouldn't be working with any other
> webserver... Well, it does!
> PHP's behavior regarding headers and data sent before the 
> headers itself
> is the same on all platforms.
> 
> > But,
> > that message says that the
> > headers have already been sent out.
> 
> I've never worked with IIS, but that's a Microsoft-style error message
> if that's true.
> 
> > The error below
> > usually means a 404
> > error if you are using a template.  If not, it
> > usually means that you have
> > forgotten something like a curly brace or a script
> > ending.
> 
> If it was a 404 the server would say so.
> If it's a script error php would say something like "Parse error...
> blahblah" :)
> 
> :wq
> //andreas


-
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: phpMyAdmin issue + looking for php/mysql websites

2002-03-26 Thread Andreas Frøsting

>  "The specified CGI application misbehaved by not
> returning a complete set of HTTP headers. The headers
> it did return are:"

Looks like you're running phpMyAdmin on a machine with Windows and PHP
in CGI-mode?
I don't recall if it's PHP in CGI-mode on Windows that in general
doesn't work with the header()-function or if it's only IIS.

The solution is to install PHP as non-cgi... Don't know how that is done
as I'm using FreeBSD, but know you know whats wrong :)

> I dont think i set up mySQL properly maybe ?

The problem is not related to MySQL.

:wq
//andreas
http://phpwizard.dk/ (in Danish only)


-
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: server startup error on linux

2002-03-21 Thread Andreas Frøsting

> I assume that the mysql daemon is looking for one of those 
> owned by mysql.
> 
> The server will start if I send the --skip-grant-tables option
> 
> Who wants to run a database with no grant tables

Find out where your databases are located.
Think /var/db/mysql is the default.

Go there and type:

  chown -Rf mysql:mysql *

to change ownership of databases and tables.

Note that mysql:mysql is user:group and if the mysql-user and/or group
is different from 'mysql' you should change it.

:wq
//andreas
http://phpwizard.dk (in Danish only)
sql, 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




RE: server startup error on linux

2002-03-21 Thread Andreas Frøsting

> I assume that the mysql daemon is looking for one of those 
> owned by mysql.
> 
> The server will start if I send the --skip-grant-tables option
> 
> Who wants to run a database with no grant tables

Find out where your databases are located.
Think /var/db/mysql is the default.

Go there and type:

  chown -Rf mysql:mysql *

to change ownership of databases and tables.

Note that mysql:mysql is user:group and if the mysql-user and/or group
is different from 'mysql' you should change it.

:wq
//andreas
http://phpwizard.dk (in Danish only)


-
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: Sub-select look-alike?

2002-03-13 Thread Andreas Frøsting

Hi Greg,

> SELECT f.language as From, t.language as To
> FROM language f, language t, language_pairs lp
> WHERE f.id = lp.from
>   AND t.id = lp.to;

I really need to get some sleep I think.
So simple, and yet my buggy mind didn't come up with that solution.

Thanks,
//andreas
(sql, query - just to satisfy the filter)


-
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




Sub-select look-alike?

2002-03-13 Thread Andreas Frøsting

Hi,

I have two tables:

  languages:
id tinyint(3) unsigned not null,
language   varchar(30) not null

  language_pairs:
from   tinyint(3) unsigned not null,
to tinyint(3) unsigned not null

language_pairs.from and language_pairs.to are linked with languages.id

(both tables are simplified in this mail and contains a lot more
columns, but they are not relevant)

Now I want to do a query giving me the names of the languages
(languages.language) instead of language_pairs.from og .to.

I can only see a solution requiring the use of sub-selects which MySQL
doesn't (yet :) has support for.
Anyone smarter than me who can see a solution?

I want to avoid use of sub-queries if possible, and my emergency plan is
to extract all records from `languages` into an array in PHP and simply
use PHP to join .from and .to with the matching language. That's not in
any way optimal, that's why I'm asking you guys :)

regards,

//andreas
http://phpwizard.dk (in Danish only)


-
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: databases under users dir

2002-03-09 Thread Andreas Frøsting

Hi,

> Anyone know if its possible to have mysql databases under 
> $HOME for users.
> I am running RH7.2 and have virtualhosts under apache 1.3.22 
> so i am hoping
> i can put databases under each user account in order to 
> control (quota's)
> etc.

You can put them under each users homedir and symlink to them.
I've used that method a couple of times where I had some pretty large
tables taking up too much space on a particular partition.

Remember to shut down mysql before moving the databases and remember to
preserve ownership and rights to the files.

:wq
//andreas
http://phpwizard.dk (in Danish only)


-
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: order by date error!!!

2002-02-27 Thread Andreas Frøsting

> But if I change the output format with: DATE_FORMAT(data,'%d-%m-%Y'),
> the order by clause attempt to order the new format 
> incorrectly, because
> I've an output like this: 12-2-2002, 12-3-2002, 12-4-2002, 
> and 13-2-2002!!!

I normally do this:

SELECT DATE_FORMAT(datefield,'%d-%m-%Y') as datefield FROM table ORDER
BY table.datefield

This forces mysql to order by the data in the table instead of the
result 'datefield' (note the same name of both the field and the
result).

:wq
//andreas
http://phpwizard.dk


-
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: Warning: mysql is deprecated???

2002-02-17 Thread Andreas Frøsting

> mysql_select_db("$DBName");
> mysql_query("SELECT Date,BuyerID,OrderNumber FROM Buyers")
> 
> How do I assign the variable to both of those lines that make 
> up the DB
> call???

Unless you're planning to use several databases, you only have to use
mysql_select_db($DBName); once, normally where you connect to the
database.

In that way it can be cut down to:

$result = mysql_query("SELECT Date,BuyerID,OrderNumber FROM Buyers");

regards,
//andreas
http://phpwizard.dk (in Danish)


-
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: Warning: mysql is deprecated???

2002-02-17 Thread Andreas Frøsting

> > It means something is out of date...looks like you need an update of
> > something...
> 
> This is the line 7 that it is talking about How do I know 
> what is out of
> date and how to fix it? Are there any utilities out there for updating
> scripts or do I need to manually go into each .php file and 
> update them
> somehow?

That's normally done by hand.
I don't know any utils capable of doing that, but as you've experienced
PHP will let you know when you are using deprecated functions :)

> use mysql_select_db() and mysql_query() instead 
> mysql("$DBName","INSERT INTO
> Category VALUES('$Category','')");

That would be:
mysql_select_db($DBName);
mysql_query("INSERT INTO Category VALUES('$Category','')");

or

mysql_db_query($DBName,"INSERT INTO Category VALUES('$Category','')");

regards,
//andreas
http://phpwizard.dk (in Danish)


-
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: Warning: mysql is deprecated???

2002-02-17 Thread Andreas Frøsting

Hi,

> Warning: mysql is deprecated; use mysql_select_db() and mysql_query()
> instead in (rootPath here)\cart\admin\addcategoryresponse.php 
> on line 7

[snip]

> What does depricated mean? I have searched the manual and the 
> resources
> online but cannot find anything about it. Does it mean that 
> the SQL commands
> that are used in the php script are out dated and need to be changes
> to...( use mysql_select_db() and mysql_query() instead ) what 
> the warning
> says???

Unfortunately for you, yes.

The PHP function 'mysql()' is outdated, and it's been replaced with
mysql_select_db() and mysql_query() as the error says.

I see two possible solutions:

1. Downgrade your PHP to a version where 'mysql()' is not deprecated
(version 3.* i think).

or

2. Change all instances of 'mysql()' to 'mysql_query()' and make sure to
use 'mysql_select_db()' to choose your database or use
'mysql_db_query()' instead.

regards,
//andreas
http://phpwizard.dk (in Danish)


-
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: Error untarring MySQL on a RAQ3

2002-02-16 Thread Andreas Frøsting

>   tar -xvfz mysql-3.23.32.tar.gz
>   tar: Cannot open z: No such file or directory 
>   tar: Error is not recoverable: exiting now
> Any Help? Should there be a z: directory? And where?

Try:

tar zxvf mysql-3.23.32.tar.gz

z = gzipped
x = eXtract
v = verbose
f = file

You had a 'z' after the 'f', therefore tar thought 'z' was the file to
untar :)

:wq
//andreas
http://phpwizard.dk


-
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




Unique index/primary key case-insensitive?

2002-02-15 Thread Andreas Frøsting

Hi there,

I'm having som difficulties trying to figure out MySQL's unique indexes
and primary keys.

Case:
mysql> create table flaf (lala varchar(20) not null, unique(lala));
  Query OK, 0 rows affected (0.00 sec)

mysql> insert into flaf VALUES ('hest');
  Query OK, 1 row affected (0.00 sec)

mysql> insert into flaf VALUES ('Hest');
  ERROR 1062: Duplicate entry 'Hest' for key 1

Here, the unique index sees "Hest" as "hest", and because of that the
second row is not inserted.

Why does MySQL have this strange behavoir, treating unique indexes
case-insensitive?
Same thing happens if I use a primary key for the column 'lala'.

Similar test in postgresql seems more logical to me:
hroi=# create table flaf(gnyf char(4) unique); 
  NOTICE:  CREATE TABLE/UNIQUE will create implicit index
'flaf_gnyf_key' for table 'flaf' 
  CREATE 

hroi=# insert into flaf values ('hest'); 
  INSERT 2722204 1 

hroi=# insert into flaf values ('hest'); 
  ERROR:  Cannot insert a duplicate key into unique index flaf_gnyf_key 

hroi=# insert into flaf values ('Hest'); 
  INSERT 2722206 1

Can anyone explain MySQL's behaviour and how I do a workaround making
unique indexes and primary keys case sensitive?
I've been over the documentation a couple times now unable to find
anything.

regards,

//andreas
http://phpwizard.dk


-
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