gday i did an rsync of a whole box for xen but when i try to run queries on some tables on the new box supposedly

hi

hi

I need to log the select statements to a specific database (this is temporary for debugging only)
what options do I have?
I need t do it at mysql level, the app is not capable of such tracing

i am not sure if you can log these to db.. but you can make mysql log all queries to logfile

yes yes
to a logfile
but the logger logs only update/insert statements, doesn't it?
I need the selects

donno.. i always thought all queries are written, inserts or selects never mind… hm
slow queries are definitely logging selects

scratch that, you are right
I got confused with binlog
which indeed does not log selects
my bad

well yeah, binlog is about changes to db, while query log is for debug..
any idea how i can group query result by quarter-hours?

That could mean several things. Here's one: GROUP BY ceil(some_minutes/15)

hi
Anyone who could help me out with something propably really simple or everyone idiling?
(=sleeping)

ask

"I have a question", Don't ask: "Is anyone around?" or "Can anyone help?". Just Ask The Question

how can i say in mysql, that i need those records whose ids are not in a table's column?

okay, I create a table mytable with ID field that is INT(10) NOT NULL AUTO_INCREMENT and first field is then 1, I need to set first field to 0
I've set AUTO_INCREMENT = 0 on my query but that didn't help.

Listen to the_wench …
a not in b

SELECT a.* FROM a LEFT JOIN b ON a.id = b.id WHERE b.id IS NULL;

thx

You're welcome.

CREATE TABLE mytable(ID INT(10) NOT NULL AUTO_INCREMENT, PRIMARY KEY(ID), vdata TINYINT NOT NULL DEFAULT '1', fdata VARCHAR(250) NOT NULL DEFAULT '') AUTO_INCREMENT = 0

whats the query that tells you how many rows were found by a select statement, regardless of the LIMIT imposed on that select

I read from somwehre that AUTO_INCREMENT = value would set auto incremency to start from specific value.
able to help me ?

http://dev.mysql.com/doc/refman/4.1/en/limit-optimization.html
Talking to the bot?
That's correct. Do you have a problem with auto_increment?
You didn't actually ask a question.

g'day. i did an rsync of a whole box (for xen), but when i try to run queries on some tables on the new box (supposedly exact image of the old one), i get this error: "ERROR 1033 (HY000): Incorrect information in file: './rt3/Users.frm'". this Users.frm file has exactly the same md5sum as the
original. why might this happen?

you mysqldumped it?

.. no
i did an rsync on the original box while in single user mode (obviously i was not running mysqld or any other services)

Seems odd.

some tables seem fine too, others not

select * from tbl limit 10; and select * from tbl order by id limit 10; gives me two different results, is this a normal behavior?

yes

how can it be?
hm

why do you expect otherwise?

fritz[]: if you don't specify an order the order is undetermined

well, I would expect same result, but in second case that's ordered by ID … I'm getting totaly different results (another rows, not order problem)

fritz[]: the order is performed before the limit

can you take a look? pastebin.ca/637002

fritz[]: you should always specify an order

I see

.. especially if you are using limit

yes. auto increment starts from 1 even that I have set auto_increment = 1

That's correct behavior, don't you think?

yes. auto increment starts from 1 even that I have set auto_increment = 0

0 is not valid.

sorry, auto_increment should be set to 0.
I need it to start from 0.

Not possible.
Use a trigger.

trigger?

MySQL 5.0+ has triggers. Read the auto_increment docs to find out why 0 is not valid. 0 has special meaning, much like null.

nah, I'll just do INSERT INTO mytable (ID, vdata, fdata) VALUES('0','0','location)

Won't work if the field is auto_increment.

Okay, ALTER_TABLE ?

You won't be able to use 0 with auto_increment.

whats the mysql function for field value length?

It doesn't mean anything if there are ID's missng for e.g. ID1 missing, but first entry _must_ have ID=0

length() and char_length()

ah yes
char_length is what i want ay

can I do that? Change it with ALTER TABLE without running to troubles later?

Don't use auto_increment if you care about the specific values.
Yes. That will cause trouble later.

:/

Just try to copy data between two tales or dump and import that table.
s/tales/tables
The 0 will cause you great pain.

Why?

I jst explained it. NEVER use auto_increment (or sequence in oracle) if you care about the specific values.

It is a PHP software that I've been working with last 6 months, fields can be added and removed, except that first field that should always have ID 0.

Every chance the engine gets, it'll try to change the 0 to the next non-0 auto_increment value.

If I'd need to not use 0 in that, I'd need to write this thing from the beginning again.

Don't use 0 with auto_increment and more generally, don't use auto_increment if you care about the specific values being assigned.

I _need_ to use auto_increment because these fields can be removed and added but same ID number should never be used again.

This is fundamental. If you assumed otherwise, you've made a basic mistake.
This is not correctable, unless you remove the 0 or remove the auto_increment behavior.

When I started this project, I was planning to use my own database system designed for this purpose only, then I heard that I shouldn't as mysql for e.g. supports everything I ever could dream, so I'll study how to use it and now I hear that it won't
support most basic thing?

That's like saying "I need 1 to act like 2". It just won't happen, no matter how much you designed your application around 1 being 2..

If I remove the 0, my software no longer works as new ID number isn't being generated by automaticly and it doesn't keep record in anywhere about already used ID numbers.
If I remove the auto_increment, my software no longer works as new ID number isn't being generated by automaticly and it doesn't keep record in anywhere about already used ID numbers.

You aren't making sense. What possible harm could come from removing your use of 0 as a key value?

Programs security features break down totally.

What? You depend on a specific key value of 0?

YES

that's a huge mistake in any database.
Fundamental mistake.
never ever depend on having some specific value assigned when using automatically assigned keys.

That's why there was auto_increment = 0

Never ever expect them to be sequential. Never ever expect them to be always increasing.
The only thing you can depend on is that they are unique.

why? what kind of auto_increment is that then?

That's it.
Period.

That's enough, 2 doesn't have to come after 1, they just must be unique.
if 1 has been used and then deleted, it should not be used ever again.

There are all sorts of ways any of those assumptions can break when using transactions or in other cases.

Xgc is this possible?: SELECT * FROM users WHERE username='$username' OR email='$email' ?

Sure, but you should guard against injection problems.

yes it is.

Xgc trust me it is protected against sql injections with php webhosting :p

Look into prepared statements.

so why doesn't it say this about auto_increment on mysql.org where it tells about auto_increment?
If I'd knewn this thing I wouldn't need to rebuild my program from beginning?
but it's just that it reads in some secret location!
or only people who read mysql's source happen to know this..
and when this comes to programming, NULL = nothing 0=value of 0
so you can't even picture this thing as mysql does something that isn't quite standard, suddenly 0 equals to NULL?
what is the idea behind that?

It's in the notes following the main docs section. it should be explicit in the main section.

notes?
who reads notes when there is a manual?

All online documentation has a notes section where people can add information.

Xgc how do I lock into prepared statements?

Look?

*Look
well what are prepared statements?

php has prepared statement support for MySQL.
It's a way to bind variables to a statement, so that the data is transfered without the need for escaping special characters.

anyone know how well mysql hosting handles trigonometry functions over a innodb table?

you know where I can read documentation about it?:p

oh, with 5 million records?

is it supposed to be in section navigation part possibly?
http://dev.mysql.com/doc/refman/5.1/en/index.html

Lots of information: http://www.petefreitag.com/item/356.cfm
http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html

thanks :p

You're welcome.

Xgc so I have to remake my mysql class for it?:p

It's something you might want to learn for another time.

yeh thanks :p
but atm I'm checking every input on bad characters :p

That's error prone, but if you're careful (perfect), you'll be fine.

error prone?

http://dev.mysql.com/doc/refman/5.1/en/example-auto-increment.html
check comments, poset by gary affonso on march 29 2005 5:46pm
poset=posted
okay it reads in comments and I didn't read that part as usually comments is part where people speak about problems they have ran into..

anyone used the spatial extension?

okay, time to start doing the whole program from beginning then because mysql uses something that is non-standard, now Xgc, tell me this one thing, if I set auto_increment = 1 even though that it defaults to 1, is the first entry's ID _always_ 1 then?

Maybe I can help you with a solution. You haven't told me why you think you need to use 0.

it's a long story. You know forum system called SMF?

Listen closely. You should NEVER EVER exact any specific auto_increment number to be assigned. Just stop trying to do that. If you need specific values, assign them yourself.
s/exact/expect

yeah, thanks for help, that doesn't really help, if I'd need to set these values manually I'd need to create another table holding "used" values..

All you know is they will be the current auto_increment value for the table (or larger).
Even that probably isn't guaranteed.
But why on earth do you need a specific value?
That's your main problem.

because this specific value is used when processing data from another tables and also from files.

Why do you care which value is assigned? Just let it be assigned and if you need to know what it was, use SELECT last_insert_id(); per connection.

because 0 is hard coded!

For what purpose? What does 0 mean to the application?

I can hardcode it to any other number too, that just happens to take awful lot of time.
It means that if this specific value is 0, then administrator rights are set.
if it's something else, rights are set according to that number.
there are rights for every ID.

This is for some user table?

this if for system, it's not just for user, it's for _ALL_ that happens, 0=root
uthis if for system, it's not just for user, it's for _ALL_ that happens, 0=root/u

That is a serious problem. You need to separate that sort of meaning from the auto_assigned key.

you mean I should ditch the auto_increment?

This is not a mysql-specific issue. All databases that have auto_assigned values (or sequences in oracle) have this behavior. You would never assign meaning to an auto_assigned value prior to the assignment.

how can I capture the id of a row that is just inserted in the same inserting query?

No. You should ditch your assignment of meaning to a key prior to knowing you have the key.

if I cannot understand, sorry, there is a lingual barrier.

Insert Administrator record. It now has a key. You use that key by joining the record against other tables where type='admin'
You don't assume the key value of an auto_assigned column.

once again, that would mean that I need to program this whole thing from beginning.

If you need a specific value, you would NEVER do that in an auto_assigned column.
Correct. That was a critical mistake.
Now you know.

why does smf then use similar technology.
user's ID's use auto_increment.

You probaly misunderstand something in the application. No one would use an auto_assigned field to hold those values.

there is just one value that is hardcoded, 0.
I just need to know what _first_ value is and it never should change.

I understand how unix systems do this. it's a mistake to implement that with an auto_increment field in any database.

and if current forum's ID number is 0, this forum hosting has ability to create and delete forums (not boards, this software adds support for global database and easy and simple creation/removal of new forums and portals)

At least now (hopefully) you know not to do this again. If you have requirements for values, don't auto assign them. Explicitly assign them.

let me ask one thing. If I create this table with parameter auto_increment = 1 and after that I add a record to this table, is it always 1 ?

If you don't touch it, yes.

the first field cannot be touched with this software, it's supposed to be static and program protects it.

So you could, although not suggested, assign the first N values and start the auto_increment value at N+1. 0 is the exception.

or I could change my program to use 1 instead of 0.

To be safe, you could do that during system initialization / installation, prior to running the application.
You could.

this 1 id is added during installation.
1=first

Just push id=1 out of the way and assign your admin to that record.

admin is assigned by another table by other values. 0 as domainID means that user is admin also on any other domainID.

If you were lucky enough to design this with a constant that represents the admin id = 0, you could change this one constant in your application to 1; fix a few records and poof, all set.

but if I walk through _all_ the code and change domainid 0 to domain id 1 I should be able to get out of the problem.

While you're in there, use a constant identifier, not 1.

Impossible due to program nature.

Do you like php as a language?

no.
I use usually C.

This seems like an extreme restriction to not be able to do that easily.

I gave myself 2 days time to learn php until I started this project.

Wel, I wouldn't hold C up as any kind of proper example.

by program's nature I mean that this isn't actually an independent program.
It is a modification for SMF forum system. A huge modification.
But I try to keep it's code like the original is as much as possible.
Adding a constant to for e.g. Settings.php would change this a lot.

Is this open source?

my program or smf?

SMF.

yes and no. Smf 1.x.x is and 2.x.x is not. This is for 1.x.x
It's a php program, so yes, it is open source
to get 2.x.x beta you would need to pay big bucks
http://www.simplemachines.org
why do you ask?
my program also is open source and doesn't need to be paid, but it's not available until it's finished.
it's unfinished.
or why something has been implemented in such a stupid way I'll clean up as soon as it's finished and without this problem, that day should have been next friday.
it seems I'm talking just by myself..

Just curious what you were modifying.

I have now changed my installation to set first domainid value to 1 instead of 0. Now I need to walk through all code to use 1 instead of 0.
bulletin board system(=forum) but my code can tolerate also portal setup (tinyportal in this case)
bulletin board system(=forum) but my code can tolerate also portal setup (tinyportal in this case)

1.1.3 doesn't look too large.

1.1.2 isn't that large either. My mod is designed for 1.1.2 and I'll migrate to 1.1.3 as soon as it's finished but 1.1.3 does not have that many changes so migration propably doesn't need any changes at all.
unpacked is about 5-7 megabytes and modifications of mine add about 300kb to it.

hi there! does (mysql 3) has a random function? (i want to select a random ID)

select id from table order by random limit 1; I think

Use the docs or use google to find them: Google: mysql random … yields … http://dev.mysql.com/doc/refman/4.1/en/mathematical-functions.html
random

http://jan.kneschke.de/projects/mysql/order-by-rand/

Ok. That one isn't so helpful.

order by rand you mean Xgc ?

No. Use the first link I gave.

oke

Sorry. I missed your full question. Use the second link, shon by the_wench.
shown
roxlu, to you.

huh?

Mouse is all over the place.
Phone rings, baby crying, dogs barking. Sometimes I get the wrong nick.

no worries

Don't use order by rand() unless your list is very small. The post by Jan is pretty good.

hola

moin

moin moin

thanks
so I can't use order by rand() with large items?
large database I mean

Performance degrades significantly with larger sets. Read the article. If the performance is acceptable to you, fine.

okay

I'm using mysql_fetch_object… and when I add in a COUNT(id) into my SQL line it breaks saying "supplied argument is not a valid MySQL result resource".. can I not use COUNT when using mysql_fetch_object?

95kb left for source to walk through until hardcoded value 0 has been to 1.

though I'm using mysql 3.x for this :$

Good luck with that.

the database will have around 5000 items
mysql 3 doesn have ceil :-(

3.x doesn't have lots of necessary fluff. Get used to it.
Try truncate() instead.

where can I download the old version of MySQL Query Browser?

Downloads / archives section.

ok
truncate deletes a table??

Xgc, Great! Thanks very much

Is there any way to debug why an auth is failing?

Experience has taught me that the error message is usually helpful
In other words, expand your question

I've got two db servers with identical db's. I can connect to both from one, and neither from the other. The only error I get is from the client telling me access denied.
I don't know if its a host issue, password issue, no ide.
I've flushed the host cache, flushed the user cache.
I've got a %.mydomain.com, for the user. I was hopeing to find in the server logs somewhere (invalid client host, invalid username, invalid password) something.
didn't see anything, not sure if I'd have to enable that or now.
s/now/not/

Usually mysql doesn't resolve hosts

usually? When would it?

A lot of distros have –skip-name-resolve in the init scripts or in the stock my.cnf

k, I'll replace with an ip.

Look closer: http://dev.mysql.com/doc/refman/4.1/en/mathematical-functions.html#function_truncate

It's usually unwise to use hosts as your application would ground to a halt if the NS server goes away briefly, or if under heavy load, need to resolve a huge amount of addresses

same thing with ip.

name() is a function reference.

Ok, is the old_password set in my.cnf ?

old_passwords, yes.

Mysql changed the authentication thingies between 4 and 5 or 3 and 4 (?), so it might need to be set

Both machines are stock RHEL5.

Have you tried using mysql -h rather than 'the application' ?

Its very puzzling. I've never had issues authenticating in the psat.
yeah, this is all with mysql.
Its a backup user, each db backups up the other.

Paste the grant

GRANT SELECT,LOCK TABLES on *.* TO 'backup'@'10.8.34.%' IDENTIFIED BY 'mypass'

FLUSH PRIVILEGES; after that, right ?

yeah
I'm pretty sure the problem is on the client.
I can't connect to any db on either box from one host. All other hosts, and applications are able to connect (just found that out)

Can you telnet to any host on port 3306 ?

grant and revoke imply flush privileges

I gotta dash, I'll be in in an hour or two if you haven't solved it by then.. if you have, please let me know what it was
Note taken, cheers

yeah, its an access denied error, not a connect error
k, thanks for the help.

do you have any anon accounts (username = "")?
select * from mysql.user where user = ""

I do, and from the host I'm having issues with (the db started there)
is that it?

yes
your 10.8.34.% hostmask is likely less specific than the hostmask for the anon acct.
so the anon acct is taken.
neither username backup nor "" are wildcards,
and the more specific entry is chosen

Can't have an anon user and non-anon user from the same host?

yes. but if one entry has a wildcard and the other not, the non-wild entry is chosen as it is more specific.
having anon accounts is discourages, anyway.

Hi there. Is there a documentation of the SQL Syntax understood by MySQL 3.23.58 ?

mysql_secure_installation will delete them
and merlin will flag them.

we don't need it.

okay, multismf has been hardcoded to use domainid 1 instead of 0 to determine that this is base forum(base forums admin has rights on any other forum), auto_increment = 1 is set (although it's default, setting it shouldn't cause problems).

"delete from db where user = ""; delete from user where user = ""; flush privileges"

I didn't know about mysql_secure_installation.
its working fine now, thanks.

now you do. all will be good. :-)

Can anybody tell me if JOINs are possible in MySQL 3.23 ?

http://dev.mysql.com/doc/refman/4.1/en/join.html

Note that INNER JOIN syntax allows a join_condition only from MySQL 3.23.17 on. The same is true for JOIN and CROSS JOIN only as of MySQL 4.0.11.

CROSS JOIN with criteria (ON clause) is a mistake.
MySQL should probably fix that, if the docs really reflect the implementation. Bug report time.

CROSS JOIN table factor

there.

Xgc exactly this is my problem :-) . I have an program using ON clause
And mysql said its a bug

Your program is correct for current implementations of MySQL. MySQL should be fixed to not allow that ON clause.
I can't tell you about 3.x. That's way too old for my memory.
If you're trying to use an ON clause for cross join, don't. It's improper.
Use a standard [INNER] JOIN for that.

I have to wonder why he had to resort to a CROSS JOIN, too
uI have to wonder why he had to resort to a CROSS JOIN, too/u
the last time I used that was 1996
and I was just starting then

I've used cross join to solve general questions that don't often come up in practice.

perhaps
maybe you can tell me what you tried to solve one day Xgc, it's intriguing

It's used when you wnt to generate all combinations to determine which of those possible tuples don't actually exist.

oh
then it does look like a decent debugging solution indeed

the manual literally says thats a difference from standard, so people are kindly advised not to
by the way thanks for the tip with grouping, worked like a charm

No problem.

Hi, on mysql5, what is the way to use log to see 'errors' etc ?

query log
the_wench doesn't know that one.

query log logs all queries??

If enabled.

but, I only want to log 'errors' or something like this, I have an strange insert into that 'freezes' the php script and I have no 'log' for that

Hmm… I'd still want to see the entire log.

can you tell me the exact line to add on my.cfg?

http://dev.mysql.com/doc/refman/5.0/en/query-log.html

thanks
on [mysqld] log = /path/query.log ?

Looks good.

thanks

there's a huge performance penalty using query logs though

Too bad flushing doesn't roll the query log.

Using mysqladmin can I see the exact query that was freezed? I have its pid (srroy my english)

Xgc. Can you tell me how to change this SQL Stetement, that there is no JOIN anymore (or a join MySQL 3.23 understands): http://phpfi.com/252971

The log isn't going to indicate which query caused the freeze unless you have no other traffic at all.
What's the error? The basic JOIN seems ok, unless you mistyped something.

any idea why selecting via php/mysqli a temporary table created by a stored procedure will only return the first resultß

Are you fetching until there are no more rows in the result set?

yeah

I don't use 3.x, so you'll have to post the *exact* error.

Hmm. Wait. I have to loo into my maisl
mails
You have an error in your SQL syntax near 'ON
pages.uid=tx_jppageteaser_list.pid
WHERE
pages.uid IN (207) AND pages.' at line 11
oh. i thaugt would be one line
http://phpfi.com/252974

You hav a version of MySQL that doesn't support an inner join? haha. Try using a table list (comma separated) and place the criteria in the WHERE clause.
Nice.
Try removing parts of the select list to make sure something there isn't breaking in 3.x, especially the CASE/WHEN clause.
Just for testing.

Hello.

xgc any idea?

Not off hand.

http://rafb.net/p/2WnqnY72.html
this is the stored procedure

If I create a unique index on two columns, do I also get the performane gains of having those columns indexed, or should I also create separate indexes for the columns?

What is the exact version of MySQL? select version();
There's a chance you simply need to add the INNER keyword.
FROM pages INNER JOIN tx_jppageteaser_list ON

http://rafb.net/p/fJ2oRj77.html
this is the code

How do you know there are more rows?

-p'

cause in console / phpmyadmin it returns more rows

if I specify a corrupt table specifically, it'll fix it, but in a full scan, it just skips them

Xgc is it posible to download the 3.32.58 anywhere? It not my server
3.23.58

http://rafb.net/p/fWGJUq38.html

so your stuck on 3.x?

being stuck on 3.x sucks

s/your/you're/

INNER JOIN should do it.

i have no idea WHY the only want this
Xgy okay. Thx. I'll try

how old is this server?

He installed mysql via paper tape.
That's how old.

hehe

can you help me please , my problem comes that works for all fields exept for one is called text_log that 'never ends', it is possible to speed up textlong fields using SELECT?

Yeah. really old. And there is a banking company on this sever. maybe thats why the company don't want to upgrade

em.. and they let you in on the server that has some info of banking company on it?

It's safe. That version of MySQL doesn't support SELECT.

heehee

lol

what CAN it do?

)))))))))))

lol

It crashes a few times a day, keeping the admins busy. they don't want to update for fear of not being needed.

It has just the website of a banking company. No money transfers or stuff like that

would it be possible to somehow fetch variable content to CREATE TABLE statement? (perhaps with PREPARE within a procedure?) with 5.0.37?

You can dynamically generate SQL in procedures.

some doc about his?
*this

See PREPARE

Xgc sn't there a possibility for me to fetch a mysql 3.23.58 version anywhere?

so in principle it is doable, right?

Not that I'm aware.
If it allows you to issue DDL statements. I think it might.

OK, thanks,will try to figure it out

Here's a hint: http://rafb.net/p/Lo3lE189.html
a href="http://rafb.net/p/Lo3lE189.html"http://rafb.net/p/Lo3lE189.html/a

how do I retrieve columns which were updated by an sql UPDATE in jdbc ?
i mean rows

via SELECT. You can also try using a trigger.

hi
can i get some support with querys from here?

update foo set x=y, select x from foo where x=y ? does not work since foo can have changed rows between those two calls

You think abusing the local foo is funny or something?

i figured out there is an limit with query length.. how can i change this..?

Transactions might help.

not available in the engine

You're out of luck. You have several ways to attempt to track this. If this is critical, add a modified_by field that every client specifies. This can be used to separate updates made by X from updates made by Y.

no one heard of this query length?
o.O

max packet?

what is a good way to generate modified_by ?

its not the max size of the packet

That would be application specific.

ok im running l2j, and the sql are quite big

it has to be unique for each client

and i have to put in sql files like every 10 pages ;
INSERT INTO `spawnlist` VALUES
to get it running
it has that in start, but after that is too many codes for it to add em in db

That's up to you to design for this application.
That's usually due to the max packets setting. What is the current setting?

16m
….

What's l2j?

lineage 2 java
game server

How large is this insert?

2,8mb
and it has lines like one millin billion zillion
and thats what the problem is..
that insert into has to be every 10th page or something, cause there is some limit..

how do I select the connection id / thread assigned to my connection?

Post the output of: show variables like '%max%';

o.O
what u want to see?
tell me what to do
im pretty new to this whole mysql things :-

hi. I was wondering if there was a command to convert text to it's canocial form
I have a VARCHAR with a maximum length of 30 which I want to read in canocial form, without having to use an external method to convert it

show processlist; — It should be here.
Just post the output to the pastebin. (rafb.net/paste)

output of what?
it disconnect from mysql server cause too many entries?
*-?

Post the output of: show variables like '%max%';"

canonical*

and how do I get that info from the show processlist view as a sql select?

anything?

select connection_id();
and others: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html

http://dev.mysql.com/doc/refman/4.1/en/miscellaneous-functions.html#function_uuid
that was what I need for modified_by

Depends what you mean by "read".

yo, thanks for pointers on PREPARE/EXECUTE, I managed to do what I wanted (though it looks quite ugly )

Dynamic SQL *is* ugly.
An application should almost never use DDL… unless this is a developer tool, something like MySQL query browser, workbench or administrator.

well, I would be ahppy to avoid it if there another way, so far I couldn't find any

and in the case of temp tables, there's no need to be dynamic, since the name space is connection specific.

I have a value like "androiddata" which I want to parse through
username (mysql) = "Android Data"
username (query) = "androiddata"

"androiddata" so it finds the username

What logic would you use to do that? lower case and remove whitespace?

convert to canonical form.
it strips all punctuation and space from the variable and converts to lowercase

I've never seen that in MySQL. You can use lower() and replace()… or create your own function that does this.

gah

MySQL 5.0 supports stored functions and procedures.
This doesn't appear to be supported by the SQL standard.

ok

A stored function appears to be the most common solution, available in MySQL.

I'm interested in taking the mysql certification, has anyone taken it? or heard anything about how difficult it is?

hi; is it possible to do a "LEFT JOIN" into a table from another database ?

Yes.
FROM db1.tblanme LEFT JOIN db2.tblname ON …

Xgc; LEFT JOIN databasename.tablename ON databasename.tablename.fieldname = databasename.tablename.fieldname
Xgc; ok, thanks.

See Federated Storage Engine if the databases are remote with respect to each other.

xgc; thanks, but they're running under the same mysql server, i should be fine.

hi - i installed PhpMyAdmin on feisty fawn, but when i try to access it at http://localhost/phpmyadmin - it tells me Access denied for user 'www-data'@'localhost' (using password: YES) ( i login with the correct root password )

mysql passwords are independent from the os ones

i mean the correct mysql password

Can you connect from the command line?

yeah
i can log into mysql via command line with the correct root password

you have phpmyadmin configured to use the wrong login name

where do i find the config file for that?

I've no idea, personally I recommend that you avoid using phpmyadmin for anything important

php documentation.

e.g. where you don't want to lose all your data

its just for local development
it worked before though
thats why im wondering

the power cord on my server got kicked…restarted it and now i can't connect to mysql
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock

http://saved.im/njaxmjy4zho/phpmyadmin2911.png

What error messages do you get on the mysql log?

hmm, i'll check

perror 2
!perror 2

No such file or directory

Just a guess.

in /var/log/mysql/mysql.err ?

Just show the *exact and full* error.
You pasted part of it.

any Idea what I could do? Normally on ubuntu all you do is install and then it implements with the webserver and simply works - it did before, but now it doesnt

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

It's entirely a php configuration issue.

111; i get 2 if i remove the conf file
obviously

See the docs for that application.

Ok
Thanks

This is presumably due to mysql failing to start up - it generally does this if there is something seriously wrong, and it would have logged it in its error log. Consult that.

MarkR42: that's what is so odd…mysql.err and mysql.log are both empty

What happens if you try to start the service manually?

not sure what you mean. that's the error when i try to start it
either with `mysql` or `/etc/init.d/mysql start`
stupid power cord

No UPS?

Xgc: no /cry

I don't remember what's that's like, to run without.

:P

Does /var/run/mysqld even exist?

yeah

Sorry but I don't find any phpmyadmin related topic in the PHP Manual, is it a command to edit in my php.ini?

phpmyadmin should have installation documentation.

phpmyadmin is neither a component of php nor mysql, but some other guys misguided, failed attempt to produce a robust application
Consult its documentation or its support channels if there is a problem. We just use mysql here
and likewise, ##php just use PHP.

Xgc/MarkR42: Thanks, the manual helped, problem solved

I strongly recommend you avoid the use of phpmyadmin in a production environment
especially its backup / restore

It's really just for small testing purposes
nothing special

I'm trying to normalize my data, but I have many duplicates
a primary-key, bigint 'id', and a string 'artist'

groupwise
groupwise max

http://jan.kneschke.de/projects/mysql/groupwise-max/ http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html

Ehm exuse me the addres to phpmyadmin is php.etc.com, is there a way I can get there through cmd instead, easier on the eyes….
I want to configure the database/tables and etc through cmd.exe how do I connect and do that?

anyone done a mysql certificaiton?

You can use the mysql command line client, as described in the documentation
In fact I recommend you stay away from phpmyadmin

MarkR42 why do you recomend that? ANd yes I want to learn through CLI, and what documentation are you reffering to?

why do you not recommend phpmyadmin?

I don't recommend phpmyadmin because I am aware of several bugs, which may have been fixed in some way, which caused it to lose or corrupt data

MarkR42 So how do I use the MySQL command line client?

As described in the mysql manual

ah ok, for the most part I just do simple select and update queries with it, seems to work ok :-)

MarkR42 ehm I'm not reading that….

It is a command line application, shipped with mysql, and has many applications
And many, many options

MarkR42 the database is not in my computer
its on another server

Nevertheless, the mysql command line client can connect to a remote database, provided the server lets you

the server probarly lets me
is it through CMD.exe

or if you have ssh/shell access you can login to that and then do it

In win32, you can invoke mysql command line from cmd.exe, but it is not mandatory

what does mandatory mean? as in Must?

yes

Yes, you can invoke it from any other application if you like, even directly from the win32 run box if you really want
If I needed to use mysql on win32 however, cmd.exe would probably be my preferred choice to run it

MarkR42 Alright then, ehm so what would you guess the adress is? right now its mysql.etc.com
im on win64 '

the server address is whatever your server is, contact your dba for more information

vista

You can use the 32-bit client on win64, there is also a win64 version

MarkR42 I cant get in touch with my DBA at the moment, however I got correct login and etc…

I'm afraid I cannot remotely seem to read your DBA's mind, my telepathy is not that strong

MarkR42 it's really just bending time and stuff, you get to learn it
no
the question was
what command do I use to connect to it?
telnet?
ssh?

Certainly not, typically something like mysql -u username -p -h hostname databasename
As I said, read the docs for a full explanation

mysql is not recognized…. etc
COuld you please link me it?

In which case, you've forgotten to install it,

I dont have sql on my computer

No, I will not- it is straightforward to find it

its on a database

The client can connect to a remote server

do I need to have a database on my computer to connect to a remote server?
sounds dumb..

No, you do not.
You just need the software

And what is that called?

It's called mysql
Or rather, the client parts

http://dev.mysql.com/doc/refman/5.0/en/
is that the manual you were reffering to?

Is it possible to have MySQL output headers in a query ? I would like my gridview to display the column titles.

Yes, that is the manual
I've no idea if the windows installer allows you to install just the client parts, but if you do a complete install but don't run the sevrer, that will definitely give you what you need.

I have two left joins on my query to the same table, but I want the same field name for the table joined to have two differente names (one per left join), how would I go about doing that?

aliases

not familiar with that,

select `field` AS foo1, `field` AS foo2

select x.x as y, x2.x as y2

ok
oh yea
but the problem is, this is a single field that I need to call twice

backticks doesn't look that good

so alias the remote field

Akuma, maybe you realy want to use an union and/or a subquery?

better yet, pastebin your query

or it might be as simple as the if function

sure

ok

IF/CASE/WHEN

one sec
http://rafb.net/p/DfSClk25.html
basically, I have two fields in projet that call fields in organisations
what I want to do is access a certain field on organisation (same for both left joins) with different names

ok

basically a different name for the same field on organisations for each left join I have

you need to alias your tables
i.e.

you could use a subquery and an union all
or an if function

LEFT OUTER JOIN organisation org1 …. organisation org2
then org1.fieldname, org2.fieldname
you could even alias those fieldnames, if you like.

is this two different queries I need to do?

no
you can reuse the same query.

hmm… I might have to read a bit more doc on left joins

SELECT projets.* FROM projets LEFT JOIN organisations org1 ON org1.oid = projets.oid
then
LEFT JOIN organisations org2 ON organisations.oid = projets.manda_asso
err
LEFT JOIN organisations org2 ON org2.oid = projets.manda_asso
SELECT … org1.fieldname AS foo1
then

Oh!

then org2.fieldname AS foo2

so I can basically do the aliasing before defining the table aliases?

you need to define the table alias as you left join them.
follow what I wrote.

Is there a command for mysql to decrease or increase stored value or is it better that I use select in php to get that value first and then update it?

SELECT projets.* FROM projets LEFT JOIN organisations org1 ON org1.oid = projets.oid LEFT JOIN organisations org2 ON org2.oid = projets.manda_asso

jake81, you can just use field +
field + number

eh.. with update?

but then I only get projets.*

I pretty much spoon fed you there
of course, modify the SELECT statement as needed.

Ok

you can select from projects, org1 or org2

ok
that was what I wasn't clear on
Thanks

jake81, correct

no problemo

you mean like this: UPDATE settings SET value+11 WHERE VARIABLE='myvariable' LIMIT 1 ?
if I want to increase it by 11.

note that I corrected your orignal LEFT JOIN statements. They were incorrect.

how can i get a unix timestamp from a timestamp field using jdbc?

VARIABLE and VALUE where VARIABLE is name of variable or other identifier and VALUE is where numeric value is stored?
I might have ran into trouble with it. value seems to store contents in format text. For this specific value anyway, it only uses numbers, but field type is text. Will it work?

CAST it as INTEGER
or INT

eh, CAST?

it should still work
i think

CAST the VARCHAR field as INT
just to be safe.

okay, so I should do this:
eh sorry..
I don't know how to use it with update..

pastebin your current query, please

my current query has not been created yet, I am just trying to figure it out

I did not follow your requirements. What is your current goal?

UPDATE settings SET CAST(value AS INT)+11 WHERE VARIABLE='myvariable' LIMIT 1

anyone know what this error could be "'Unknown column 'RoleId' in 'field list'' "?

I have a table called settings. It contains 2 fields, variable and value. variable is tinytext and value is text.

that looks OK. Of course, if the field is VARCHAR, you might have to cast the result back to VARCHAR(length)

one of the fields is called for e.g. as "amount"
or in my example I called it myvariable.

the column RoleId does not exist in that table.
solution: don't select it

hello, i recently installed mysql on my ubuntu box and it's up and running, however i can't connect to it remotely, even though i forwarded port 3306 through my router…is remote access disabled somehow by default?

if they are int ot tinyint, no casting is necessary

argh.. I'll try to find myself an example with google about using update with cast..
they are text.

pastebin the output of DESC tablename; please

infamouse, possibly ubuntu did that

I cannot as it's not created yet

please create the table first.

my program is not in state where it could be executed.

you prolly shouldn't use tinytext for a variable name
and at least use varchar

It's not my idea, I cannot change that as this is modification to existing product.

will check a thing, can i create a role id then it should work?

well you're throwing a lot of stuff in here, without anything to rely on. I need to know the specifications.
if you alter your table, sure.
!man alter

see http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

^^

johnny, how can i determine that and if so, allow remote connections?

perhaps skip-networking in /etc/mysql/my.cnf
that's how i always run mine
if i wanna query remote db, i ssh in first

there is records already, then it should work?

sure.

just tell me what you want to know? table: settings contains 2 fields: variable(tinytext) and value(text). there are records, I'm interested in this one that has variable=totalMembers and value=something. Value is always numeric, I need to increase this number by specific value calculated by my
program.

you can add columns to existing tables with records.
ok, this is much better already. I have actual data to work from.
bok, this is much better already. I have actual data to work from./b

yeah, sorry. It was hard to explain when you do a lot of things at same time
uyeah, sorry. It was hard to explain when you do a lot of things at same time /u
buyeah, sorry. It was hard to explain when you do a lot of things at same time /u/b

oooh, innocent bystanders

UPDATE tbl SET value = value + 42 WHERE variable = #number AND value = 'value';
that would do it.

will it?
value's type is text? Oh.. You made there a small conversion
thanks. I hope it works, as currently I have no way to test it

I used single quotes for value, as you said it's text
I did not use it for variable, as you said it's int

eh..

as far as updating the variable column, it's int, so no conversion is required.

value is a field in table which has TYPE text.

yes, I covered that already.

okay, guess what.. I'll try it in phpmyadmin.. Then I should know if it works or not without trying to execute my software..

oh shit, it's text. Sorry/

yeah

then you do need conversion. Hold.

means that it get's it from field value

UPDATE tbl SET value = CAST(CAST(value AS INT) + 42 AS TINYTEXT) WHERE variable = #number AND value = 'value';
UPDATE tbl SET value = CAST(CAST(value AS INT) + 42 AS TINYTEXT) WHERE variable = '#number' AND value = 'value';

indicate a value passed as an argument.

as per the man pages.

now it looks better to me too although I'm far from being expert.

this version will work

should it be TEXT instead of TINYTEXT?
value's type is text and variable's type is tinytext

I'll leave that up to you to match them
the idea is the same.

you have error near 'INT) + 42 AS TEXT) WHERE variable = 'totalMembers' AND value='value' at line 1
I forgot prefix..

i need to try some more, don´t really know the prob

nope.. It's still wrong..

i have a table with two cols.. user_id, subscribers.. each user has a list of subscribers.. i want to get the list of id's
ordered with highest number of subscribers
select count(user_id) as cid, user_id from subscribers_table group by user_id order by cid asc; doesn't seem to work
anyone konw how to fix this?
actualy i think i fixed it.. nm
thanks

pastebin your current query

http://pastebin.com/d29d7c82f

johnny, i'm not seeing anything regarding skip-networking in my.cnf…do i insert that into it?

variable(tinytext) and value(text) are fields in table smf3_settings

I just lost data. Please bear with me

any solutions?

I am still recovering my data

for some reason, i can't remotely access my mysql server, i have port 3306 forward through my router, but still no luck…is there a setting in mysql that's preventing this?

remote

remove bind-address= and skip-networking from my.cnf and grant permission to the external 'user'@'host' and remove any firewall rules

that was for you, infamouse

i want to store 2 time values in a db to later calculate the difference. do i use datetime or timestamp or just time?

[bonobo]: I'd use datetime

thanx, Davey

I'll be back later, wife insists that it's my turn to cook so I need to go do my duty. I'll come back later. If you happen to know what causes problem, you can always put it in a query for me..
uI'll be back later, wife insists that it's my turn to cook so I need to go do my duty. I'll come back later. If you happen to know what causes problem, you can always put it in a query for me../u

its my first direct contact with mysql. came to the conclusion that no cms has what i want :-)

create temporary table foo — is this threadsafe? i.e. is "foo" only visible on same connection, or should i generate unique table names for this ?

foo is visible to the world, may it be known!

hah

foo, not you
i meant my temporary table
lets call it bar then

Is that a threat?
hehe

so, should i use unique names for those tables or i can use something like "bar" or "baz" in the application and it would suffice ?
oh
found an answer in the manual

imagine that! :p

You can use the TEMPORARY keyword when creating a table. A TEMPORARY table is visible only to the current connection, and is dropped automatically when the connection is closed. This means that two different connections can use the same temporary table name without conflicting with each other
or with an existing non-TEMPORARY table of the same name. (The existing table is hidden until the temporar

(quote)
ok, that is very good

Hello, I am Gene Ray. I have a doctorate in cubicism and I am the wisest human and inventor of the Time Cube. www.thewisesthuman.com www.timecube.com
I have become interested in SQL databases.

the wisest human, eh? good story

I feel I can use a database such as MySQL or Postgresql to communicate my Time Cube theory to the word animals that are educated stupid (professors).
I will have four computers (a cube has four sides) placed around the earth.
These computers will record the position of the sun related to the earth by communicating with a central database.
This will prove my Time Cube in terms understandable by the educated stupid.
Any person, even the most educated stupid, will clearly see the MySQL table shows time four the four different days per rotation.
What Life Force is more powerful than the Sun? The masculinity Sun and the femininity Earth form a binary of Opposites at Center of Universe - Greater than either Sun or Earth, debunking all Oneism Gods taught by religious/academic Word Animals.
This will also proove that a cube has four sides, a top, and a bottom.
Spelling is irrelevant to anyone with superior logic.

rofl

This makes me the best programmer and the wisest human.
I consider myself wiser than Einstein.
No human alive has been able to measure my intelligence. Psycologists can do no more than assume I am schizophrenic!
This is why I have awarded myself the Doctorate of Cubicism.
No other human has ever acheived this.

who is this lunatic?

Gene Ray, apparently
horrible web design, by the way

Damn, Gene.

huge fonts make for painful reading of long documents

the first site gives me a headache
that background image is horrendous

Test

You are too inferior to read my web site.

hahaha

I have no problem reading it because I am not a word animal.

a … word animal?

My web site has more wise information than evil Google.

ALTER TABLE geneRAY ENGINE=blackhole;

someone here who could help me with a little problem?

Google is an index of knowledge that is really stupidity.

its not a matter of being able to. It just that it makes it more work than it is worth for some rant against religion
huge font = more scrolling

ask your question, and someone might

NASA's Moon Landing was far less of an achievement than Time Cube discovery, for I have Cubed the Earth, with 4 simultaneous corner days in 1 rotation of Earth. (singularity belief scientist can't comprehend T.O.E.)

anyway… did you have a mysql question or what?

k..

Yes.

REVOKE NONSENSE ON mysql.* FROM 'generay'@'%';

I want to setup a MySQL database to prove my theory to word animals.

then please ask it instead of spewing nonsense

i actually started to optimize my sql-queries, so i tried this one for my stats:
SELECT * FROM user_statistic LEFT JOIN users ON (users.id = user_statistic.userid) WHERE descr='".$descr."' ORDER BY descr,score DESC
but i doesn't really work

how is it not working, exactly?

i want to order the stats in categories like building or sience, but it always shows me the same categorie
$descr is for the categorie's name

well WHERE descr='".$descr."' would only return results matching that particular category
so the ordering does not make sense.

This is why all computers are evil. Their CPU gives stupid lies when you multiply a negative by a negative!

that wasn't a question. You want to set up a mysql server? go for it. It can be downloaded from http://www.mysql.com
thats called "math"

Math is built upon evil concepts.

how dare you, GeneRay

Because everyone here is educated stupid, I will leave.

math is holy

you're wasting your time.

I am above God.

yeah but its kind of funny

Good bye, word animals.

kthxbye!

And visit www.timecube.com sometime.

no
we won't

I already did

lol

I had the displeasure of loading it in my browser

Hello, I am writing my very first mysql stored procedure How do I iterate over a column? I am looking for something like a foreach in mysql stored proc.

well now that THAT is done with… I'm going to change my laundry and take a shower

where were you? You could have kicked him!

shit. something that was a valid query in mysql 4.x has a syntax error in 5.x

how about you tell us what the error is, exactly?

http://rafb.net/p/YaBmD418.html
not an easy query to read, but i'm guesing that theres some variable i'm not allowed to use anymore
like 'condition'

is 'condition' a column name?
if so, put it between backsticks

its not
) AS condition

try AS `condition`

meh, that was the problem
you're not allowd to do 'as condition' in mysql 5.45
er mysql 5.0.45
all uses of condition have to change to `condition` or another name

ok.

thumbs, have you recovered your data?

almost done.
90%
thankfully, my backup was good.

how did you end up loosing your data in the first place..?

I dropped the wrong table.
I need to reindex it afterwards
so it should be OK.

okay..
argh..
UPDATE settings SET value = CAST(2 AS TEXT) WHERE variable = 'totalMembers';
even this errors.
If I change CAST(..) to '2' it's just fine.

http://www.engadget.com/2007/07/28/man-gets-bsod-message-tattooed-on-his-arm/

CAST is awfully documented. I was able to find a lot of examples when people need to use CAST with SELECT, but no examples at all about using CAST with UPDATE. No any mention, thousands of pages found but they all are just release notes and bug reports of mysql..

don't use TEXT
use VARCHAR(length of field) instead
i.e., VARCHAR(20)

I don't know length of field. It's type is text

so use a large enough number, and humour me.
please.

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server verion for the right syntax to use near 'VARCHAR(20)) WHERE `variable` = 'totalMembers'' at line 2.
amused?

heh
pastebin the whole query, again, please.

UPDATE `smf3_settings` SET value = CAST( 2 AS VARCHAR( 20 )) WHERE `variable` = 'totalMembers';

ok

okay.

sec

UPDATE `smf3_settings`SET value = value + 1 WHERE `variable` = 'totalMembers'

I got customers to tend to

It doesn't matter even that value's type is text, it seems to mysql can go around it.
so no CAST needed anyway.

ok
brb

I need to drop a whole bunch of tables. I'm looking for something like this "drop table foo*"

Put all foo* tables in teh same database and drop that… or use information_schema or show tables like 'foo%' from a shell script to generate the drop statements.

Thanks!

hi guys

Hi, I have a select that uses a field as longtext but is very very long, and only one select maybe uses 15m, any idea how can I speed that?

hi
can mysql be used with sql on rails?

sql on rails?

yea
its a new web development paradig
u make apps in PURE sql

never heard of it

sounds interesting.

pure sql sounds scary

not really. Makes for secure code.
since everything is server-side

ya u cant make sql injection
also it supports ajax and scriptacus
so does my sql support sequel on rails?

secure??
hmm
and you cant inject sql because of that?
uh huh…
jeepers do you have an URL for that?

as long as you take no input from users. ;^)

http://www2.sqlonrails.org/

threnody not much point then

theres a screen cast
which is very web 2.0

the point is that you don't rely on client-side validation.

thats a joke
you do know that, right?

Your browser is insufficiently AJAX-y to
render the content pointed to by this link.
aha!

its just a joke

yes, it's a dummy site.

making fun of the RoR site
and idea :P

what?
its a joke?!

yes
are you making fun of us too?

http://www2.sqlonrails.org/down
hahaha

"sudo -u mysql mysql_install_db5" i get: "mkdir: /opt/local/var/db: No such file or directory" (i am using macports hence that specyfic path). does that mean i have some user rights (mysql user/group) problems or what?

look at the links

ya i know my browser isnt compatible im using an old version

probably no /opt/local

maybe i should install ajax extension

jeepers you ARE making fun of us

ok, we're not falling for it anymore

Darn.

hii

oh no

I have a table with the columns "id int, order int, name text, desc text".

Uh-oh, desc

and when I run this query

I liked the DOS 3 terminal though. made me nostalgic.

insert into `forums` (name, desc)
values ('$fname', '$fdesc')

Quote desc
It's a reserved word.
`desc`

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc) values ('fhj', 'fj')' at line 1

Or just call your column "description"

ah
thanks

No problem.

quote

Use ` around identifiers (database/table/column/alias names) and ' around strings and dates. MySQL does allow " for strings, but ANSI standard uses " for identifiers (which you can enable with ANSI QUOTES option)

is there some type of mysql bug I'm not aware of for example I'm trying to run a query wher salesid 84 and export it into csv through my adminstration section on my main website which I have a simple little php file written up, well it exports them just fine into a csv file, but whenever I
have 20 rows for this certain salesid number it tries do download the php script? any other orders that have 20 rows, it will export them just fine, hop

d-media: You're trying to blame a bug in your web site on MySQL?

Basically yes, because if you knew exactly what I was talking about then you'd understand.

d-media: Can you ask the question in a way that shows the MySQL function or query that isn't doing what you expect?

yes
k
hold on let me show you

I don't see how you'd ever understand.

d-media: Don't include any php detail. Just the SQl will do fine.

k

You just might have a point.

i can tell already you don't have any idea of why it would be doing this to trust me, watch ok go here http://pastebin.com/m2b4a6d4a
thats my sql
now when I run that sql lets say I do salesid 84 if salesid returns 20 rows it don't export my csv file right, but if I do any other sales id it works just fine, now salesid 84 export fine until it exactly hits 20 rows

d-media: Are you sure about that? Do you know me?

but if salesid 64 has 20 rows it will export it just fine
I do know your good at this
thats why I'm glad your in the channel
every one else thinks its something else
then there like Idk

d-media: since this sql wouldn't create a file, I'm assuming your php takes the result set and writes a file?

run the query in a mysql console. If it works there, the problem is somewhere else

see when i try to export salesid 84 it tries to download the file csv.php, but if it don't have 20 rows the headers in php will bring the window up for export.csv
yes
want me to pastebin it?

it sounds like a bug in the php data handling portion

it could be

d-media: That has nothing to do with the database engine. This is a php issue.

Comments

gday i did an rsync of a whole box for xen but when i try to run queries on some tables on the new box i get this

Can anyone help?

field='user'
(sorry)

nathan^: might be helpful to know which data is in it

"nils_ will switch to closed source software soon, this compiling stuff sucks" — Was that serious?

p–: hmm there is a string function to extract the part before the .dot
nope

nils_, syntax? or url? I coulnd't seem to find anything

!man substring_index

see http://dev.mysql.com/doc/refman/5.0/en/string-functions.html

!man string functions

see http://dev.mysql.com/doc/refman/5.0/en/string-functions.html

ah whatever.

thx

thanks
finally putting together that DB box I was asking you about last week

p–: What's the objective? FIND_IN_SET might be more what you're really after.

nils_, a bunch of user inputted data
That contains newlines, etc
It's a bunch of textg
In this case, it's a poem

nathan^: and where does it truncate? maybe an encoding issue?

'The Hunting of the Snark'
Yeah
I think so
But I dont know enough about it

Just the place for a snark! the bellman cried

check your table and transfer encoding

as he landed his crew with care

I dont know what that means, nickm_
nils_

nils_ accepts donations via paypal or wire transfer

I'm new to mysql

snoyes, basicaly we have email coming in as user.blah but the mysql table only has "user"
so I want to be able to get that info

what are the final specs?

ah. substring_index is probably what you want then.

nils_, it's truncating at the newline character I think
But

newlines should be fine

I dont know where to start
hm

thanks guys, looks like it

well
I cant even select the data in the php mysql web hosting cli client

exactly what I needed.. thanks!

So
Am I supposed to be able to select the data from the mysql cli client?

any errors reported?

no

warnings? just no data?

select * from email_parameters where email_guid = 'c818300a9ec8ea52816ff5be6cecfe53' and parameter = 'customNote';
I dont know
I dont get any warnings from show warnings or show errors

hi, how can i do a load data replace but not replace one field?

I just get a weird output

is it possible?

+——————————————————————————————————+
| value |
+——————————————————————————————————+

| "Just the place for a Snark!" the Bellman cried,

+——————————————————————————————————+

oi

Is that what it's supposed to look like
?

i would like that at each new insert, mysql add the today date

I think you had some issues when you imported it.

yep

on a certain table, how can i do so ?

snoyes? You think it didnt get in correctly?

cut at the comma

Why wouldn't it get inserted correctly, can you think of a reason to look for?

How did you insert it?

Uh

use real_escape_string

an insert statement, or a load data infile?
!m toste timestamp

toste see http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

no no

I'm writing python

cheers

a timestamp field

We dont have a real_escape_string

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-type-overview.html

Maybe I see it
Hang on
Thanks for helping I'm going to look at this
dbUtility.escape

twas brillig, and the slithy toves did gyre and gimble in the wabe.

snoyes

sql and poems from snoyes, whatever next

an sql host poem, obviously.

moin

moin moin

"Select, and leave my schema undone/the privileged routine, the barren FROM"

hehe

Data truncated for column 'value' at row 1
Same thing
hm

column too short

How do I even know what got in there?

That's during a select? or an insert?

During a select
+——————————————————————————————————+
| value |
+——————————————————————————————————+
^nl^ As | the place for a Snark!" the Bellman cried,
+——————————————————————————————————+
I dont get why it looks like that
When I select it

nathan^: find a pastebin already.

Do I need to encode it?

because there's a new line in it, and the client goes funky with such things.

Okay
Is that what's making it truncate when I select it also?

SHOW CREATE TABLE tableName;
what does it show for the field type of value?

(Via python)
Hahahahahaahahaha
OH wow I'm a retard
It's not what I thought it should be
:P

no, just still reeling from the attack by the frumious bandersnatch.

that's what's wrong
I changed the wrong field to text
It's still a varchar
I love you snoyes
Both for your appreciation of Carroll and your mysql help

get a room you two
;^)

snoyes what would happen if google was crawling a page of searched result of another search engine?

um…the cat would die?

wouldn't that require google to put in a search term?

the cat would be simultaneously dead and not dead, until the page refresh.
bthe cat would be simultaneously dead and not dead, until the page refresh./b

So there'd be mice all over keyboards jumping up and down on F5

quantum kitties

time for some gaming

what???
there could some some links with queries
so, if google fetched it, it could crawl a result page

my ass is sweaty

how can i convert a datetime to unix timestamp in a query?

unix_timestamp(datetime_col)

having trouble here. I have 2 tables. I need to populate certain columns from table A to table B but need to set an id column in table B back in table A for each record. I assume I can use mysql_insert_id() or whatever its called but im trying to figure out how to do this with plain sql if
possible.

thank you leith

select last_insert_id();

thanks but how do i do that for the source table.column after each insert into destination table?
nested update? or similar

insert into b (select … from a); update a set .. = last_insert_id() where .. ;
in a loop
or something

aha
ok cool thanks

you need to do them one at a time to be able to use last_insert_id()
so the select in the insert would have to have a where clause as well

ok thanks
quit

The_wench exits (connection reset by luser)

lol, that's the best 'bot response yet.

it has a few more like that

pushes the_wench down the stairs

Hey! *thud* son of a … *crash* what the *thump* ouch *crunch* ow

rm -rf

Damn you made me forget all my factoids

I have a table with names in it with the first name in one field and last name in another. What command do I use to see if a name is in the table?

select * from table where fname = 'yadda' and lname = 'yadda';

lol too simple
ty

Is INTERVAL very slow?

No

So it must simply be that I am checking datetimes that slows this query down.

Possibly

using indexes?

or a lack of an index

seekwill, did you help your 10% today?

Yeah… I was just gonna ask about that.

DSal-Rak: I think so
DSal-Rak: I may have done more
sweetness
But that means no one else can reply if I'm doing the channel's quota….

Is it possible to copy a table and, in particular, any indexes with just queries? Or is mysqldump required?

Well, adding an index for the datetime column didn't speed anything up.

I find that difficult to believe.

Catnip96, maybe you need a composite index look explain your query

Hrm… possibly.
I have a seperate index for it.
!man LOOK EXPLAIN

Sorry - I have no idea what function you're talking about! but try http://dev.mysql.com/look explain

!man EXPLAIN

see http://dev.mysql.com/doc/refman/5.0/en/explain.html

(Why did you say "look"? =Z)

you might paste results from SHOW CREATE TABLE table_name, and then your query.
pastebin*

Catnip96, typo

Ah.
When people don't correct their typos, I get worried.
And think I've missed something.
BTW… I understand all "Index Kinds" except for SPATIAL and FULLTEXT. What are those? And I don't understand any of the "Index Types" (DEFAULT, BTREE, HASH, RTREE). What's the difference there?

Outstanding. Nike just put Michael Vick's promo contract on hold.

Vick is overrated

(INDEX, PRIMARY and UNIQUE I understand of the Index Kinds.)

and holding dog fights doesn't help

hi
I'm have problem
I'm got this message error
SQLSTATE[HY000]: General error
so, what is it?
:P

any other error text

i've returned

nop
only that
General error

you might mention your o/s, the php mysql web hosting version, any particular application you are using (php, etc), what you were doing when you got the error, etc.

mysql 5
php 5
trying to do insert
sorry, update

can you install mysql 5 with apt-get in ubuntu ? anyone know the package name to use ?

does a search of synaptic reveal it?

mysql-server-5.0
got it eventually
thx.

the 5.0 client is there too

hey how do i get a database that was create in old version of mysql to come up in latest everion example 4.x db to load in 5.0

commlink are you getting an error?

Xgc, lemme know when you're back from work

commlink, see the upgrading docs

would insert into select from work on mysql.user table from server to another?

syntux are you asking if it's possible to use the mysql.user from one server on another one?

i was getting this db was created with an old version of mysql etc

ebergen, yup because I have large user table, about 100 user with different levels so I just want to copy it

it should work

dont forget to flush privileges afterwards

0 -!- mode/#debian [+b %*!*@cpe-075-178-084-017.ec.res.rr.com] by stew (drthunder, acting like a tard and logs show him here week or so ago FYI

how goes your engine?
or still in "thinking" stage? ;-)

resting, quoting for an asp to php mssql to mysql job

ah, fun

ebergen, I copied /var/lib/mysql/mysql/ to the three servers, restarted mysql hosting servers and all went just fine.

Shrews been entertaining watching the questions in -dev and on internals about engine details

syntux good to hear

krow has a sample engine skeleton (in case you weren't aware)

when does starcraft 2 come out?

Shrew I know there is a sample but havnt bothered looking at it yet, trying to get the ideas straight first

I understand INDEX, PRIMARY and UNIQUE of the "Index Kinds", but not SPATIAL and FULLTEXT. What are those two? Also, what is the difference between the "Index Types" (DEFAULT, BTREE, HASH, RTREE)?

whats the proper way to store a MD5 hash ?

To put it simply, the SPATIAL indexes are used with the geographic features of MySQL. FULLTEXT allows you to search for words within text. The index types refer to the algorithms used to implement the index.
CHAR(32) ??

Doesn't it represent an integer?
I guess it would be a very long number.. hmm

MD5 has is a 32-char string.
Don't aske me how it can work, but it does.
Hmm… you mean you can FASTER search for words within text with a FULLTEXT index?

a big one, yes
yes
!m Catnip96 full-text

Catnip96 see http://dev.mysql.com/doc/refman/5.0/en/fulltext-restrictions.html

nope
!man fulltext

see http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html

dammit
!man full text

Sorry - I have no idea what function you're talking about! but try http://dev.mysql.com/full text

So if I have a search functionality in my forum software, and my forum posts are TEXT, I should make a FULLTEXT index on the text column?

http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
it can help. and it only works with MyISAM tables

If it's anything like the one on the MySQL Web site, I think I'll pass.

!man fulltext s fins that

Oh. I use InnoDB.

finds

Why do they bully InnoDB?

!man fulltext s

see http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

MySQL Web site is really worthless for searching, and I assume they use their own thing.

ah, thx archivist

Catnip96, use Lucene or write your own or store the text in myisam
Catnip96, use Lucene or write your own or store the text in myisam
monsoon season over there as well?

Lucene… =Z

quite the opposite!

I have NEVER changed the Index Type so far.

were you affected by flooding at all?

not me no

BTREE seems to be default.
I have no idea what the others do.

99.99999% dont change it probably

hash is only available for MEMORY tables
for now

=Z

hash hasnt excited me yet at all, reminds me of Pick
dump and reload your data once a fortnight!!!
else your buckets shall be overflowing

select concat(year(curdate(),month(curdate()-2),7); should be 200757 but its 200777 y is that?

Why does this take 63ms? select * from cached_alerts where `unique`='0c86755e54d75e95'; Explain says nothing bad. It's using it's index.

the computer was busy doing something else

There are only 77 rows, and everytime I click it takes that long.

77 rows of how big

avg row length is 115

is it being written to as well

Nope

select concat(year(curdate()), month(curdate())-2, 7);

thanks. i got it.

I changed the engine to memory and it's the same thing

perljunkie, show processlist while the query is running

A couple sleepers.. Nothing really going on
Quad core machine.. fast as hell, and 100% idle.

odd
perljunkie, type of `unique`?

Yeah. Thats what i'm using. It happens with this query too : select * from cached_alerts where `id`='37'
I actually removed the index from id to see the difference and it still took 63ms

how big is the id field? Is is varchar or int?
if it's int, why are you using single quotes?

int, and good point. I'll try without

he cast time

Same ms without quotes

dont quote numbers

yeah, I didn't see it

now put the indexing back on.

63ms

also, does your field contain dupliacte values?
duplicate, rather

Nope

how many rows does your table contain?

77

do you need to select *? Can you select a single field instead?

Definitely
let me try
still 63ms

Then something else is happening.
is the server low on RAM? Is the CPU pegged?

pegged? it's idle.
1024528k total, 477500k used, 547028k free, 35960k buffers
0.0% us, 0.0% sy, 0.0% ni, 100.0% id, 0.0% wa, 0.0% hi, 0.0% si

ok I have no idea, then.
ask seekwill or threnody

lol. ok thanks.
seekwill. ok. thanks a lot

or a measurement technique error

his query should take ~3-10 ms

Think I should measure it myself and double check it ???
I've never seen a query go that fast on this machine. It's mysql 4.x. Maybe an upgrade would help.

eg somebody measuring the script engine startup time as well

HOLD ON LET ME PAST IT ALL 4 U

SELECT books.title, count(*) AS Authors
FROM books
JOIN book_authors

drop the caps

ON books.isbn = book_authors.isbn
SELECT books.title, count(*) AS Authors
GROUP BY books.title;

lol omg

FROM books
SELECT books.title, count(*) AS Authors
select fags.* from main_db.fags where location='#mysql' and fags = a lot of fags;
JOIN book_authors

use a pastebin, too.

FROM books

pastebin

try http://pastebin.ca or http://pastebin.mysql-es.org

I think he's trying to be funny.

they had trouble with him in ##php as well

he sounds slightly immature.

I think he is bored
Maybe it's my RH3 OS. It's old I guess.

hmm.. already mysql 6.0.0 .. that was quick

I'm trying to create a table with pk of type int, but i get error "key was too long, max key length is 767 bytes" , mysql 5 … any ideas ?
this is the error - is int not a valid data type for a pk ??? RROR 1071 (42000): Specified key was too long; max key length is 767 bytes

nkbreau, composite key?

how do you list the functions in a db?

you've obviosuly become the victim of an homosexual sql injection attack. Check the manual for "Depends".

i mean procedures

there is no composite keys…

how do you show procedures?

some tables were ok but others werent
actually it's the auto_increment tables that vailed
failed

BlkPoohba, look in the manual for SHOW
it is listed int here

archivist - http://pastebin.ca/636487
thats the create for one of the tables

maybe i'm just missing it… i see it tells you how to show the specific procedures but i forget a procedures name
ok. i figured it out

can anyone help me with that create statement ??

nkbreau, whats the create for the table it references

its just a simple lookup table
which created successfully
with no auto_increment
should i be using something other than innodb ??

it may well be but I ant create the table here as I get a 150
cant

ok, sec
archivist, full sql - http://pastebin.ca/index.php
i mean http://pastebin.ca/636489

well I notice an index on a 1024 field in there CREATE INDEX IX_Page_1 ON Page (filename ASC);

ok… but would that cause this error ?

well the error message told you

SIR, YOU ARE TALKING TO A NIGGER

– MySQL dump 10.9
– Host: localhost Database: prot_songportal
– ——————————————————
– Server version 4.1.22-standard
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

– Table structure for table `bs_autologin`

DROP TABLE IF EXISTS `bs_autologin`;
CREATE TABLE `bs_autologin` (
`al_ID` int(11) NOT NULL auto_increment,
`al_us_ID` int(11) NOT NULL default '0',
`al_key` varchar(32) NOT NULL default '',

wtf is that ?

a troll

often the mentally ill don't realize their condition.

lol wut was that
that was hilarious

archivist, even if i take that index out i still get the error… is the innodb type not what i should be using ?

nkbreau, no innodb is ok

omg

how do I force a data type when selecting?

CAST ?
never used it tho

ah, it's the unique on the filename it doesnt like

just remembering what i read
people are weird

what is the command to generate a create table script in mysql from an existing table in the database ?

show create table

SHOW CREATE TABLE

or mysqldump
caps lock makes you slow

hehe

http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html

Hello
I'm getting a SQL error, can anyone help please? SQL Error Query: SELECT * FROM games WHERE cat=\'Action\' AND id!=\'1\' ORDER BY RAND() DESC LIMIT 0, 5

what are those \ doing there

i dont know

do you actually have a field named id! ?

yes, in the games table there are those fileds
-e

is the filed id! a numeric datatype?
field*

int(10)

If I wanted to take 5 fields for a record, join them with a newline in between, and put them into another field, how can I do this?

!man PhilFX quotes

Sorry - I have no idea what function you're talking about! but try http://dev.mysql.com/philfx quotes

quotes

Use ` around identifiers (database/table/column/alias names) and ' around strings and dates. MySQL does allow " for strings, but ANSI standard uses " for identifiers (which you can enable with ANSI QUOTES option)

like UPDATE table SET field6 = CONCAT_WS('\n', field1, field2, field3, field4, field5); ?

try, as a test, 'select * from games where cat = 'Action' and id! = 1;'

ok, i will try, thanks

what naming convention do you guys normally use when you make a "mapping" table to map records from two tables?
for naming this third in-the-middle table, I mean

apples_oranges

okey, is there a standard for this matter?

it's all personal preference. I use plural for tables, single for columns.

yeah, but I meant more like apples_oranges_map, apples_oranges or what
whether you try to give it a descriptive name. Mine would in that case be very long

just remember how many times you may have to type it vs. your memory for what you meant. ;^)

exactly.. been evaluating that already, hehe. Thanks to both!

Why can you make comments in MySQL per-column but not per-index?!
I don't wanna name my index, but I wanna explain it.
Index_4 # Useful when running the heavy script lame_shit.php.
For example.
What directory?

the special one

the one the dba after you is most likely to stumble upon.

trawling text files can be entertaining

Hey

Have no fear, Aquaman is here

hahaha
hey seekwill

do that thing where you talk to the fish

Now you're more delicious.
Red Kool-Aid.

Who put me where?!

Aquafinaman - it's all tap water

ahahaha I prefer eating them than talking to them

Weirdos

Xgc, i got disconnected

i got it all fix.. but one small problem,, where do i put for "MySQL Database Name"
or wht do i type in

eh?
whatever db name you created in mysql
in the example commands i gave you, i think i used coppermine
for the database name

gallery

!man IF

see http://dev.mysql.com/doc/refman/5.0/en/if-statement.html

it's gallery

hi al
all

How do I change the default password ?
I thought it was root/root

I want to ask how I can optimize my mysql all databases and tables?

!m ekim| securing

ekim| see http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html

it's gallery

cant you just tell me what the password is ?

read that link it tells you and how to secure your system

http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html

got it
I might have set it at one time
but I dont remember

some know how I can optimize my mysql all databases and tables?

!tell megaspaz performance
!tell |messiah| performance
sorry

|messiah|, what sort of optimizing

when I start myqsl said an warning message
Checking for corrupt, not cleanly closed and upgrade needing tables.
said that
what I have to change?
or run?

it was doing it automatically

alwais when I start mysql
said that message

it's normal

ohh ok, and for optimize (delete the data that is not well delete) I have to run some command?

you mean to optimize a table?

it's gallery

When i enter with phpmyadmin

optimize table table_name;

said there is data that is no use
and can delete it
I think
maybe there is a command to clean all database delete the data that I don't use, etc..

optimize table table_name;

There can be any number of JOINs in a query?

and?

ok and for all database I can optimize?

if that's the database name, use that

There can be any number of JOINs in a query?
Or just one?

ok

many joins

Catnip96, upto the 60's iirc
Catnip96, but you will need to think about what you are doing at that sort of qty (straight_join)
bCatnip96, but you will need to think about what you are doing at that sort of qty (straight_join)/b

Hehe… 60 ones…
I guess 4 should be enough for anyone.

and what ?

be careful in too many JOINs, I had a multi delete that froze the system (as in, mouse barely worked) as the "optimiser" decided to find the best way to do it

Catnip96, ive tested upto 49 on a self join

whoa

That was a bitch to debug :p

:O

now if only i could figure out my nested set issue

_Lemon_, yes straight_join for that

I must admit I still don't know the difference between SELF, INNER, OUTER, LEFT and RIGHT JOINs.

i got really close, got everything except for querying by depth

So I just type "JOIN".
And it's worked so far.
Is there any sort of document that explains stuff like that in English?

hmmm, well I just ended breaking it up into about 10 smaller queries

The MySQL manual is… well… *coughes*… let's just say it could be improved.

!google sql JOIN tutorial

Google Returned 1,470,000 Results for sql JOIN tutorial, first 1:
SQL Join: http://www.w3schools.com/sql/sql_join.asp
SQL Join: a href="http://www.w3schools.com/sql/sql_join.asp"http://www.w3schools.com/sql/sql_join.asp/a

I frequently have many inner selects.
W3schools is spammed all over the Google SERPS, and it's a really bad site.

ewww, stay away from www.w3schools.com

i dunno… you felt the need to tell me twice that the db you created was named gallery

bueeee - w3 seo spam!

!nextresult

Blush, an unexpected wench error, manual section !nextresult not found

you all good or not?

Has nothing to do with W3.
I wonder why they haven't sued yet.

yes is gallery but what do i type in that area..

_Lemon_, setting your join order in advance is the trick with self joins

How can you sue for using www or w3? :s

type in what area?
you talking about install.php?
enter gallery

Can somebody quickly explain the difference in very broad terms between all the different sorts of JOINs?

what do i type in for "MySQL Database Name" in the boxline

And what is the default sort if you just type "JOIN"?

yes

the DATABASE NAME you created

ok hold
brb

Is laststars asking for help on third-party software?

which from what you said is gallery

And you're prioritizing him over me? :|

kick me please!

hehe
what size boot

any size

like George Bush, you broke it, you own it.

I hate all my subqueries.

.

hes all yours

ok i put gallery but error said" mySQL could not locate a database called 'gallery' please check the value entered for this, but i did create db name …

laststars, there prolly is gallery support

what do you mean by create db name

somewhere else

create database gallery; ?

i did

maybe the user doesn't have access to "gallery"

and did you create a user with access to that database?
hint grant command

oops i think i didnt create user for that database

well create one
:P

ok so how do i create user for that database

the grant command
which i gave you a bajillion times
and you promised me you'd write it down, print it out, yada yada yada
..

i didnt say promised but i will write it down
hang on let me drag the text i save

!wench beer megaspaz

Here megaspaz have a cool beer

I can't BELIEVE you're helping this guy with a lame third-party software problem and ignore me…

there is something called google
go there
Catnip96, i agree
not that i can help you ..
but you're still right

I also cannot believe how quiet this channel is for such a high number of users.
uI also cannot believe how quiet this channel is for such a high number of users./u

ok it this correct one
grant all privileges to your database name.* to some user name@localhost identified by 'somepassword';

flush privileges;

!m Catnip96 join

Catnip96 see http://dev.mysql.com/doc/refman/5.0/en/join.html

Yeah, well, that's the evil manual…

ok that grant command is wrong

oh

it's close but wrong

Catnip96 so read it

please correct to me please whare the grant command are

it's Friday night, some of us are out having sex or some such…

identified by 'somepassword';

INNER, CROSS, STRAIGHT, LEFT, OUTER, NATURAL, RIGHT JOIN… =Z =Z =Z =Z =Z =Z

then flush privileges;

Well, I have no life.

you leave me alone

Oh you too? It's a great life isn't it.

me, I'm watching Dr. Who on sci-fi channel

dbuser you'll want to use dbuser@localhost

Why is the MySQL manual written like a book rather than tech reference?

where dbuser is whatever user you create
lots of manuals are like that

k

Epic book.

unfortunately…
but i never thought the mysql manual was really that bad…

Yes… and it makes it extremely hard for me to learn what all the JOINs mean.
uYes… and it makes it extremely hard for me to learn what all the JOINs mean./u
INNER, CROSS, STRAIGHT, LEFT, OUTER, NATURAL and RIGHT. Sigh.

they assume you should be able to read if you want to use a database server

Catnip96, if the bot can read the manual, it should be easy for you

Are they vastly different? Or just good for performance?

Different.

http://en.wikipedia.org/wiki/Join_(SQL)

go to Border's 3x week, buy a coffee, read the book, take notes.

Border's 3x week… =Z

do i have to be in mysql root.. or what

what is that =Z meant to indicate?

OK, so INNER is default at least.
=Z — Very cfonfused.

cuz i am getting error in shell

s/cf/c/

Border's is one of those massive bookstores with coffee shops that don't complain when you read and not buy.
uBorder's is one of those massive bookstores with coffee shops that don't complain when you read and not buy./u

but cody's didn't have a coffee shop

do i have to be in mysql root.. or what
cuz i am getting error in shell

yes

That's strange.

k

I have never been to a coffee shop. Sounds like a UK thing.
Possibly USA as well.

yep

USA

it's worse in the uk

baltimore.. USA
red emma's
thats' where i'm at.. coffeeshop

where as every few blocks you'd see a starbucks, you'd see starbucks at every block in london, uk

and it is a small coffeeshop,bookstore, and you can read

as well as every other shop in london was a macdonald's, burger king, or some other fast food place…

most coffee houses in US provide free wifi (not Borders or Barnes&Noble, but the smaller indepenedents)

totally erie…

Strange business idea.

not really
you're trying to bring in traffic

works great

Cheapskates buying a coffee every now and then but usually just sit around and surf for free and read books without buying them?

and free anything brings in traffic
well you're hoping for volume traffic and potential buying

it said here ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for @localhost identified by

laststars for is a reserved word you could try `for`

I always see people at the cashiers at Border's buying $100 worth of books

manual grant
crap
!manual grant
dangit

!man grant

see http://dev.mysql.com/doc/refman/5.0/en/grant.html

:O

you seem like Mother Teresa to me tonight.
grant

oh
change for to to

identified by 'somepassword';

bleh

There's something about the JOIN and ONION (UNION?) keywords I cannot stand.

is it beerz tiem? kthnxbai.

finally now let see if that work from install

grant all on db_name.* to 'spaz'@'localhost' identified by 'scrbbelsers';

heh

megaspaz gets mega spasms.

only when i see yer mom

FINALLY thanks
it working

yay

won't last

heh

thanks for the help and i am sorry i am making you suffering with me

we're enjoying it
;^)

don't worry about it… next time, i'll be logged in as archivist

:-)

OUCH!
wha?

thanks guys bye

see yer
it does suck

impossible

ok… taking bets on the next time laststars reinstalls his mandy and is back here…
uok… taking bets on the next time laststars reinstalls his mandy and is back here…/u

Mandy?

why doesn't my socket work?

mandy == mandrake/mandriva

I give it five minutes.

I'm not sure your depth calculation is correct. In fact, there are a number of issues I see. Are you ready to discuss this?

doesn't matter… /me goes to see if it's possible to ghost archivist…

you have it on the wrong foot!

lol

Ghost him?

takez hiz nickz
yeah… like that's better…

Anyone seen The Simpson's movie yet?

nope
was planning on seeing it tomorrow… but san jose's having some city grand prix and parking will be nonexistent and traffic will suck

I'm also looking forward to the Futurama movie

ooh… there doing it?
yeah
that should rock

inevitable

hi all
i was wondering how you'd recommend installing the mysql-devel packages on OS X?

http://developer.apple.com/internet/opensource/osdb.html
straight from some mac dude…

well, thats for mysql itself.
from source.

yeah, the source should install the header files and what not
whatever you need to do mysql dev stuff

I am running mysql 5.1.20 on fc6. When I run the mysqld, it runs, but doen't show up on ndb_mgm. Any idea

ah yes, but since i already have it installed through other means - a source install would be overkill. hmm, perhaps i should check if fink or something have them

ah
yeah… i suppose that's the better way then

tintin, curiously, whats ndb_mgm?
hope it works

Correction. Depth is ok.

cluster management
cluster management console

ah

hi Xgc

5.1.20 mysql cluster is pain in the ass to install…

true.. depth is ok.. just not in ontext
context*

But your data looks strange.

strange in what way?

Let's start at the beginning. I'll ask a couple of simple questions. First, why would node cid=1 have a left = 1 and right = 14?
I started with the parent hierarchy, which seemed ok. But when I compared that with the left/right constructs, they didn't seem to match.

want to ask a question what website i can able to have redirect dns to my private server beside no-ip?

afraid.org
they do port redirection for free
i don't use any of them, so you need to deal with them directly

afraid.org

yar

Xgc, the root of the tree matches on modid, itemtype, objectid

weird for that name co. eh eh

so each set of those has it's own tree

http://freedns.afraid.org/?no_webforward_found_for_afraid.org

so the left and rights match as far as i could tell

cuz i dont want to use the ip number to connect my own server i perfer to use name for it..

get a domain name?
-_-;

there's also dyndns

I don't think the current assignment of ids allows you to use them in the left/right form.

how so?

I understand you may have several trees.

cant use domain name for private server can it ?
if so how

But the parent assignment is not constrained by the tree type identifiers. The parent structure should stand on its own.

well that could lead to alot of tables
1 per article
and there are tons of sites with 1000 articles

Right now you have a root of a tree at cid=1. Correct?

that is 1 root
the other is at cid 8
or rather 13

Let's stick with one tree.
cid 2 and 3 are direct children of cid=1, corrct?

yes
and 7

Well, this can't hold up if cid 2 or 3 has children, since there is not valid left/right integer values that would keep those ids entirely to the left or right of the other side of the tree.
s/not/no

and 7?
err
?

Right. I see 7. The tree is already broken, I think.

the count looks ok to me

You have to reassign ids as you insert into the tree.

hmm..
aha.. so the code itself is broken

To make sure the left/right assignments are valid, the values of ids under a node need to be within the range.
The SQL looks reasonable, but the data/tree is broken.

they look within the range of 2 and 7
the children that is
of head 1

3 is between 2 and 7.
That breaks the tree.

oh.. it shouldn't be..

Correct.
The parents ahve to be reassigned as more nodes are added. That's part of the problem with maintaining this type of structure.

the parents are reasigned in the code
Xgc, http://rafb.net/p/giulIq62.html
it's kind of a mess, which is why i'm into this issue at all
but i thought that part was sound at least

One moment. Let me recheck your structure. I may have made a mistake trying to compare the parent hierarchy with the nested set values.
I need a nice automated drawing program for this kind of structure.

Xgc, for real
but in the meantime you can concat with spaces for indent
kinda lame
but it'll work

Ok. I'm fine with the nested set.
So now the depth, which seemed ok, should be fine.

well try the query

The method of counting depth looks ok.

i got odd numbers
like the head 1 count was really off.. while head 2 and head 3 were fine

Ok. Explain at a high level what you expected the outer most join to provide. Where you just trying to find the depth of each node?

g'day. i did an rsync of a whole box (for xen), but when i try to run queries on some tables on the new box, i get this error: "ERROR 1033 (HY000): Incorrect information in file: './rt3/Users.frm'". this Users.frm file has exactly the same md5 sum as the original - why would this happen?

s/Where/Were

i want to get only the nodes at a certain level
so i could say &depth=x on the query string and only get depth x of the tree

hi

That's all? I'll post something. One moment.

how can I know the total number of distinct rows that there are in table?
select count(a.id) from sponsorships a, pledges b where a.pledge_id=b.id and a.name='something'; gives me the total number of just a kind of row

select count(distinct *) from table

oh thanks

count(distinct a.id)

what did you think I wanted?

select count(distinct a.id) from sponsorships a, pledges b where a.pledge_id=b.id;

http://rafb.net/p/5kzf7I46.html

I am doing that and still get the total number
I just have six kind of pledges
do you know what I mean?
sponsorships has a foreign_key from pledge and in pledge I have just six kind of them
I would like to have a table with six rows where each shows how many of the there is
or this is not possible in only one query
?
anyone?

Simple as that. Now, you mentioned earlier today that you wanted nodes some depth under a given node, not necessarily from the top of the system. Maybe that's what you were attempting.
Did you want the depth specified relative to the given node?

Xgc, do you know how could I do that?

We're climbing trees at the moment.

ok

and finally, depth=1 from cid=1: http://rafb.net/p/398ApF49.html
Done.
Notice how cid=14 isn't in the result, since it's in a separate tree, although it also has depth=1.
It's just not in the cid=1 subtree.
Earth to johnny.

sorry
i'm at work
and i was running the closing

That's the final answer.

i'll be able to talk in about 10 minutes

I've got a column that contains comma separated values. How can I structure a WHERE clause so I can select a row if one of those CSVs is, say, "Google"?

like '%Google%' mebbe?

Bad idea. If you add a separator at the beginning and end of the list, WHERE field LIKE '%,Google,%'

Blah

blah

indeed

It'll be fairly slow. You need a better structure.

be home in a bit

They're supposed to be subject tags for a blog post
How might I better structure those then?

Very poor design. You should change that.
Let the subjects per post be in a separate table.

?

It's called a relational database. The reason for the separation is normalization and to meet the fundamental rules set down by Mr. Codd.
http://en.wikipedia.org/wiki/Codd's_12_rules
This is all fairly basic, but critical to the proper design of these types of systems.

No, I understand what a separate table would mean
I just don't get how it would be structured

"Codd's 12 rules are a set of thirteen rules proposed by Edgar F. Codd," … why is it called 12 rules if there are thirteen rules. this doesn't make a whole lot of sense to me?!

subject table would have a row for each available subject. subject_post would have a row for each [subject, post] pair.


So you mean, two extra tables

[Apollo]-AFK: He meant Rule [NULL] and we all know COUNT(rule) wouldn't include the null.
b[Apollo]-AFK: He meant Rule [NULL] and we all know COUNT(rule) wouldn't include the null./b
Absolutely.
Structure is good.

Right. Scrapping that feature then ^_^

Tables are good.
1 table to hold all tends to be bad, very bad.

True
I just don't know if I'm not-lazy enough to make extra tables just to have subject lables

You'll eventually figure it out, if you stick with it.

*labels
No, I can do it. I'm just not motivated
I don't even use the category feature…

You might be motivated when these LIKE expressions start to bog down your queries, since they can't use indexes.

No, I don't want to use LIKE. I know that'll be slow
I've been having a hard enough time figuring out this darn search …
I have a table for the posts and a table for the comments, so when performing a fulltext search for both comments and posts matching that term, I've had to do two search queries and then use a temporary table to order them by relevance regardless of type
Then to use pagination I've had to store them as arrays in PHP session data.
This solution seems kind of not-ideal for me, but I haven't figured out an alternative.

You really should listen to Xgc

I am listening

Ok

I was just debating whether or not I was motivated enough to actually create the tables, or whether I should scrap the feature itself

Scrap the feature. Users don't need it

Eh, users don't need these "feature" things.
And then I was throwing out my other SQL problem just in case anyone with more experience might have a better way of doing it.

You don't really want users either. They hog up bandwidth

I asked a bunch of people if there was any way of full text searching two tables and they were like, "Er …?" as if no one had ever asked that.

but then who else would you blame for when you fubar stuff? :P

Well, usually that's a bad idea

Nah. I take full responsibility for that
So I've been learning.

rule #1. never accept the blame even when it's obvious you're at fault.
:P
rule #2. see rule #1.

But is my current implementation any better? Or am I doing it totally wrong?

I have no idea what you are doing

I explaine dit above

That doesn't mean I read it

if I have a 1:* relationship, how do I select the 1st of the many for each of the 1: side of the relationship?

I saw Xgc say something and you saying "No"

Would you read it now and then offer me an opinion?

Define "first". SELECT a, MIN(b) FROM table GROUP BY a

will that the MIN(b) for EACH of a ?

Well, Xgc knows 1020x more than me

Ah

Thta's what a gROUP BY is all about

will it work well with JOINs?

Sure

OK, lets try this
this sucks, I need some test data, heh

I have what should be an obvious problem with syntax for an insert statement, and I must be reading the manual wrong because it seems I should be right
uI have what should be an obvious problem with syntax for an insert statement, and I must be reading the manual wrong because it seems I should be right/u

anybody know how to export/import data from an old mysql database without using mysqldump? My old computer died, but I was able to grab the contents of the hard drive

How old is 'old'?

… I don't know how mysql data is stored in the filesystem

As files

not really that old
like a month

Well that's just realtive
Dude, that's ancient

lol

From your description, comments == posts. Place them in one table and link them such that the original post has a reference_id to itself and each comment has a reference_id to the original post. Then you can fulltest search the one table for matches.
fulltext, that is.

there shouldn't be any version problems

can I get a little more help, I have a self join, and I'm unsure how to do this. *tries to explain*

Just copy the datafiles over then

I tried that but I didn't get any structure or data in my tables, just the table names

Joins do not affect your original question

looks like I'm having a problem with quotes; how do I use double quotes?

yes, but they confuse the HECK outta me

Paste query
First, make the join

Sometimes more tables == bad. It's a strange world.

Make sure the join works.

Unfortunately, the fields differ

I guess I need to make some test data

insert into test ("a","b","c") values ("1","2","3"),("4","5","6");

That's not an issue.

Why not?

Don't quote your columns
Use ' instead for the VALUES stuff

automation requires it

The basic purpose of a comment and a post are the same. Merge the common features and place the differences in other tables if you wish.

Automation?

yes, taking it from a .csv file

So?

some programs use the double quotes

Stop
If the data is coming from CSV, use LOAD DATA INFILE

I have no control of it

What "program"

it's actually from my stock broker

Well I'm only searching the heading and content of a post and the content of a comment, which I've got indexed. So you're saying to put these three fields together in a single table and then put the other things separately?

Proper design often involves identifying these common structures that need to be handled similarly, like the text of a comment and post.

If you want some help, you're going to have to be waay more specific

There appears to be an opportunity here. I'm just offering a suggestion.

Now what if I want to expand this in the future and I start handling different types of data?

if it helps, the old version I'm looking at is 5.0.14 and the new one is 5.0.45
would the datafile format have changed between versions?

The text of the post and comment will not change. If you ever decide the text of a comment or post needs to be a picture/blob, you have some work to do. Your fulltext search may need to be upgraded.

ie, should a 5.0.45 installation recognize 5.0.14 datafiles?

Yes

Sorry, maybe I worded that wrong. What I mean is, what if I expand what I'm searching, into pages on a site, etc–things that aren't similar to posts and comments.

Time for a movie on my new DVD player

and all I need to copy over is the folder that corresponds to the database I want?

Then you'll probably want an even more general design, not less.

-_-
Sigh. Thank you for your help. Really, I appreciate it.
I just dislike "general"

hmm I think permissions are an issue here

Obviously the way my mind organizes things is totally different from the way relational databases organize things.
Sometimes, it would be easier if I were more normal…

You keep trying to avoid the issue. Why ask if you think you have the best answer? The comment text and the post text should probably be treated similarly. That's pretty obvious. The fact that there are other things that aren't as easy to process, doesn't change that.
from an application point of view (forget the normal structure for a moment) this type of common handling of objects is very important.

I only recently decided I might possibly be able to wrap my head around OOP

That could cut a fair amount of work directly in half if done correctly.

For the longest time I've been unable to understand it
That's the problem. I don't know if I'm doing it correctly. Hence why I'm asking.

It's certainly possible you aren't quite ready to sink your mits into this yet. No shame in that.

The only way I'll ever be ready is if I try it.
But I guess I'm learning OOP procedurally, if that makes any sense.

lol
you mean step by step?

Systematic destruction via LIKE '%,ouch,%';
Do we have a winner?

i have one little problem but overall the coppermine is working but i cant even able to upload any pix to my coppermine what can i do now
ui have one little problem but overall the coppermine is working but i cant even able to upload any pix to my coppermine what can i do now/u

so… I've taken a closer look at my datafiles, and it appears there are three types of file in a database folder: .frm, .MYI and .MYD. In the database I want, there are only .frm files, and I could only find the data in ibdata1. Is this unusual?

create a directory in /path/docroot/coppermine-install/albums called uploads

/path/docroot/coppermine-install/albums

aha.. awesome ..
Xgc, sorry, i had an unexpected guest to stay over, so i had to set him up

You're welcome.

Xgc, truly i am.. and thank you

in a many to many relationship, a join table is used, right?

Yes.

ok, thanks
now in this table, do I just want to use pure id numbers or 2 foreign keys?

Two foreign keys, which together are the primary key.

ok, that makes sense
i'm trying to run this SQL
ALTER TABLE `designs` ADD FOREIGN KEY (`category_id`) REFERENCES `category`(`id`);
but I get this error:
Key column 'category_id' doesn't exist in table
even though this syntax has always worked before

designs doesn't have that column.

yeah, i'm trying to add it as a new foreign key

You need the column first.

what type does it need to be?
just an int?

Adding a key doesn't add a column.

well, i usually just create my foreign keys when making a table

whatever fits your data.

The key a a structure that refers to an existing column or set of columns.
s/a a/is a/

so, since this refers to an int, it should be an int

It needs to match the type of the corresponding column(s) in the parent table.

ok, i follow

and also match the column order of the parent key.

column order?
keys point to columns…

(x,y) would not be a proper foreign key to refer to a primary key (y,x)

oh, well, i'm not using multiple columns in my keys…yet

Keys can be composites. I was just completing the description.

right, thanks for the help, Xgc

You're welcome.

if I have a mysqldump/phpmyadmin dump.. is there some how to easily excute it again through PHP?

Any way I can see verbose info from mysql such as things like failed logins? A script is unable to authenticate, and I can't figure out why.

ok im officially desperate - has anyone here encoded any x264 movies :/

hi i'm wanting to use ` symbols in a query but am getting an error
how can i work around this?

escape it?

ah like \' ?
welcome to rookie hour

x264? or x263 ?
in any case, try ffmpeg in combination with libavcodecs
4044800 kB; … is it possible to free this space to fs ?

why?

why what? because it's spare 4G that i could use

:-) use for what?
have y better choice??

i dont need this table to have that much space anymore
it was collecting log information, but now it only has past day and the rest is summarized and cleaned up..

aha :-)
in config file is many innodb settings, go there, change this value and restart the server

so, is there anything i could do to free space from innodb tablespace back to disk?

but i don't know whitch one exctly for your problem

i have a per-table tablespaces btw

i know exactly only about innodb_pool_buffer_size - space for innodb indexes

What does this mean
?
0
0 mysqld

I perl with DBI. now I execute an sql statement that works in the mysql console, but here in perl it gives an error becasue it is seemingly not able to accept an alias of a subquery (let's say 'derivee') - in the from clause of the outer query - at other places in the outer query. Why?
of course I use mysql

thats mean, nothing is running ;-)
mayby another result set. i'm using any aplication with mysql and this aplication don't can understand some specific comands, whitch is no problem in console

thanks

hey
can i have multiple indexes?

yers
how many would you like ?

two
for one table
atm it has two fields
and i want to optimise it

you can set up to 250 per table if I remember correctly

ah, thats good

optimise how ?

mysql is awesome
make it faster for a particular query

wordid

and back

then index it one whatever that qwuery queries
*on

(basically an fast associative away)

*query
beh

ok

will you be doing exact searches, or partial matches ?
on the word

this is exact searches for now
how does this change things?
if i want partial matches?

then set your PK to word, wordid, and set a normal index to wordid

pk?

you can't use indexes if you don't start at the left of the word
Primary Key == the primary index of a tahle

can't you only have one primary key?

if you want to be able to search inside of the word list, you have to use full text indexing instead
yes, but it can contain more than one field

ok

if you primary key is (word,wordid) then the index is the table, which means the index search will return the actual results as well
that's called a clustered index, meaning the index causes the table to be in index order

ah, ok
fun

(it's a lot more expensive on bigger tables)
the second index (idx_id, or what have you) will point back from wordid to word, but the index only stores the wordid this time
depending on the ratio of searches (for words or ids) you make one or the other the clustered index (and the primary key)

http://www.google.com/technology/pigeonrank.html

hi
is it safe to repair a database while it's being used?

how to connect html web page and mysql

with great care

someone help me, mysql is new for me… how to connect html web page and mysql ?

you must learn

Have anyone have installed SphinxSE mysql storage engine under freebsd ?

and there is much to be learnt

I have probs at run sh BUILD/autorun.sh

So riddle me this.
What are the advantages of say ..
IF you have a username column which you specify as a VARCHAR(255), what are the benefits of just specifying it as VARCHAR(16) if the maximum value ever entered will be 16 anyway?

you're just enforcing business rules
lets say you're setting up a column to store some ID number
the format is 7 digits plus 2 checkdigits
that makes 9
if you force it to 9, you ensure that at least SOME mistakes wll be icaught by the DB

Ahh okay, so any perfomance advantages?

no not performance
just Making Sense

Yep.
I get it.
Thanks.

whenever things arent in my control, i set them up as 255
like reference codes that come from other systems
cheers

Yeah, I usually just follow what I said for example, 16 char username limit, I set it in the DB as well if I don't think I'm gonna change it on the front end later

out for lunch, see ya!

can somebody explain me the difference between MyISAM and InnoDB?

seba, yes
different engines
InnoDB is transaction safe
and MyISAM isn't

any other differtences?

many actually
but that is the main one
myIsam is built for reading speed - InnoDB not so. MyIsam has table locking and InnoDB row locking
read up on the engines in the manual

is there a way to know what the next AUTO_INCREMENT number of a table would be after the next INSERT ?

max(autoincrementing field) + 1 ?

i dont think so

ok

http://ebergen.net/wordpress/2007/03/20/dont-reference-auto-increment-ids-outside-of-mysql/

is there any open source tool that creates java script or html when i drag and drop buttons ?
web design tool

Hi, can anyone shed any light on this ON DUPLICATE KEY UPDATE failing? http://www.sitepoint.com/forums/showthread.php?t=493596

Is it possible to convert a live database to master-master replication without downtime?

how can i group records in reultset *quarter-hourly* (for instance, basically, i would like to control the ranges in minutes)
group by hour(ts)/4 didnt seem to do anything different from hour(ts)

Comments

so let me get this right since i have 3 tables like user_tbl user_id user_nameuser_addr file_tbl file_idfile_namefile_desc

why don't you just delete the datadir and run mysql_install_db ?

1 PM" is there a way to cast this into a TIMESTAMP of any

This was going to be my "learn Django" environment, so I can hose it and start fresh if I need to.

yup

Where would the data dir be located?

cereal_-_: you should store it as a DATETIME or similar

Agreed - but need to get it to something like that.

you could locate it by locate mysql/mysql probably

what disk innodb_flush_method do you use ?

Is there any way I could do this or am I SOL/
?

cereal_-_: str_to_date

I've been trying to do that, and it hates me…turns it all to null.
let me get the sql command I had be attempting…

cereal_-_: well it works, trust me
a few. That's something you should choose based on the environment

not sure what I'm looking for…found a ton of mysql/mysql, but not sure which one's the data dir.

UPDATE `news` SET `tstamp` = str_to_date(`dte`, '%Y-%c-%d %T');

I use Redhat enterprise chadmaynard

Is that way off?

but, I found /opt/local/lib/mysql5/bin which has the commands I was looking for earlier…mysqld_safe, etc.
Should I have run those from here instead?

just cant seem to find anywhere if I should use innodb_flush_method=O_DIRECT or not on redhat enterprise

try locate mysql/test

nothing found.

sorta
try locate user.MYD

also nothing found.

Any ideas? Because that doesnt seem to do anything for me other than give me a null output.

1 PM', '%M %d, %Y %l:%i
UPDATE table SET newCol = STR_TO_DATE(oldCol, '%M %d, %Y %l:%i %p');
how about user.frm?

thanks — I must have confused myself with the output…

cereal_-_: bummer
well?

"sudo locate user.frm" also gives me no output…tried user.MYD with various forms of capitalization, but didn't make a difference.

herm
ps ax | grep mysql | grep -v grep

0.01 /opt/local/bin/daemondo –label=mysql5 –start-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start ;
0.01 sudo /opt/local/bin/mysqld_safe5
0.03 /bin/sh
0.61 /opt/local/libexec/mysqld –basedir=/opt/local –datadir=/opt/local/var/db/mysql5 –user=mysql

there she is!
kill 28; kill 774; kill 805; kill 818; rm -fr /opt/local/var/db/mysql5/*

Morning all

ok, done, except it didn't find process 818. Now how do I re-start the mysql setup process?

mysql_install_db

This time, hopefully, by setting an admin password?

ok i asked this last night but the answer didnt work so here goes
if i have two tables, old and new, old contains 12,000 names, ages, emails and shoesizes and new contains 9,000 names, how would i copy over the details for the names in new from old

12,000 shoe sizes?
cool

rofl

you must really like feet

Someone correct me if I am really offbase with this but can't you just create a new table in the catabase and for type do type=MERGE UNION(feet1,feet2) INSERT_METHOD=LAST; or something such as that to merge them?

i really do like feet ,
you wouldnt believe what shoe size row 2560 has :P

When I do /opt/local/lib/mysql5/bin/mysqladmin -u root -h dave-chakrabartis-computer.local password 'new-password' do I need to include the single quotes around the new password?

yah….
did you go ahead of me?????

TheNo1Yeti, i dont want 12,000 names in my new table

Not yet…tried mysql_install_db, worked when I sudo, now I'm reading through the resulting doc

i only want the details for the 9,000

Says I need to set up a new password for root, hence my question.
Trying it now…

you'll have to restart mysqld_safe of course
you could select details with a JOIN right?????

/opt/local/lib/mysql5/bin/mysqladmin: connect to server at 'localhost' failed
'Access denied for user 'root'@'localhost' (using password: NO)'

if you know how to do that then maybe you just need to know that UPDATE syntax supports joins as well

chadmaynard, i've never done joins

what'd you type to get that?

sudo /opt/local/lib/mysql5/bin/mysqladmin -u root password 'passwordtext'

update shoes2 t1 join shoes1 t2 on t1.name=t2.name SET t1.size = t2.size, …
dom2 ^
sudo /opt/local/lib/mysql5/bin/mysql -uroot fails?

sudo /path/mysqld_safe, I get:
Starting mysqld daemon with databases from /opt/local/var/db/mysql5
STOPPING server from pid file /opt/local/var/db/mysql5/dave-chakrabartis-computer.local.pid
6 mysqld

Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)

read the .err file to see why. My bet is you messed up in mysql_install_db somehow

Where's the .err live?

ok ill try that chad

ls -la /opt/local/var/db/mysql5/
you can show me the query if you can't get it to flow

This seems to be the problem:
4 [ERROR] Can't start server: Bind on TCP/IP port: Address already in
4 [ERROR] Do you already have another mysqld server running on port: 3306
4 [ERROR]
….looks like there was another instance of mysqld already running?

so you already started mysqld????
yep
ok 3AM is my bed time. I have to go now.
goodbye all

Thanks, chad!
I'll tinker some more, but I really appreciate the patient help

you are getting close! don't give up

'night
I know…will fix this over the weekend, I'm certain.

back to square zero
DELETE FROM cubecartstore_inventoryXX WHERE supplier = 'techpac' and cat_id NOT IN
Error - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELETE FROM cubecartstore_inventoryXX WHERE supplier = 'techpac
i honestly can't see what i've done wrong
should i put ` ` around the table name?
mysql 4.0.27

when in doubt, use `
or look up the reserved words
!man reserved words

see http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

azuranz, change the delete into a select…
select * from cubecartstore where supplier = 'techpac' and cat_id not in (123,123,123,123);
once you got it working, swap to delete
or , practice on a temporary table
create temporary table testing like cubestore;

here's the thing

insert into testing select * from cubestore limit 100;
practice on testing
what's the thing/

when i run the script via phpmyadmin it works
After-Import script
that line keeps throwing the error

azuranz, I'm not sure what's going on.. maybe it preparses it .. maybe something else, but the way to find out capture tcp packets and see what it sends, binlog on mysql to see what it sends, or enable client debugging in the app.. I dunno what that EMS Mysql Data Import is..

oh really
how can i capture tcp packet
will tcp contain the data query it's sending in plain text?
hold on
when you use a delete from query you can't put ` ` around fieldnames right

you can use `'s around any column name/table name

i was told you can't in DELETE statements

news to me

yeah man. by 2 people just 1 hour ago
in here
anyway i removed the “ ill try it again

insert into testing values (1);

Query OK, 1 row affected (0.00 sec)

delete from `testing` where `id` = 1;

Query OK, 1 row affected (0.00 sec)
azuranz, maybe in mysql 4

yeah
testing it now
ok think it worked
doing commandline update to test
praying this works…
cause it takes like 10 minutes to upload all

Is there a way to temporarily allow just root mysql logins so I can do an export/backup without having to turn every site offline?

http://pastebin.zentrack.net/12520
been stuck on it for 2 hours now

check mysqldump options. I believe you can tell it to lock all tables while doing a dump

i have problem i did create database gallery but it kept telling me mySQL could not locate a database called '' please check the value entered for this" how do i get this to work..

um… the value should just be gallery
you need to also tell it the server and the mysql connection port
all that should be taken care of by that initial install php script

are you issuing these as seperate queries or all at once?

how do i do that it been long time not doing this since last time you helped me was work great till my system was messed how ….

one after another
separate

ok… the cheap way is to go into your /path/to/docroot/coppermine_install/include and edit the config.inc.php file
in there you should see the database values to use
everything's in single quotes

ok what do i do with the value ?

dbserver = 'localhost'… etc…

k brb

just add the values
don't just add lines

k

you should see things like $CONFIG['dbserver'] = … etc…
after the = , just add 'the_right_value'

k
brb

TooBee can i pm you
just quickly

well that doesn't make sense… I was thinking you were pushing the whole thing to the DB as one giant string with ; delimiting queries which some (all?) APIs don't allow to minimize the risk of SQL injection attacks

to be honest i dont know
was just guessing
it's sent to the database via a Mysql Gui program ~ ems mysql data import
i've narrowed down the problem though
in my pastebin @ http://pastebin.zentrack.net/12520
if i remove line 7 the error is resolved
i found this out cause i removed line 8, and then the error was simply thrown and quoting line 9
instead of line 8. so i removed line 7 tested and it ran fine
any ideas now? issues with line 7? mysql 4.0
it's weird cause i ran line 7 query via phpmyAdmin and it worked fine no error

ah so it is some error in that huge query that is causing it to not interpret ; as the end of the query

i see

hmm
don't see any obvioius unbalance parens or quotes…

neither
i'll try by removing the extra not Likes after the NOT in
godam.
the GUI version of the program runs the script ok.
commandline executed ok
hm

hmm maybe an unescaped special character somewhere in the middle that the gui util is automatically escaping?
oh…

very weird
oh hold on
ok you know what it is
the queries too long the programs cutting it off

hehe

how can i restructure this query to be shorter

nasty… but maybe put all the values into a table and do and cat_id NOT in (select * from other_table)
hmm but that might not work in 4.0

screw it ill remove the query
what a waste of 2 hours
mysql is such a s*** language for debugging
uninformative error messages 24/7

yea, it could be a lot better

ok i found it in kwrite i see it but what do i do to input ?

well, what's in there?

$CONFIG['dbserver'] = 'localhost'; // Your database server

well, you put in the values you used when creating the database
dbserver can stay localhost
the only other thing that would stay the same is the table prefix

Take 123123

i think everything else your values

i am sorry i am still confuse

guys, is there anyway to do stored routine READ from server1 and WRITE to server2 ?

how do i update database

yeah. its called perl :p

ToeBee, heh, no really :p I need to update summary table hourly from table of 20million record and growing

what happens when you do http://localhost/install.php?
and you put in the right values?

where do i put the value you mean the MySQL table prefix?

usually, it's just he default
whatever's already there

it dose open then i put my information there like name, user pasword,etc then it asking for where the database is and mysql user and password etc..

and they are on different servers?

right

ToeBee, yes

when i put where the database but still error

so what's the error exactly?
i can't read your browser from here

mySQL could not locate a database called '' please check the value entered for this

well you didn't add the database name

you asked me to create as i did last night

'' == nothing entered/empty string

dang so what do i do now to make sure it there

the install.php didn't take in whatever you put in for the db name
show databases;

ok hold

hmm well that sounds like a job for a script and a cronjob to me…

ToeBee, yeah but since it's all SQL then why not moving it into SQL script that read and fill

show databases show database;

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show database' at line 1

laststars show is a reserved word you could try `show`

show databases;
plural

same thing

show databases;

+———-+
| Database |

well maybe you could do something with mysqldump piped to ssh piped to mysql on the other end… but you'll still have to initiate it externally somehow. The only server-to-server communication I'm aware of is replication

shoud show you something like that, but with your dbs

now if they were on the same server just different databases it would be a different story

or mebbe it's different depending on the version of mysql you're using
*shrugs*

oh got it hang on
ok i see 6 row each title
i see database and gallery and others

so then for database name, you put in gallery
for dbserver, if you're on the machine where mysql is running, you can put in localhost
for the user, put in the mysql user you created that you gave full privileges to for the gallery database

i put gallery in the install.php page right

you made sure that the prereq's for running install.php were satisfied?
other than that, i have no idea why install.php isn't keeping the value you enter…

k i do the best i can.. i kinda frustration….

seems to be a php issue or a coppermine issue.
either way, you'll get quicker help on the coppermine forums
they're pretty decent at answering questions
and i haven't set up coppermine for years
since, i'm big on backing up

i did go there but not lot of that kind of information i am looking for.. but when you were using the IMs and helpmed me it was lot easier then this chat room
i remember you had your coppermine in your system,, with the animation stuffs.

well, if you're putting in the right values in the right places, i don't know what else the issue could be with install.php
afaik, when i put in the info, it just worked

i know it makeing me mad it not working and it making me crazy just trying to get it back to work ya know

but that was a long time ago on an old version of coppermine that's been continually updated

i have the updated one then the old one

hi! I have a noob question it must be easy but i dont know how… i want to insert a row into a table with an increment item, but i dont want to duplicate it, means i dont want rows with same values but the increment item is different

sorry it's frustrating you. not much else i can tell you

i still have the back up when i put back in there not work

well, the problem isn't the old config, the problem will be that you didn't back up the database

true but i pissed me off ya know but damn

if you had the old database and the old coppermine version, you could put everything in the right place and it should work
provided you back up and preserve permissions

yeah but oh wekll

and file ownerships

do you know anything bout webmin

city_state_id int unsigned foreign key(dealer_states, state_id) on delete cascade

nope

What is wrong with that line?

oh just wondering

webmin's just a web interface mysql control panel?

hei me is talking!

`so uh
city_state_id int unsigned foreign key(dealer_states, state_id) on delete cascade
what am i doing wrong there? anyone?

what you want to do, and what does it do?

i get an error

well city_state isnt a mysql command, and which error do you get?

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign key(dealer_states, state_id) on delete cascade
)' at line 4
key(dealer_states, state_id) on delete cascade
)' at line 4

brian foreign is a reserved word you could try `foreign`

ey(dealer_states, state_id) on delete cascade
)' at line 4
ear 'foreign key(dealer_states, state_id) on delete cascade
)' at line 4
oops
sorry
oh wait

i give up.. thanks for helping

I need a MyISAM table for foreign keys huh?

insert into sys_docxs (arc_id,doc_id,usr_id,rights) select arc_id,doc_id,usr_id,'' from
sys_docxs as b where b.arc_id= 7 and b.doc_id = 14 and b.usr_id= 15 on duplicate key
update b.arc_id =arc_id and doc_id = b.doc_id and usr_id = b.usr_id;
tells me table '

hey there

tells me unknown table 'b' in field list
hi
why?

Hi MFOX
I'd like select 56th rows of one table with high performances , I have to say there is no any specific ID for that row - how can I do this in mySQL
?

again the question? you want to select the 56th row or rows?

I have one table with 12000 Rows
and I would select row 56

which language?

T-SQL

uhm… dont know, in delphi, c and php, i could say next record 56 times…
55 times i mean

!m arpa_ limit

arpa_ see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html

yeah… the_wench fails
http://php.about.com/od/mysqlcommands/g/Limit_sql.htm

is htere anyother option for on duplicate key?

OK
But this is not good solution for my Project

i want to update a existing record (with an unique id, which i dont know, well i could know, but it will cost me another query)

in Limit you are going search in ID
but my table doesn't have any unique ID

or if the record doesnt exist create a new one

huh?

there is no ID colum to specific rows number

limit operates on the resultset

I have one table with 2 colums one is FirstName and the other one is Family
only these two colums and I would like select row 56

arpa_, why don't you have any IDs?

there is no need ID

arpa_, really?

yeah

arpa_, seems like you wouldn't have silly problems like this one if you had an id.

so select * from table limit 56, 1

ToeBee, stop encouraging him :o

but It will be select all of first 56 rows , isn't it ?

read the URL I pasted

ToeBee, you're a sinner.

of course the problem is that "56th row" really doesn't mean anything unless you can sort by something

ToeBee I'm saying something diffrent ok?
ok how can I sort that when my table doesn't have any ID ?

tables have no order

what is your solution ?

well you can either sort by FirstName or by Family

)) ok BRB

er… um…
-_-;

is there any easy solution to my problem?
replace seems odd since it creates always a new id, and doesnt work as i spected…

megaspaz, does arpa_ make you cry too?

REPLACE is DELETE/INSERT…
So… yeah, creates new ID. What did you need?
There is no crying in #mysql

the problem is, the db structure will be updated in 6 months, since the data is growing very fast

I don't see how that is a problem

but till there i need to put in one table a lot of information

ok

iskywalker, what exactly are you doing in this table?

but maybe a replace could do the job. the problem is very simple

What is the "problem"?

atm, for deleteing a document from a table i insert into another table (rights of documents) an entry where the usr has no right at all for this document

iskywalker, that doesn't tell me anything.
I have no clue what you're referencng.

so i must replace the existing rights or insert a new item with 0 rights
so i must replace the existing rights or insert a new item with 0 rights
bso i must replace the existing rights or insert a new item with 0 rights/b
i dont want to query an update for see f the entry already exists and do an update

Maybe you want INSERT … ON DUPLICATE KEY UPDATE

an insert i mean

Maybe you want INSERT … ON DUPLICATE KEY UPDATE

seekwill, hi!

yes i thought that too, but i must know the value of the key right?

no
The key is a unique or PK
index in the table
In your case, you would have the PK the user_id

yes i have a unique key on this table.

Great
I thought you were hiding from me?

No.
I was hiding my emotears from you.

We don't do emo in #mysql either

Crap.
Heh.
So no fun in #mysql?

Nope

so seekwill

So brian

how long have you been using mysql

Tomorrow will be month two

insert into sys_docxs (arc_id,doc_id,usr_id,rights) values (7,14,15,'') on duplicate key update docxs_id
docxs_id is my unique key
the above doesnt work…

!m iskywalker insert

iskywalker see http://dev.mysql.com/doc/refman/5.0/en/insert.html

http://rafb.net/p/x0cq9933.html — Is my database design retarded?

yes

You didn't even look.

But you said it. I can assume

Stop that.

Stop what?

Look at the URL before jumping to conclusions.
after you look at the URL you can jump to conclusions.

But that would be wasting valuable resources
ok

so much for sene of humior mandatory…

yes

you did not click.
i do not believe you.

maybe brian has a trojan

oh no i'm all out of those.
oh..

Too bad your pastebin doesn't show counters

you're talking about the computer….uhhh…nevermind.

What is 'dealer_states'?

cities and states.

Why break it into a table?
It's not exactly going to change much
Put that into _cities

Why?

Performance
No need to normalize it

I thought about that

still dont get how the reference can help me (i already read it 5 times)

And…?
Your query doesn't match the syntax

Yeah…I don't need the state table.
But I can't call that table cities now.
I have to call it something that says "I store cities and states"

yes that also, but i dont know the value opf the unique key before inserting it, i must do a select first?

dealer_locations

Yeah…That's what I was thinking.
Stop thinking what I'm thinking.

You don't need to know the name of the key… you just need to tell it what to do

It's creeping me out.

You are weird.

we are talking about mysql and not english, can you translate it please

You might also want to add some indexes

but won't the database get big

Let's talk in English first. Explain EXACTLY step by step what you want to happen.

when I have "Florida" repeated 100 times for every city

Hopefully
!calc 4×4
!calc 4*4

and "New York" repeated 100 times for every city

Stupid bot

Horrible human

SO?

And all other 50 states
I guess it dosen't matter

There are state abbr.

Those are going to be static anyways

Are you running this database on a 386?

b,c,d) information, which together they are unique, plus a unique key(column a), i want to use the 3 information
for updating or insert a value

Use the enter key when you're done typing…

I don't really understand indexes.

!m brian how mysql uses indexes

brian see http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html

Like…how do I know if I need an index and why?

!tell brian about book

http://www.kitebird.com/mysql-book

Comments

I need to restrict PHP scripts from executing commands through system exec and the likes Im reading the manual

bar to access the variable

Class

Comments

I want to resize images no matter which format the images are I did a php script that does it for jpegs using

__construct() in php 4?
(I don't know the parent class name)

just preg_match('/a(?=[^]*)/',$stripped) would probably do. I'm sure there must be more efficient ways to do what you're after in any case, but I'm afraid I'm not sure what it is or what they would be

do a clean for($i, …) { if(s[$i] == '?') repace_it }
uups - replace

michlemken
i have to go
thanks anyway

since when has example.com/foo/bar/ redirected to example.com/foo/bar.php and how do I turn it off

since your apache had multivies turned on, probably
MultiViews

ah… that just a module I can turn off, eh?
that's

it may be something else doing it, but that's likely
Options -MultiViews

Could someone hae a look at my script. Its rather small, but I still can't trackdown the problem. I don't get any error messages, just a white screen. http://www.pastebin.ca/661772

awesome, thanks tndH
tat worked
wow, I can spell. that*

Could someone hae a look at my script. Its rather small, but I still can't trackdown the problem. I don't get any error messages, just a white screen. http://www.pastebin.ca/661772

this is bullshit: "while (isset($num)) { $del = 1; } else { $del = 0; }"

lol

Lol.
I cna't see another way?
*can't

while($elem = $dom-getElementsByTagname('quote')-item($num)) { …

can php convert tiff images to jpg?

and since what time PHP is javascript ?

I don't know javascript at all?
You were write about the while (isset) at the top, removed it and all is fine, recommend anything to replace it..?

I personally just use Imagemajick and shell_exec
oops, Imagemagick

can that be used on a php website, so that the people could upload a pic in tiff format (2mb) and have it saved in jpeg format and about 100k?

yeah, I've done something similar

is there much info on how to set up that type of thing and is there much work involved/

using 'shell_exec' can be a security risk though, gotta be careful

in what way?

wanderingii, if you're hosting on a linux platform, and imagemagick is installed, it is probably much easier than using the PHP functions

what if its a windows platform?

someone can inject a command that can do damage

just use the gd functions, unless you're comfortable installing image magick onto windows

whats gd functions?

replace it !

i also need something that can automatically insert a watermark text on the pics as well, can imagemajik do that?

pretty suck
err sure :p

http://us.php.net/image

I want to resize images, no matter which format the images are. I did a php script that does it for jpegs using gd. Should I handle differently every image format, or is there a php function to just resize it, no matter which format the image is?

imagemagick can add textual watermarks, but I would bet that you will find more sample code for PHP adding watermarks that you can learn from rather than image magick

using a progam doing the job is usally not a bad idea - thus use exec/system/popen/proc_open/…

ive found this http://koivi.com/php-gd-image-watermark/ and it seems to be something like what i want

Evening. Looing for general advice on templating solutions.

puff php is a templating solution
problem solved

what are you looking for
it's true you can use PHP to do it
I can show you ane xample if you like
and it works well
but there are more sophisticated, and contentious, solutions, such as Smarty

uh oh, hey puff… see all those worms running around outside that can?
wow, are my comments really *that* lame?

is it just me or is ampersand on par with the evil quotes, its causing me great headaches

I have an app, it has a common layout and menu structure the recurrs on every page.
Right now I have a header.php file that defines a header() and footer() function that prints out this common HTML. However, as usual, this kinda sucks.

check theses out
https://sourceforge.net/projects/utils-php/
there's a templating system there you can use

I'd rather have a file containing the whole skeleton page and a _PUT_CONTENT_HERE_ string or something.

I can explain how to get a layout-template system going

tag echo getMenu();/tagtag echo getContent(); ?/tag

something like that could work

tag{getContent()}/tagtag{getMenu()}/tag
that's about the only difference between templating systems

just use zend framework and use Xend_Layout

That doesn't solve any problems.

i didn't know I was solving problems? i thought I was just giving advice

Fine, then: Your advice doesn't solve any problems.
Your advised approach doesn't solve any problems.

ok o
what's the problem specifically
so we can stop giving advice

:-)

and start giving solutions

Well, the problem is that a) I don't want to have to update the boilerplate HTML in 20 different files and b) having the boilerplate split into different methods, etc, makes it a pain in the ass to keep things like table structures coordinated.
Sorry, maybe I should have included a :-) in my comments to hardcorelamer.

my general solution to this problem is two have 1 "layout" file with the HTML skeleton, and headers/navs etc
and then however many "content" templates which are placed inside the layout

hi, how you guys validate a textarea?

I guess I'm looking for something along the lines of sitemesh.
How do you combine the content file and the layout file?

in a nutshell the layout file is just another template, so I compile the content template and then pass it as a parameter to the compiler alongside the layout

two step view pattern
google it

Ah… okay, so does that mean you have to do all of your content creation as string concatenation, or is there some wasy way to take over STDOUT and cache all of the content output?

no, I have an ordinary php file with something like

Good ol' fowler.

php echo $paragraph; ?

puff, easy to take over ouput with output buffer controls.

Come again?

the above is what my template would look like

in php, a 'template' is another name for a 'php page'
hehe

only if you think of PHP as being a scripted language meant to be interspersed with HTML first
uonly if you think of PHP as being a scripted language meant to be interspersed with HTML first/u
….
why's that?
I find sharing a template between pages very useful

So here's the part that's confusing me. It's very easy and obvious to see how a given page can import some other chunk of HTML or php.
But it's not obvious to me how file A inserts its output into the middle of file B.

ok so imagine the above is the content page
here's a template

/html

so first I compile the content template to get the tag
which I store in a variable

And yeah, two step view pattern is what sitemesh does.

and set for use in the second template
if you want an actual code example I can share one with you

framework? or your own?

Okay, so what does "compile the content template to get the tag" mean?

the project I linked before is what I use

Aside from concatenating strings and returning a big string variable?

it means that I replace the $paragraph variable with its value

see i do similar, but i 'compile the content template' with a $site = $Controller-LoadBlah($id); or something.

And how do you do that?

then php echo $site-content; ?

ya, I just don't like using functions to do it

Right, that's string concatenation.

presumably that's your method body
it's not though
I don't see the concatenation symbol

Sigh.

it's HTML and PHP interspersed

Okay, in the rest of the programming world that's string concatenation :-) .

perhaps there's concateation underneath

no puff
in php, at some layer, you HAVE to have htmll & php interspersed
even if you have another layer building the content.

OK puff, listen, I'm sure you're a smart guy
but let's not take an attitude

which is why, in a way, it's just adding extra processing.

when you can't grasp a template wrapped in a template
I'm trying to be helpful, and offer one way to re-use some view-content
you can make functions like EoN suggested
or you can wrap templates in templates
using the decorator pattern, basically

I'm not trying to take an attitude, but I have this frustrating feeling that we're using words differently.

alright, well that's certainly possible

the thing is, at the end of the day, technically, there HAS to be "PHP interspersed with HTML".

I will try to give you ane xample, one second

even if you have another CONTENT layer on top.

man you guys are all retarded
just use zend framework

but architecturally, you can seperate them, which is what ManUnderground is talking about.

hi do you know any class to make an rss?

everyone who is serious is using zend framework now

zfdaily garbage.

At the lowest level, you have bytes and you have system streams.

including Varian

zend framework is good, but that comment's garbage.
lol

they just releasing a kick ass open source ecommerce made with zend framework
it'll blow every existing open source ecommerce out of the water

http://pastey.net/72353

Blah, this is frustrating, I have people distracting me IRL who don't appear to understand "I'm busy, talk to you in a minute.

that's how I'd do it

and thank god its about time!
current open source php sucks
99% of them

I can show you the code behind the template engine, and sample templates if you like

Ah, cool. That does look like what I"m looking for. Hm.

then with ANOTHER php, open that page, and replace vars with php values… but its adding extra processing, for no real gain.

all made by recent city college graduates with one course of Java class

Though it looks like I'd have to do some major surgery to convert the content files to templates.

ok ok wanh wanh
what are you going on about?
dunno

php isn't java.

im saying zend framework is your saviour

php pretending to be java = fail.

what exactly is the zend framework anyways?

also many people say zend framework isn't a framework.

yea its not, thats why its awesome

what exactly is the zend framework anyways?
I dont know what a framework even is =\

a framework.

EoN, it's a good thing, err, enterprise wise, not for your_blog

ty EoN

google it you cock farmer.

its just a collection of awesome classes libraries and helps you code in a real respected oop design pattern

cock farmer?
I dont farm roosters!
its CHICKENS

its a series of OO libraries/classes etc.

mvc is your friend

Though if you're doing java, Cafuego (IRRC that's the name) is pretty cool. Java application server with full, in-java, bug-compatible php support.

oh, sort of like pear?

model view controller ftw
pear is nothing compared to zf

i like mvc… nice word for 'half assed' three tier

but
its the same idea?

MVC is good, but most people don't understand what it means and don't implement it properly, at least in the java world.

nah
zf makes you code in MVC principles
its got a framework built to achieve that out of the box

man what's so great about MVC

the thing i like about mvc, is NORMAL procedural web pages are pretty much MVC pattern anyway.

I'm all for separation of concerns

A framework is the inverse of a component.

by its loose definition

it separates code with controllers and designs

but I don't think MVC is the right pattern for the web

i think MVC is a buzzword.

once you use it you'll see why MVC is so powerful

start looking at THREE TIER architecture, then you're dealing with POWER.

I haven't seen a Controller which is a good OO class

MVC is a toy compared to that.

A component is a black box that you can insert into your code at some point to fulfill a specific fucntion, wtih clearly defined inputs and outputs.

I have used MVC

Controller is just a controller to handle inputs/outputs
doesnt have to be an oo class

A framework is a skeletal implementation of a general problem case, which you can customize and extend to suite your specific problem case.

ie php

MVC is from small talk
MVC is for GUI applications

check this out. MVC. C = php. V = HTML. M = database.
lmao

which need to handle many events

is that not true?

three tier architecture? mvc is built on top of that.

nah, MVC is for everything

that's wrong

in the traditional web page
there are only two ways in
GET and POST

EoN, you sure?

puff, thanks for trying to explain to me, but that wasnt very helpful

we don't need elaborate event handling

I'm installing some web-based CRM software, and it wants "IMAP" it says, it uses php

it helps you reduce code redundancy

what ubuntu package does it likely want?

data layer… data can't talk to view… view can't talk to data layer… can only go through application.

its very thorough

you can have 5 pages with same objects used over and over, using a controller with a constructor really benefits everything you do

man you reduce some redundancy
and introduce a huge amount of boiller plate code

What part didn't make sense?

you can do that with a single domain object

no it reduces code

the whole part

i already coded in MVC long before ZF came out. but this really gives you total power and flexibility like no others.

no, consolidating your business logic into a discrete set of classes and reusing those classes reduces code

MVC is a valid concept, though even the smalltalk crowd where it originated left it behind long ago in favor of something called morphic.

that is totally independent from MVC however

However, people come up wtih very heavyweight, overblown uses of MVC.

try using ZF for a project, then we will talk

anyway

mvc itself can not be overblown
it reduces everything you do
into plug and play mix and match pieces

how're things standing in your search for a templating solution?

you will be able to mix and match almost anything in MVC

EoN, three tier architecture isn't a design pattern… MVC is a design pattern using three tiered architecture…

hello gusy i have a question? i have a form that users submit things on, is it possible to have that form submit a hidden vaule( the user's user_name) in a part of the db ?

on the application level

where am i - microsoft visual c ?

or to copy their user)name from one part of the db or something of that nature

basically mvc fits all in that application layer you described

if you don't use zend framework, you are losing alot of power of what PHP5 has to offer

personally, I don't enjoy frameworks

its not a framework like cake/symfony

but I'm sure that the zend framework is a decent one

ManUnderground, of course not, frameworks forces you to use someone else's architecture, and there's a learning curve to learn that architecture

its just some very neatly written classes of libraries using MVC
you just pick and choose which to use

A more accurate statement would have been "overblown implementations"

I have lots of criticizm of ZF

of course, but as zf is saying it can result in found time

A framework is offering methods - no solutions !

And most of them, in the java world at least, which is where the frameowrk craze came from, don't provide sufficient value to be worth the effort.

like, zend_mail , zend_db, zend_filter

do you really believe that?
try using ruby on rails
there are full stack frameworks, such as RoR
and they do it all for you

which is bad

ManUnderground, that's with most frameworks, you just have to get over the learning curve and the comfortability of not using your own architecture

and you *have* to do it their way
then there are glue frameworks

in otherwords you need to get over NIH syndrome :p

yeah, which is seriously bad

which is what ZF may be

I think your suggestions are very much like what I'm looking for, but are going to require too much work to adopt them right now.

indeed it is

if you'd like to see the code behind the template engine I'd be happy to show you, I can't say whether writing the templates would be hard or not

I wouldn't call Zend Framework a Framework, more of a bundle of components that are commonly found in frameworks.

pretty soon, most companies will hire zend framework developers, because of the power it can handle and the ease of use in big projects

so thn it sounds like a glue framework
which is pretty much just that

with exception of a two step layout solution… and a good form solution, but those will come

Sometime, yeah, but right now I'm trying to get this site ready for beta.

I have a fresh debian install, if I install php5-imap.. do I need to instal anything else for this web-based CRM to work properly? like would php5-imap need something else?

you should install mysql first

Generally speaking apt will install whatever else yo need.

at least in my experience

and I really dislike Zend_DB, but it's easy to use your own models, or another model solution like propel, etc…

I'm actually writing a persistance layer

Though there have been some cases, particularly with php, where dependencies are missing from the apt database.

http://code.google.com/p/junction/

keep it short, Zend Framework, is PHP utilizing MVC, with extremely flexible use of encapsulation to customize to your projects, and has most of the commonly used libraries out of the box

I should see how I can work it into Zend

I installed mysql/apache already

ManUnderground, should be pretty easy,

you should be good to go then

the php-based install says "IMAP Support Availability: Failed"
And it's listed as a core component

hm, I can't say whether IMAP is an extension or not, have you tried searching for this

yes

then maybe it's something specific to your CMS
you can try PHP Mailer
and write a test script to test the IMAP

zfdaily, to warn the other users, ZF needs to have a layout solution, which it's currently got a couple of one's in review and a couple third party of the same, but no official solution
nor does it have a form solution yet, several propsals though…
and Zend_DB leaves alot to be desired

it's really sad how difficult it is to find a complete DB solution
PDO requires extensions
adodb is old as heck
and I hate it

and Zend FW has alot of useless service classes for most people.

jsut create your own layout system, not too hard to do if you are a coder.

I've heard of Creole, but not good things

zfdaily, meh, ralph already did it.

then use ralph's then
i think thats the beauty of zf
you can use anything on it

that's I think the beauty of any glue framework

meh, I wana wait and see if ralph's solution or matt's solution get's accepted. (or both)

have anyone used rss creator?
feedcreator

Zend_Feed

just what other glue frameworks are there for PHP?
Zend_Feed is nice

I am actually not the person to ask, I don't use frameworks generally
Solar may be something like that

it kicks SimpleXml out of the water

I haven't really used it, I just looked at it
the problem with Simple XML
is you still need to parse the damn thing

you do know that, when you code anything from ground up, you have to do alot of tests and all that?

is there a class to do XML serialization which is comparable to ones in Java/C#

like DOM?

thats why i think zf is awesome because, for codes that alot of peoples already use, zf actually has them all tested and rock solid

of course
no way more sophisticated

even Zend_Mail itself, i think is a good example of how an Email class, can be made perfected and used with no cause of concern and problems

for instance, I can take a class and have it directly serialized into XML
or the other way around

zfdaily, i just wish Zend Framework had a little less Zend involved

what do you mean?

and I can use metadata to describe what fields get serialized and to what tags, etc

but I think the best class ever in Zend FW, is Zend_Search_Lucene… OMFG awesome

yeah, Lucene is sick

I don't know of anything like that for PHP, it's certainly not what DOM is used for

whoever wrote it big props to him

yeah
not as fast as Java's but it's indexes are interoperable between java and php
which is COOOOOOOOL
so you can index with java and build your search interface with php

yep

it's just a pain to have to parse the XML myself
and construct the classes from the parse results

i can't wait till Zend comes up with a Flash class

I guess that can be my next project

we are doing alot of actionscript/flash w/ php , i can't stand it
i wish zend can clear all that up for me

but zend I think has caused a bit more harm than good with the ZF, I think ZF 1.0 came way to early.

well i think thats why its better
it gives me more freedom to customize it

and there goes that crap about them adding a feature in RC status, and blocking out other things that really should be in 1.0 because it was in RC status
double zend standards

instead of looking like a full blown framework

can i submit a hidden value with a form guys ?

yes.

i love my Form model
i seriously think, it's beautiful
it's wicked

nah, with the view renderer zf really needed a native layout solution, or else it was going to alienate alot of users… and that very fact drove off many developers.

they are sumbitted along with everything else

i have a form that users fill out and submit some things but i need it too submit their user_name as well

does everything from wysiwyg to input validation to captcha to creating forms on the fly straight from database and etc..

and it to save in the db as well
here is what i have so far

it will be part of the post data just like everything else

in fact I think it ticked off one of the main developers so bad he's creating his own framework now :p

well I will say this
which is that the community needs a standard

yeah layout was the first thing i had to create when i worked on zf

http://paste2.org/p/6084

and so I'm totally behind the project if it can become the standard for our industry

zfdaily, everyone has, and everyone will until zend provides one.

thats a good thing

zfdaily, no it's not necessarily

it will fit into everyones project

now, if Zend could just turn some attention to the flagship PHP apps

not really,

such as phpMyAdmins

me likes php code - no html is done directly - all is written by php classes

some want 3 view, some want 2 view, etc

so we could get people moving to PHP 5…
and soon 6…

what does phpmyadmin have to do with moving to php5?

that may a bad example

yeah :

if phpmyadmin used zf, maybe everyone will follow suit

but if apps people rely on stay in 4
then people won't move to php 5

not any notable ones, most of them work fine on php5

we had a conversation a few days ago here

though most of them are on that 4/5 code that works on both, nothing wrong with that

about major apps being slow to switch
I actually don't agree there's nothign wrong with it
why even both develop PHP 6 in the face of PHP 5's adoption

so basily your sayign that i can jsut add the field into the db and code it in to save the user_name in the db table i made and it will work ?

To forever push toward the future

because php4 sucks

but it's a waste of effort on the developer's part
php 4 sucked, I agree

ManUnderground, I don't think php6 will offer enough architecture change that people willhave to migrate much code at all.
atleast that's the goal

my point is that people failed to adopt PHP 5 which is vastly superior

unless they depend on those old configuration values they are getting rid of.

similar could be said for Apache 2

it strikes me that we should ahve spent more time getting people to adopt PHP 5 than developing PHP 6
that's true, and I'd say the same for them

ManUnderground, I don't think the issue is with major open source apps, most of the issue are going to be private applications that are still in 4

peoples who need it adopt to it
simple as that

and I don't see how the community can drive private organizations to update anything.

what are you sayin?

there are active coders and old stale coders

Can't really argue, I sit on the fence anyway. I only recently went to PHP5, I was happy with PHP4 and still prefered it's simpler classes. I'm stuck in the past, heh.

unless we get friendly ads and spread FUD about php4 being obsolete

active coders always look for new things new technology adopt to like web 2.0 etc..

you can motivate companies
look at what Microsoft does with its platforms

ManUnderground, their different, they have licenses that they can pressure people to update.

Microsoft also has billions of dollars

they know what their customers are and what versions they are using… how can you possibly do that with php?

rather than not for profit, etc.

if microsoft had no money and no fame, no one would even touch microsoft's products nowadays
they come up with the buggiest programs
slowest too
for example, IE7

zfdaily, there's a few microsoft applications that RULE

IE7 , what kind of monkeys built that crap

sorry, last I heard was my point about Microsoft
power went out in the house

I still maintain that Visual Studio is the best IDE out there, and C# is tight, and umm…… Microsoft Project has no comparison.

why can't the almighty rich microsoft build an app better than Firefox?

I hate visual studios

it really strikes me sometimes of what types of apps they release

vim + shell ftw

at any rate, my point was just that Microsoft gets people to move with its platform

visual studio yucky the whole .net language is crap

as it evolves

even hotmail's anti-spam philtering is retarded

PHP has failed to do so as a community with PHP 5

zfdaily, you watched that speach about that one guy talking about the fall of MS too?
because your pretty much paraphrasing him.

no

and I think it's worth analyzing

mmhmm

i guess we just all know it
we see it
they brag about how badly their programs are written
we can't escape their demise
they even bought a linux company

eh, I don't think it's that simple

it shows they are incompetent

http://php.net/function.mysql-fetch-row - what's that mysql_data_object thing listed on the "See also"?

I don't think MS will fall, they just won't be as powerful as they used to be.

I personally think that the OS community will erode some of their business market

The way I see it, they're where they are because of market dominance, but that's life. I don't really see the big iTunes tied to iPod thing either, I think it's another load of market dominance getting it's way. But I don't really care either, hahah

apple made a real smart move by adopting linux/unix as their OS

but they have plenty of room to grow

Unix, BSD really.

yeah I don't think there is any LInux in OSX

OS X is a pretty front end for BSD, to quote what someone else told me once.

just lots of BSD

mac osx is pretty nice
i can see why they are so popular nowadays

they'd be more popular if it wasn't for the $$

Probably

especially to all the *nix kids, let alone the graphic designers

I'd have gone to OS X but it's locked to their hardware that I don't want.

InuZule, it's less locked these days

Well, there's some means about it sure..

they even have perhaps the most hard core programming editor in TextMate

But officially, it's still relatively locked to their hardware

you're locked to the motherboard processor i'm sure, but that's about it.

hm? And Mac compatible graphics cards

and even that, not really

They do something funky/weird that makes them non compatible with general ones

if it wasnt for gaming, i'd switch full to macosx

sorry about that, what was the Q?

meh only thing I want to see mac do with graphic cards is support nvidia's SLI

I hope you understand that's not the OS's fault, but the game companies' fault
http://php.net/function.mysql-fetch-row - what's that mysql_data_object thing listed on the "See also"?

I shall take a look :o

i sometimes wonder, what life would be now, if apple took over microsoft spot in the first place
probably a beter place

I sure wish my IRC client had a /grep

just what other glue frameworks are there for PHP?

code igniter, agavi, mojavi, prado
ez components
cakephp

lol

mIRC has a search feature… I'd want perl-compatible regex searching, though xD

have you ever tried to code in one of them?
its nothing like ZF

no, many of them are far more efficient in developing web applications.

InuZule, um open up a shell, cd to your logs directory, grep away

me too XD and honestly, I'm not sure about that mysql_data_object unless it's planned for future versions

they're frameworks in the real sense of the word.
symfony

not on Linux, and I don't keep logs, hah

a framework doesn't have to limit you to a sandbox
thats why zf is much better

double failure

all of those frameworks are FAR more powerful and better in all respects than ZF.

its only more powerful if you cant code your own shit

you can get grep for Windows; and actually you better do

like admin

it's so my girlfriend can't read the cyer logs later

Is a Forloop a good method to do pagination?

zend framework is more for peoples who prefer do-it-yourself

dont forget, zend framework adds a lot of layers of extra processing.

like creating a project from ground up with no msg included

Zend Framework is more for enterprise :/

compared to what, symfony/cake?

fact: procedural php is more efficient & better performance than Zend Framework.

OOP FTW

zf actually outperforms them

erm

(and more efficient than any other framework)

yeah procedural is more efficient

look up php framework benchmark in google
procedural not good for big projects

of course not
I use OOP for small projects…

oop is for everything

\o/

just the same way zf is for everything

oop ftw

but cake/symfony, is not for everybody
its like a new language
you are confined to what the framework let you do
they control you

a few months ago some spammer filled all 200+ pages on a wiki with a lot of links

ah I hate those spam bots.

captcha ftw

They've given the world ugly capctchas that I seem to mistype about five times.
haha
I hate them

its the only way to defeat spammers
its sad but we have to deal with it

in an hour or two I did a PHP script to remove the spam… and I used OOP :P

i haven't mistyped a captcha yet

I blame my aging eyesight

cake's for RADing, even so, I don't find it too restrictive
I haven't used ZF yet, it's on my list

http://www.radiocool.110mb.com/wp-content/uploads/2007/07/quantam.png - a simple captcha

Being able to use cake to whip up an application in 10 minutes is pretty good for making money

lol
very simple

yea

heh, should be 70
x=2pi means cos will go to 1, and sin(x+pi/2) will also go to 1
so it's just 7*6 + 4*7
fuck I'm a nerd

lol

i dont even know my sohcahtoa

there is a mistake in the book "php in a nutshell"

I'm writing an NNTP server in PHP, and loaded the RFC on my PDA to read in bed… is that nerd?

Lucene does indeed rock, and Doug Cutting is the genius behind it. Not sure who did the zend port.

haha, yes that qualifies too

I wasted a whole day trying to figure out what I was doing wrong in response to the 'HEAD' command… and it turns out it was a Thunderbird bug, not parsing it correctly

InuZule do i just need to make the code in the query (since i have the fields ready in the db table) for it to insert the username without having it as an actual part they fill out on the form

http://www.magentocommerce.com/
that shit is going to rock
its built from ZF ground up too
its gonna be extremely flexible and customizable!

um.. use an invisible form field, and insert the variable for them?

So, two of the problems I'm trying to solve right now; one is that the latest round of changes added somethign that threw the table layout formatting off (and yes, I really realyl want to get rid of the table layout formatting, which I inherited from the idiot who did the original site, but I
don't have time for that yet).

And the other is that one particular page seems to be really slow in loading.

what mistake?

ugh

no spelling or grammar mistake, but something much bigger O.O
the nook says that if apache gives out to much information about that server, it is a security problem
when this isn't true

Though some crude timestamping via time() shows it all happening in the same second, so I'm pretty sure it's not mysql holding things up.

there's an idiot kid who I'm giving some hosting to, he keeps uploading thumbs.db files and _vti_cnf folders (those dirs are from Frontpage)
ugh @ frontpage

is it free hosting?
and what's you hosting website's domain?

…it's my home PC

oh

not like it matters for the crap that dude is hosting

what cp do you use?

The page contains a lot of IMG tags that src from external websites, but the images all have height/width tags, so I don't *think* that's the holdup…

cp?

control panel

there's none; it's just hand-configured FTP

ah

I'm not giving free hosting to the world…
:P

What about paid hosting? Say.. you give me $10/m to host my stuff?

EoN

Free hosting omg where?

imageswire.com _

on my home PC
unlimited bandwidth per month, but 256kbps

Very generous

you get what you pay for

anyone ever heard someone use the word "sub-path" instead of "sub-directory" ?

yes

is it like a *nix thing?

nah just another stupid way to say it

they don't use the word "directory"?
hmk

Most people I know still say sub directory, even on *nix systems.

do the google test

maybe they dumb it down as I generally use Windows :P

What distro are you running?

4,430,000 for subdirectory, 266,000 for subpath

BOH!
ez bassfaces

Windows XP Professional, why?
:P

winxp ftw

sub-path might actually be a valid term, but it's fairly odd, even in the unix world.
sub-path might actually be a valid term, but it's fairly odd, even in the unix world.

Comments

I am replacing certain tokens in the template So the steps I am currently taking are 1 Read in the template

I found a tutorial online that explains a login script. Due to my lack of php experiance im not able to determine if it is secure or not. Could someone take a look and let me know what you think? here is the link http://www.phpeasystep.com/workshopview.php?id=6

it has sql injection
so, no its not secure

ty
do you know of a tutorial explaining a secure login script?
or is there an easy way to fix that one?

there is
but you would come to rewriting it anyway

no, it is not secure at all
but you already knew that

i didn't look any further

so waht is sql injection?

it's just crap

heh, it even has short tags

sql injection is when the user input is derectly passed onto the database
so if a user does 1; DROP DATABASE `something`

don't use this one as an example!

you lost everything
mysql 5 avoids that by not allowing multiple query's tho :P

yes, they crippled the API to accomidate for idiots …

so where is the sql injection part?
sweet they accomidate me

using un-escaped user originated data in an sql statement

josh, = mysql injection

$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and …

s/=/equals/
f00li5h, good early morning

see the way you have $myusername, and the user can put anything in there, including a '
1 EST
CrazyTux[m]: not so early here

s/5a,/5am/

CrazyTux[m]: you've got to read your messages twice before pressing enter from now on, k?

f00li5h, agreed.

so could you just excape the data to fix it?

josh, mysql_real_escape_string()

does anyone knows why my date is not storing well? http://pastebin.ca/659621
thanks

logik-bomb i know you ?
lol

MalMen claro
hehe

I guess im in over my head, I'll go back to google and see what I can find
uI guess im in over my head, I'll go back to google and see what I can find/u

josh, I solved your problem, look at my response.

the mysql_real_escape_string()

josh, correct.

so if I am able to implement that it would make the script secure?

josh, just run that accross any vars you pass to sql
josh, it'll escape user input.
josh, never trust user input.

thus preventing sql injections

josh, si

ty muchly

is it possible to extend a string with extra character? like $blah = $this + 'h';

robboplus, .

use a point $bar = $foo . 'BAR';

robboplus, $blah = $this . 'h'

oh wow

you are running out of service threads/proccesses - whats that mean ?

robboplus, concatenation.

many thanks!

robboplus, anytime.
robboplus, you can also use ,

not sure why just . but if it works.. i'm happy
so that's concatenation… learning mode on
or , - exactly same result?

stupid tutorial writers… "those who can't, teach"

robboplus, correct.
robboplus, , is faster than .

mhm

robboplus, a little birdy told me so

lol

but then again I'm kind of drunk and just broke up with my girlfriend 5 minutes ago

Can anyone tell me if there are any problems installing PHP on a server that already has ruby on rails installed on it?
uCan anyone tell me if there are any problems installing php host on a server that already has ruby on rails installed on it?/u

oh

CrazyTux[m] just have your beer.. they are all the same

robboplus,

gfs that is

well
im never going in efnet's #php anymore

DARKGirl, did they attack you?

they called me fat just because I wouldnt show those pervs my pics

lol

and then when I asked an op to tell him to stop harassing me, the op started to harass me

forget

)

It's EFmet. What did you expect?

efnet is a place with a lot of nerds

*EFnet

yeah efnet has no admin moderation
it sad

DARKGirl lmao

the problem is…efnet have admin moderation

so then you turn to ircop and it happens again lol… welcome to efnet

thank the gods freenode isnt like that

http://phpfi.com/256582 - here my script (password is fake obiouse), users make downloads using that script, but after very users is connected server became recuse connection… i dont know why…. the global server load is not mutch +/- 0,2… and server
became to recuse connections like DDoS

srand let me guess, they dont care

yes DARKGirl
and efnet have a lot of racists

MalMen, perhaps a loop?

forget about and stay in freenode

CrazyTux[m] i do not understund your awnser

well

MalMen, what do you mean "like ddos"
s/ddos/dos/

the only reason I go there is because people tend to asnwer my questions more than in here
in here i tend to get ignored

i want say DDoS
server recuse connection

MalMen, I'm not understanding your question, you want to create a DDoS or what?

no
after +/- 20 users starting to download
with that script http://phpfi.com/256582

night, folks.

MalMen, It starts lagging your server?

the server host became to recuse con nections
but server not lag

MalMen, refuse?

yes
refuse

MalMen, perhaps a rate limiter firewall?

i think not

MalMen, Start from the LCD and debug, you'll find the problem
s/LCD/Lowest Common Denominator/

if i replace fopen, fread, ect… with readfile
that not happen
i am debuging at 5 days
and i think that strange
that works perfect with readfile
and not with fopn, freac ect,..

what can I sell

but i need use fread
to can limit bandwith

how can i prevent my server from DDos attacks?
actually
heh
I think my router will kill such connections

You don't understand what DDoS is, do you?

someone going to buffer overrun you?

Distributed Denial of Service

i do, that was a joke

It means every time you go anywhere in life they refuse you service ebcause you are a minority. Last time I got DDoS'd, I couldn't even get McDonalds I ALMOST STARVED TO DEATH

lol

DOWN WITH ICMP OPRESSION
DOWN WITH THE MAN
seriously though, down with the man

I do not have to worry about DDoS attacks
I am a majority in the country where I live.

They can still try to mysql inject you

or run foreign javascript in your.. front end.

Oh god

tssk tssk kids these days

They will force cookies upon thee

But I love cookies!

And they will bruteforce your backend access.

but i have a dynamic ipaddress

;_;

how do i get a page where the user browses for a file and then uploads an image to a directory and get it resized?

In my day, we kept the cookies in a jar, high on the fridge. These days, cookies are everywhere.

I can always request another ip

Well, php upload

oh yeah, that will surely help.
bhahahaha

and then use imagemagick or gdlib to resize
as it is uploaded

that doesn't really help…

lol, it was an idea

"how do i drive car"
meaningless question

Well, first you have to hotwire it

see? the very first step is already a hack

how is it a meaningless question?

Google for "PHP image Upload Resize Script"

because it really is like asking a person on IRC to teach you to drive

and then edit your heart out and learn how to do it your self (my actual preferred method of learning)

step one: learn php

ok, has anyone here ever had a problem with is_int()?

its nothing to do with driving you dummy. Its php and images.

I can only learn from example, hands-on example, and learn best from trying to figure out somebody else's code, or atleast reading tutorials

insults get you nowhere, especially qwhen you're asking for help.

It is an analogy/methaphor
metaphor*

im running a basic test like if(!is_int(4)) { return "4 is not an integer"; }

METH a phor youuu, ;P

and over and over and over again it says, 4 is not an integer.

I think you are missing the point.

any number, for that matter

meth, indeed.

Why are you um…
I never sued no !is_int
used*
and… return?
You do not want echo, or print? :o

yeah, its inside a function
sorry

Wasn't there a US senator recently who offered an undercover is_itn $20 to perform.. um never mind

I was wondering for a sec if you were kidding

i do eventually echo it out…

Well umm
Do you have any other returns, inside the function?

yeah
its driving me crazy

By the way
Can you use um… !is_numeric() in the place?

hrm?
what's the question?

thats not exactly the same

hi, this is a newbie doubt. i'm trying to connect to mysql using php(mysql_connect) and the connection is not established. my server is running, username password are correct. what may be the other reasons?

why not ask mysql_error()?

Port?

mysql_error() doesn't give any output. after mysql_connect(), nothing gets echoed
MikeSeth, do i have to specify the port as well?

Is your ports open? I dunno, umm… if you are not getting any errors, then maybe you are conencted and do not know? ;D

so there's no error and the problem is somewhere else.
Not if MySQL is running on the default port

If you use any port ebsides the default port for mysql
Otherwise, no
MikeSeth YOU THIEF OF WORDS :O

why would is_int(1) or is_int(3) or is_int(4) return false??? in fact, it returns false on all integers i have tested…

if (FALSE != is_int(4)) {

I are teh pwn

Kcaj, what may be the other reasons? socket? mysql.sock?

@mike check error_reporting

is it really an int, or is it a string?

I dunno nuthin bout no sawcks

i'd expect false for is_int('1'), for example

Oh yeah

me check error reporting? Why would I do that? I'm busy integrating Doctrine into my Agavi app

You are using a numeric string maybe?

how do i force it to be a numeric string?
im reading the num from a file…

Trying $1 = 1; (not $1 = '1'; or $1 = "1") and then check $1

so that may be the issue.

without '' or ""

type coercion: $foo = (int) $foo;

No, you do NOT want it to be a string

you are propagating C++ism again

i mean, how do i force it to be a numeral sorry…
so $pr = (int) $pr;

that's impossible
i don't know c++ ;-)

if (FALSE != is_int(4)) { = C++ism

If it was the socket or port, you'd probably get an error

what happens if i try to run $pr = (int) $pr; and it is not an integer…

Kcaj, ok. will check and tell you.

just an alternative tu !is_int() ;-)

I've got some propagana for yoyu

did C have false?

FALSE == of course

yes, but it should be (is_int(4) !== false), not the other way around

XOR XNORRRRR 00 = 0, 11 = 0, 01 = 1, 10 = 1

I stopped caring about C the moment I've seen people #define null 0

Now that my friends, is some GREAT MATH

to much js the last days - that's confusing me ;-

does it matter if is_int(4) returns something true that isn't 1?

heh.
no, but we're being anal-retentive

Yesterday I was anal-let-go-iv and couldn't even go to work cuz poopies ;_;

if( false !== is_int( (int) 4 ) ){

lol

oh noes u got raepd lols
damn. Speaking like this makes me cringe.
bb smokez

HAHAHAHA
3

333

fooli5h - C has the concept of false logically (eg: if(expr) ) but no definition. People would often #define false (1==0).

I've been having to learn ASM lately
and how to do AND OR NOT XOR XNOR etc. and omg

MikeSeth, there are actually advantages of using if (false == $a), as it will automatically trigger an error in case you miss a "=".

that is some headache right there
I have to make a board that lights up 3 seven sequence LEDs

if that's as bad as a false is in perl, it's trouble

based on a counter and an alarm

how i can use substr($line,2,"infinite")? to show my var in position two for front..

f0tab

freebox, don't specify and third argument

just omit the last argument

cool

an*

read the manual

a* *grr*

thats fun, not headache

What processor?

Lemme check
I only know what the old one is I think, the new one changed

how can I convert index.php?v=5070 to index/v/5070 ?

some kind of motorolla chip
the clock is external
(quartz crystal)

with mod_rewrite

[fyrestrtr] thank you

but for me, I barely know any ASM and thse little gate things get really confusing
cuz a circle anywhere of three places can invert the outcome or part of it
and man… XD
The one logic diagram is for MC14511B

Kcaj, here is my script http://pastebin.com/d41449f83

kk lemme see

Kcaj, just Check 1 is echoed

that's the exact reason it's used in C++ and shouldn't be used in PHP. PHP code has more semantic load per line and must be more readable.

put another echo at the end
Oh just check 1

ok I am back

Kcaj, yes. just check 1 is echoed

mysql_connect("127.0.0.1","root","") or die(mysql_error());

its stormy here so I might lose power

You are conencting as root with no password?

Kcaj, yes.

Is there a possibility of enabling dbase functions without recompiling php?

Try changing 127. to localhost

Kcaj, root doesn't have a password

(I know it is the same, I

ok. will try now

've just always used localhost)
then, also
Lemme see how all my queries look

how hard is it to add a user to mysql,
you should just add a freaking user with only data manipulation privs

function connectdb(){

$link = mysql_connect('localhost', 'root', 'password')or die('Could not connect: ' . mysql_error());
mysql_select_db('xpondr') or die('Could not select database');

}

*and* not get mad at its GRANT syntax?
!+pastebin

Submit your text to http://hashphp.org/pastebin or http://cpp.sourceforge.net or http://pastebin.ca then tell us the URL and a summary of the problem. Don't flood by pasting in the
channel.

use a pastebin

you only have to do it once

sorry my paste
but yeah
I thought it was gonna be 4

and the first time always hurts

whats wrong with grant syntax?

Kcaj, :-) whats the problem then?

I caynt couwnt vurr gud
my queries all work good lol

fugly?

sometimes you bleed a bit

and sometimes you get a little bit pregnant.

after that, you include it in a script in your repo

Kcaj, i guess some initial settings problem. i'll check it and ping back to you. thanks Kcaj. bye :-)

why using the grant syntax - use a tool :-)

kk

I do use a tool

mysql lousy-grant-user-syntax.sql

Somebody called ME a tool one time

it's called "the code monkey guy"

one that makes you get a bit pregnant?

I use phpMyAdmin cuz I'm LAME like that

damn is it improv night in ##php

whoah. Almost BitchX.

no one would help me install phpmyadmin so I use navicat

they did you a favor

It is improv DAY
This is now daylight, right?

navicat is crap. keeps crashing whenever you do anything other than staring at it

eh?
navicat doesnt crash here

I don't know where you guys are coding, maybe on leaves somewhere in the dark ages, but over in AMurrica on the East coast, it is… light light light

what is wrong with the tools that mysql makes?
1556 here

they are not available for mac
at least

liar

wait

not the one that allows you to edit/create databases

to install phpMyAdmin don't all you do is copy the files to adirectory and then go to a URL and its done?
lol

hi all

o/

anyone know how I can remove a specific line in a file?
line number

I could install phpMyAdmin from an MS DOS command prompt

by hitting the delete key

with php.

Do you know the specific line number?

yes.

I've got an idea, I dunno if there is an easier way but umm

cry

How i can show the next line in the file? my code is http://pastebin.com/m493659d6 in line 11
o_O

the php mysql web hosting administrator is not included in the mac package?

what for an idea?

it is not

you can ook at the file, and explode it by \r or the new line, and then instead of line number

http://dev.mysql.com/downloads/gui-tools/5.0.html

use line number you want -= 1 is the KEY
so remove the key from the array then write it back to the file
but I mean, that could be an ass-backwards way of doing it
I'm just guessing

"MySQL Administrator is available for Microsoft Windows, Linux and Mac OS X 10.3, 10.4, and is compatible with MySQL version 4.0 or later."

hm

I want workbench.

hm, doesnt look like an elegant solution. ^^

I cant do crap in the other ones

Let me think harder, hold on, my noggin is weary

what do you want to do?

is there no better way to do this in php?
or should I use a external tool?

Workbench is an ERD tool

i am new at this php stuff and decided to install on WinXP/Apache2.2.4. Apache works php web hosting doesn't. I used windows installer. The installed put two entries into the Apache Conf file. The PHPDir and a load of php5_module which
points to php5apache2_2.dll. I also added a type application/x-httpd-php .php. I tried hello.php. It doesn't work.

Anyone know if there is a backport of PHP5's SOAP to PHP4 ?

blacksheepp how did you try it

!+doesn't work

Look buddy, doesn't work is a strong statement. Does it sit on the couch all day? Does it want more money? Is it on IRC all the time? Please be specific! Examples of what doesn't work tend to help too. Finally, showing us the code is helpful (after you've explained your problem). /msg php-bot
pastebin for more information

ok
indro
I can PM you?

http://localhost/hello.php
thats how

yes, please.

blacksheepp, you mean ti serves the php file itself?
It throws a 500 error?
the word explodes?

erd?

should work if php is running and hello.php is where it should be

"Is it on IRC all the time?" — is this a freakin' joke?!

blacksheepp, did you restart Apache?

if i put pure html in the file it shows, but not antging in php tags
i retsrated apache yes

www.php.net/file

My bad

i read someehwre about adding another module which is a C source file

www.php.net/file

load the file into an array, unset the line, write the lines in the file

!+at

For Apache to be able to parse your .php files, you need to add this line to your config "AddHandler application/x-httpd-php .php". To make .phps files work too, you need to add "AddHandler application/x-httpd-php-source .phps" also. You must restart Apache after adding either or both of these
lines.

pm

I mean http://rafb.net/paste/

I added AddType application/x-httpd-php .php, is that not the same?

http://en.wikipedia.org/wiki/Entity-relationship_model

okay
please help

The most obvious thing to check is the apache error log…does it mention PHP in the server string? Are there any errors there?

I sent you the URL in PM

oh!

I open phpinfo() and it says that pear is php is NOT compiled with PEAR. HOw do I make php aware of pEAR?

TML, I will check. brb

well hell. wheres the one that works like navicat?

I've tried reinstalling the packages
is there a way WITHOUT recompiling?

lets you create databases, etc

You can make PHP aware of pear by explaing the delicious properties of fruits

i.e. is there a pear module or something?

generally, your distro has a php-pear package

www.go-pear.org
PEAR is not compiled

it says my hello.php file does not exist

It's just a bunch of scripts and a commmand-line tool for managing them

I rememebr a certain hello.jpg
is your hello.php related?

it also complains about a whole bunch of modules php_*.dll it cannot find.

you said the magic word.

Somebody must have told PHP that those were not the modules it was looking for.

Is PHP mentioned in the version string?

Or that PHP was looking in the wrong place.

its the hello.php from the install help files.

PHP has install help files? :o

TML, php is mentioned in teh Apache Monitor

I don't know what the "Apache Monitor" is…is that anything like the Anti-Monitor?

I'm glued to Windows, okay, but this is why I love Linux. Installing PHP is like… apt-get php, or up2date php

It says Apache/2.2.4 (Win32)/5.2.3

its like 10 characters of text at most

http://localhost/help.text — do you see PHP in the apache signature?

will check…

freebox vs php = php wins

TML, its an Apache Interface to the Apache Service running. On windows it sits in the tray.

oO

fyrestrtr, I dont have that page

yes, I know you don't. On the error page, you should see the Apache signature at the bottom.

furestrtr, nope

hello
i need a mailer pls

i can use fopen to show the next line?
im lost

Can I tell you wot is in my Apache Conf file, as I think this is where the error lies?
right at the bottom of my httpd.conf file i have….
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:/Program Files/PHP/"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
#AddHandler application/x-httpd-php .php
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

blacksheepp, there areren't any errors when you start Apache?

anyone here use mambo?

i tried
it sucked
i rather write my own CMS than use one out of a box

a friend of mine has a site invested in it, and im just trying to setup a new host for her on one of my extra boxes
i just love when tarballs dumb all the files right into the cwd, that was a really great surprise to have before my coffee

hi

yeah, that makes me want to stab people in the face
i have officially found the best image to use for a site control panel… a photo of the 'big red button of doom'
bi have officially found the best image to use for a site control panel… a photo of the 'big red button of doom'/b
i'm putting it on my wife's site, so she knows what happens if she touches anything.

jrlenz, can I see?

is it from the original Big Red Button website?

i don't know where it's from
i stole it from somewhere
but since only about 3 people have legit access to the page it's on, i'm not concerned

haha
nice one

the rest of the images on the site are all legitimate from sxc.hu :-p
but they didn't have a big red button

Can someone tell me how can I access an oracle DB with odbc?

does anybody know a tool to transform php sources into syntax highlighted html?

php.net/highlight_string
php.net/highlight_file

sure, but i don't wanna write a new app … is there a tool that does the job?

google geshi

write a new app ?

why my if else cycle is not working? http://pastebin.ca/659695 I cant figure it out

file_put_contents('highlight.html',highlight_string('file.php'))
no that hard

or rename the files to .phps :-)

nice idea
thx

If your server is configured to handle phps

fshl is nice tool for it, too

Olá…

i've been too lazy to do that

Hrmmm.. question. Am trying call a variable function from a variable class's parent class. *chuckles*. It doesn't find the functions of the dynamically loaded child. Any ideas?

Gostaria de uma ajuda!!!

i can use regexp to replace substr?

php.net/preg_replace

no
i want something like ^$line = "test"

Ashen_, how are you calling it ?

huh? makes no sense

ekneuss, the simplest– just adding the parenthesis to the var.
ekneuss, though I have tried the… uhmmm…

how does one check if a checkbox is checked? :-)

Like it = if (substr($line,0,2) == "#@") to if (^$line == "#@")

Ashen_, you're in a non-static context ?

using DOM

ugarit, its entry in $_POST/$_GET will be defined

can the name= be an array?

ugarit, sure

if(preg_match("/^#@/", $line))

ekneuss, ???

hm

Are there any alternative php engines not based on zend?

ugarit, do a var_dump($_POST); if you're using POST as a method
ries, no, sadly.
Ashen_, are trying to statically call that method, or are you in an object context ?

ever seen this? http://www.caucho.com/resin-3.1/doc/quercus.xtp
I wonder what/how it works then….

ries, it overrides evenrything, I guess, but PHP is currently too much linked to ZE to make it independant.

thanks ekneuss that's helpful

alright… thanks for your comments

ekneuss, a series of objects extending each other, with the top one being a dynamically loaded one, with a dynamic set of functions, and I'm trying to call one of those functions (at the moment from a method in the lower most object, but I've tried it externally too)

an object doesn't extend another

okay, classes.
thats whats confusing me

Ashen_, do the lower object has a reference to the top most object ?

I figure the object should have all the methods

which the equivlenat to perl's join() in php?

GUESS

only through the chain

join ?

ugarit, implode I guess

test
ok

ugarit, join is an alias of implode

interesting

hi there
how do i decode a login.php that starts with zend ?
that is coded right ?

it shouldn't need anymore than that, because the object is made up of that class, and all the ones before it.
to my mind.
and that whole heirachy should exist before the function is even called– surely?

so, you've an object of a parent class that tries to call a method of an object of a child class ?

$uqryday=$_POST[uqryday]; is a reference to an array, I think, how to I implode the values?

ugarit, quote your array indexes already, and look at php.net/implode

just a static method in the child class, not further child object if thats what you're asking, though Im calling the var dynamically

http://pastebin.ca/659708 ? Im trying to upload and image and it keeps telling me the image already exists but it doesnt.

what do you mean by quote your array indexes?

sorry, got cut off. hope sum1 rems me and my problem.
to continue…
i think I have narrowed down the problem

ugarit, http://www.colder.ch/news/06-17-2006/15/quick-guidelines-to-code-.html#g1

in the apache log file I get errors like "Unable to load dynamic library "C\Program Files\\PHP\\ext\\php_exif.dll" and a whole lot of others…

Ashen_, so you're using call_user_func ?

Anyone freelance here? If so what do you use to keep track of projects, to-do's, track time. etc..?

so where do i set this other than in my httpd.conf file sitting in the apache conf directory?

it seems to me that this object is being built… oh… dont worry

i don't know how you define freelance but i use Microsoft Outlook and my memory

well my memory sucks.. can't use that, hah

then maybe you're in the wrong profession :P

I was calling it from inside the object… and so the linking wasn't working… because everything was dynamic

was anyone able to look at my issue?

I thought I'd checked calling it externally
lols.

mikefoo, MS Project Manager if u in a non USA country that dont care about software licensing.

thanks for the help

np

so anyone know what other files store the value of PHP directory other than ../conf/httpd/.conf ?

hi everybody

anyone… ?

i am trying to declare a function inside a function, which should be syntacticly correct. but now php complains that i cannot redeclare my inner function, and that happens when i call the outer function the second time. any ideas?

faber4, logic..
function foo () { function bla () {} }
Every time you call foo, you try to create bla again

Can I put oci8 extension on my php.ini?

Functions don't care about scopes.. they won't be only in the function scope, but in global.. they're not methods

am I visible ?

no

sean`: ?

archivist, who are you talking to?

functions do have variable scope
anything created inside a function can only be accessed from that function unless you global it
and vice versa

sean`: mmmhhh… not what i would expect

blacksheepp ,probably in your php.ini

Mace[work], yeah, but functions will always be defined in the global scope.

sean`: declared variables in "foo", are they valid in "bla" ?

Functions _do_ care about scope

faber4, I know, you would not expect that

just not in the way he meant

Mace[work], read what I said..

(sean`) Functions don't care about scopes.. they won't be only in the function scope, but in global.. they're not methods

function foo () { function bla () {} } // the function bla will be accessable outside of the scope of the function foo

(sean`) Functions don't care about scopes.
(sean`) Functions don't care about scopes. WRONG

Mace[work], function definition doesn't care about the scope in which it's defined, no.

Mace[work], I am talking about the accessability of the functions
not what is insie of them
e.g. variables aren't available outside them

that's called scope though

I am talking about functions though, functions behaving IN scopes

bleh w/e carry on

tyvm

Hello guys! I hope you can help me please. I run php version 5.2.0 and I'm trying to build a private messaging system following the tutorial at phpfreaks. I am getting an error of "Unknown column 'u.id' in 'on clause'" .. which comes from functions.php which contains the sql code as at http://www.phpfreaks.com/tutorials/148/3.php
Any ideas whether this syntax only works on php4?

functions don't really care about scopes, variables do. That's probably what you meant.

depends which way you word it

without using cookies and sessions, can one preserve the values of form values once the user submits the form? In other words, I don't want the content of the form to be cleared but to have the values the user has input.

ekneuss, whats the difference about 'functions don't care about scopes' or 'functions on't really care about scopes' ?
If I were talking about scopes themself, I would've said function scopes

I'll answer that if he doesn't mind, one is definitive one isn't

Hey

Unable to load dynamic library 'C\Program Files\\PHP\\ext\\php_exif.dll' ???

How is everybody
Im having a bit of a problem wih a loop

http://pastebin.ca/659708 ? Im trying to upload and image and it keeps telling me the image already exists but it doesnt.

sean`, there is difference internally, so they do care _in a way_

and I was wondering if I could get some help

even though I have PHPIniDir "C:/Program Files/PHP" in httpd.conf

Is there a way to loop all the get array and insert into session array?

any ideas on my syntax qu please?

I have a date stored in a database in the format 2007-10-30 - is there a way I can take out the year, month, and day from that string and assign them to separate variables?

$_SESSION['test'] = $_GET['test']; $_SESSION['test2'] = $_GET['test2']; $_SESSION['test3'] = $_GET['test3'] etc.

wanderingii#
if (file_exists("uploadedimages/" . $_FILES["file"][$timest])){
Is it possible that
the function is for some reason checking just the directory?
and Identifying that it already exists?

Chrisv, var_dump ($_FILES['file'][$timest

any idea?

Chrisv, var_dump ($_FILES['file'][$timest'], $timest); and look at the output

foreach ($GET as $k=$v) { $_SESSION[$k] = $_GET[$k]; } - perhaps?
* foreach ($_GET

sean`lol I was answering a question

Ill check that, thx!

not asking

I downloaded oci8 from pecl, how can I compile this to have the oci8.so file?

here is my question anyway

it was working fine until i changes the ($_FILES['file']["tmp_name"]) bit to ($_FILES['file'][$timest']) i want the image to be given the name of the current timestamp

Chrisv, your answer is not something you would call an answer

lol

The README file tells me to ./configure … but doens't have the configure file

true
im a php newbie but I do what I can
http://pastebin.com/m3cbd20f7
the problem is explained at the top
ask if you need elaboration

I need to extract the date, month, and year from a date like 2010-03-30 and assign each one to a separate variable, eg. $month, $year, $day - is there a way I can do this?

maxo I think there is something like " . trim "
google it
I would tell but I dont remember

list($month, $year, $day) = explode("-", $string)
list($year, $month, $day), sorry, maxo

I'll try that, thanks :-)

I actually needed to know that too so thanks!

split and join are nicer function names, tho, but I think explode and implode are idiomatic

that line is just splitting up a string and adding a "-" right?
or is it an array
nevermind my question- I am an idiot
and I need to sleep
good night/morning

it's not an array
just a normal string

im currently uploading a file and its name is being set by $_FILES["file"]["name"], how can i edit this so it puts in the value of $timest instead?

Hello guys! I hope you can help me please. I run php version 5.2.0 and I'm trying to build a private messaging system following the tutorial at phpfreaks. I am getting an error of "Unknown column 'u.id' in 'on clause'" .. which comes from functions.php which contains the sql code as at http://www.phpfreaks.com/tutorials/148/3.php
Any ideas whether this syntax only works on php4?

help. I have a script that sends mail, when I put a ' in the subject its replaced automatically with a \ . I tried to $subject = stripslashes($subject); and then $subject = str_replace("''","'",$subject); but it doesn't work. After the ' in the subject it is cut off

Im trying to send an e-mail with a php script and i cant seem to do so i get no errors except for mail() returning false, is there a way to enable verbose debuging for that function or even finding out _why_i t wont send ?

Is there a PHP idiom that evaluates to $var when $var is set but '' when it isn't? I'm currently using (isset($var) ? $var : ''), but that's rather clumsy

Not that I'm aware of. I do the same thing, but turned it into a function

Im trying to send an e-mail with a php script and i cant seem to do so i get no errors except for mail() returning false, is there a way to enable verbose debuging for that function or even finding out _why_i t wont send ?

thanks

can I echo the week of a month?
week 1,2,3,4 etc

pik

use the date function, [http://php.net/date]

I know the date function

anyone?

hey.. why is strpos($key, "int") == 0; always 1 even though strpos($key, "int") is sometimes 0 and sometimes unset?

ah yes thanks

You should check strpos and ===false, read the docs

McFly, ok, thanks

is magicquotes_gpc enabled?

Im trying to send an e-mail with a php script and i cant seem to do so i get no errors except for mail() returning false, is there a way to enable verbose debuging for that function or even finding out _why_i t wont send ?

Cyph3r-g[_]y, not really PHP just offloads it to sendmail
it invokes the sendmail binary internally afaik

or talks to an smtp server if you're on windows

on Windows it uses the SMTP server defined in php.ini

there is no way to do the debuging because the php-cli mail() function runs perfectly but my web server wont send

do you block email from the user Apache runs as?

not that im aware of…
How can i check this ?

check /etc/mail/trusted-users

im currently uploading a file and its name is being set by $_FILES["file"]["name"], how can i edit this so it puts in the value of $timest instead?

umm whats $timest?
wait you just need to use move_uploaded_file

its sed to hold the current timestamp as i want to rename the file im uploadin to just be 1187274939.jpg

you usually use move_uploaded_file('/my/good/path.gif', $_FILES['file']['tmp_name'])
wanderingii, http://uk.php.net/manual/en/features.file-upload.php
see 38.2
but you want $uploadfile to by your timestamp rather than $_FILES['userfile']['name']

ah man your a genius
thanks

SYSERR(nobody): can not chdir(/var/spool/clientmqueue/): Permission denied" in my maillog im going to look into it
Amy idea how to enable a user to send mail ?

hmm.. i still seem to make some mistake. i want to echo an error if the variable-name begins with "int" (this seems to work) and the value is = 0 or not an integer at all. this is my code: if((strpos($key, "int") == 0 AND strpos($key, "int") != false) AND ($value = 0 OR
!is_int($value)))

but even though the variable's name is intBla and it contains "test" or "-50" it doesn't work

the AND strpos($key, "int") != false is useless

how about if (strpos($key,"int")===0) echo $error

[1]justus, just debut it
check where it fails
debug*

anyone can help me? http://pastebin.ca/659758

scragg, are the three = intended to be there? (sorry, i'm fairly new to php)

yeah, but there needs to be more

What cms do you recommend for a large newspaper? Wordpress, joomla?

im trying upload asf video or wav audio file

[1]justus: Did you read the strpos docs like I suggested? It clearly talks about ===

hello

pik

I'm using php on debian sarge that doesn't have oci8 support. Can I compile php with oci8 support and then copy the generated oci8.so file to another machine with the same php version?

McFly, yes i read it, but seems like i didn't read that. sorry to bother you
will read again ^^

good idea

if (strpos($key,"int")===0 || $value = 0 || !is_int($value)) echo $err;

i am having problems with the array command
i cannot seem to find the get command
and it crashes out whenther i try

Cyph3r-g[_]y, sorry not sure. We use postfix

$_FILES["file"]["type"] will give me image/gif image/jpeg… but how can i just get the extension of the image being uploaded the .gif, .jpg etc part?

wanderingii, use pathinfo
$path_parts = fileinfo($_FILES['file']['name']);

whats post fix?

mattie, its a mail server
we use it rather than sendmail

thanks

wanderingii, though pathinfo just gives you information about the bits of the file

ooooh lol im a noob

whats the error?

thanks again, it was the third = and i should've used is_numeric() instead of is_int()

is_numeric?
not really

is_numeric yes it exist

var_dump(is_numeric('1.2345e5'));

You'd be better off if you built it on the machine you need it deployed on, but as long as EVERYTHING ELSE is precisely the same, yes — it should run on a different machine.

i know that it exists - but i doubt it is the solution if he tried to check something with is_int()

I have string like "index.php?blabla=11&Itemid=2&foo=bar… I need remove '&Itemid=xxx'. howto do it?

ok, thx. I can't install on the other machine because I would have to update several packages and someone out there doesn't want me to do that

what's fastest way to split an array by half ?
array_slice($arr, sizeof($arr)/2) ?

Hi i am having the strangest problem with php at the momment it seems that every time php trys to gather the results from the table i have every second row with the same data as the 2nd one before it any ideas why i would get this strange loop?

cross table join?

result type of "both" ?

i get the correct output from mysql when i query it myself
but a diffrent result when php querys it

mysql_fetch_array without second param

mk at the momment i am running "mysql_fetch_assoc"

nm

nop still the same problem

kieran491 show your code

how do you "know" that it works in straight mysql? which tool are you using to verify?

http://pastebin.ca/659787

either there's somethign wrong with your query and the tool his hiding the duplicates, or there's somethign wrong with your result handling code

yes i am running it thought Mysql QUery Browser

you output the query in your php script and copy+paste it to mysql query browser?

i have
the output i get in the browser is correct

maybe it's just me, but I don't trust mysql query browser, can you paste it into mysql command line?

try GROUP BY t.`IDET` in your code and see what happens

i dont know command line commands for mysql

i don't see an alias or table "Event" in your query

tblet AS Event

ahh there
i see

just missing the AS

where abouts?

the AS is optional
i include it because i think it makes a query more readable

LEFT JOIN tblet Event ON t.`IDET` = Event.`IDET`
AlexC please keep up i was saying its not a mysql problem that was just a point to help us solve this problem

i'm trying to normalize a text file by removing certain characters, but my script isn't working… would someone mind taking a look at it?

post the script on a pastebin
and dont ask to ask

or php session_start(); $_SESSION['name'] = 0; ?

just do it

any specific reason you're doing it in PHP, and not with e.g. tr(1)?

it's pretty much just a simple fopen/fread/fwrite/fclose routine
http://nopaste.com/p/aiH8Rgjgl
tr(1)?

man tr
oh. You are on Windows, probably.
Poor Windows people.

cygwin

man tr, then

pacmanfan, that looks complicated

because i'm more comfortable with PHP than anything else. hehe.

pacmanfan, let me re-write it

you do realize this can be rewritten in a single line, right?

in PHP5, yep

pacmanfan, how can you write a file you only opened for reading?

…good point. when i wrote that line i'd intended to have a separate output file, and forgot to change that when my plans changed.

There isn't anything else other than PHP5. PHP4 is deceased. Someone threw the body out and we don't even bother to bury it.

also you need to fseek back to the start
since the fie pointer will be at the end of the file
and what MikeSeth said
PHP 4 is dead

how can i get innerHTML with dom?

innerHTML is not a standard construct in DOM1 and DOM2

so.. i can't ?

so would you recommend building the dom?
you can

i thought that with r+ the pointer would automatically go to the beginning of the file.

you can, in most browser DOMs.

file_put_contents('mycleanfile.txt', str_replace(' ', '', file_get_contents('myfile.txt')))
pacmanfan, but you just used fread

doh.

fread moves the file pointer

i'm talking about php's DOMDocument

ok, how do i fseek?

oh :P

rewind?

file_put_contents('mycleanfile.txt', str_replace(' ', '', file_get_contents('myfile.txt')))

DOMDocument is not about HTML, I think

thats a single line
use that

i know

pacmanfan, or use rewind

my webhost is still using 4.7.x

rewind / fseek

therefore I don't think it has innerHTML

but still, let's say i have blaasdfoo/asd/bla

4.7?

i can't get the foo ?

innerHTML is a IEism

nodeValue() shesek?

great, thanks!

i have PHP5 on my dev server, but i have to keep in mind that the webhost still uses 4.7…
errr, 4.47
4.4.7 that is. i'll get it right sometime :o

hello room anybody there.

nope,

i am trying to insert valuyes into the db through php appoication. it is giving error
bcoz i hve one column which contains this kind fo value "Bachelor's deagree"

hmm, on my example, blaasdfoo/asd/bla

now it is giving error becuase it contains '

oh
n/m

is there any sql or php function which converts the entire input text to sql string

mysql_real_escape_string() rocking777

hi

okie, will chekc it

heyaa all

what is there in text *.TXT when you have a line break?? because i need ro removethem to make a file be just one line of text

\n

thanks guys

rewind did the trick, thanks ScottMac

its working

pacmanfan, move hosts

referring to an object inside an object, & I have a string - "echo $pricebook_entry['0']-Product2-number_of_licences__c;" & was wondering - surely there must be a better way of referring to the nested object?

pacmanfan, unless they have a timeline to upgrade

hmm, how can i use getElementsByTagName and get the 1st match?
$bar-getElementsByTagName('foo')[0] isn't working

well it returns an array

..

you can't access returned arrays using []

i must put in in some variable first?

$foo = $bar-getElementsByTagName('foo'); $foo[0]

i never tried it in php before, i'm used to it from js
okay. thanks

try list($foo) = $bar-getElementsByTagName('foo');

you can use reset
reset($bar-getElementsByTagName('foo'));

Hi, is there a more condensed way to have a statement "$var = ($_SESSION['longvariable']) ? $_SESSION['longvariable'] : 0;" like a way to shorten it up?

AlexC_ /n? and why i don't see them in text
editors
?

mornesan, nope thats it as short as it gets

I never said /n

okay, thanks

\n

because that is what's used for a new line, it doesn't make any sense for an editor to show "\n" for a new line
it will just show, a new line

is there a unicode way to represent a quote "

yeah but its not fun

snoop-: Yeah, but I don't have it memorized. look it up.

php isn't fun
in php anyway to convert a string to unicode characters?

utf8_encode, iconv, mb_string

i'm trying to parse xml with it.. (yeah, i know, there's an xml parser… but it's so ugly to use it )

I was under the impreswsion ASCII was a subset of utf-8?

php 4 or 5?

tried simplexml shesek?

anyone know of a good profiler that will plug into virtually any software without having to recompile PHP?

and xml knows "

5, but should work on 4

xdebug?

i'll try simplexml
looks great

docs say it's an extension :-/

yes, but you don't have to recompile php

i should have been more clear, sorry. i dont have access to editing extensions (shared host)

I see

I can send test messages using sendmail from shell, yet not from php. The path is correct in php.ini and the messages make it to the queue, they are just not sent. any ideas?

i'm getting some unusual slowness in the software which i think is related to the database connection handling (shared host DB is ridiculous slow)
i'd really like to pinpoint the problem easily. besides creating microtimes before and after execution i haven't really come up with anything else.

artnez, xdebug + kcachegrind or wincachegrind

he said he can't

sorry, didn't see that. maybe setup a local instance and install xdebug on that

coder_, PHP is probably blocked check your mail logs

do you think PHP's performance could be ruined on a crappy shared host? maybe one that has way too many websites on a crappy box?

what user would php be running as? apache?
or nobody?

and by ruined, i mean things that used to take 0.0005 to process now take 0.01 to process

coder_, either

artnez, there's a package called "gubed" which doesn't require re-compilation but it's mainly for debugging, not profiling

if the server is overloaded then yes

ps aux | grep -i httpd

i'll take a look, thanks
ok thanks for the confirmation now to chew out my host and test things locally.. sigh.. so much time wasted on b.s.

move host?

not mine :-/ a client's

tell them to move host?

can't you dl() xdebug?

ScottMac, is there an alternative mta that is less complex? I just need it to send messages from php mail and thats it. For like, 4-5 web sites. heh

they're planning to get a dedicated box but they're slow and not very wise

kill the client?

coder_, we use postfix here

coder_ on windows there's hmailserver

we use postfix with spamassassin and clamav to good affect

ok where can I find a decent reference to how method chaining works?
I can't grasp returning $this

chaining?

$foo-bar-car-yay()-oh_dear();

ya

AlexC_ can i replace all \n with $stripped=preg_replace('\n','',$stripped); ?

you have to do "\n"

why use preg_replace
thats a waste

what do you mean?

str_replace is faster
$stripped = str_replace("\n", '', $stripped);

ScottMac, do you know how to setup postfix?

I suppose with method chaining by returning $this you are sort of adding to the function?
bI suppose with method chaining by returning $this you are sort of adding to the function?/b

if messages are in queue, check if mailer is started

prior to

not sure what you mean by returning $this

H2020, I can send test messages from shell

as done in this example http://tonybaird.com/index.php/programming/php-method-chaining/

and they are delivered instantly

what does the maillog say? maybe the sender from or recipient is incorrect.
mailq shows that messages are in queue?

same address as test messages

coder_, yeah there are plenty of howto on howtofordge

1 yes

err howtoforge

send a sighup signal to the MTA?

try reloading the mailer
what is the message status in mailq?

nah, good client. it's just hard finding a good server admin these days that can setup a dedicated box without any problems. sometimes i wish server admins had the same ability to do things right like software crowd does

connection timed out w/ host

then the recipient mail server does not respond correctly

right.

Artnez, server admins are expensive

hmm.

check if you can telnet to port 25 of that host

that is.. good server admins are expensive

Hi, I am trying to read from a template file, named template.php . The majority of the stuff in this file is html, but there's the occasional php tags in it. How do I get the php to be executed, and not just echo-ed out to the output?

this world is unjust

I get a small fortune doing server admin stuff on the side

just include the template file using inclue() or require()

retainer is about $100 a week and then $150 / hour

thief!

H2020, the message in the queue isn't even a message I sent. I think my test messages are just going into oblivion

by the way, if $stripped has a phrase like "it's good" the dash might confuse any further JS, how can I type the dash without confusing scripts??

is there any oracle php user here?

aren't retainers usually paid to attorneys?

it s about oracle s long raw type

do your messages appear in log file?

what dash
huh?

dash?
you mean the apostrophe?

I am replacing certain tokens in the template. So the steps I am currently taking are: 1. Read in the template. 2. Replace tokens 3. echo the string . Is there a way to make the php tags execute in this model? If not, how do I include() it if I need to manipulate it first?

Artnez, contractors too

H2020, maillog is empty

Artnez, it just says that if they need my services again I'm obliged to do it

you can use ' inside of " "s and vice versa

but there is 4 or 5 that have been rotated
its not logging anything anymore apparently

just more movies about lawyers than server admins

you make also use the \' to escape a ' inside of a ' ' … ie: 'Bob\'s Pizza'

include the file first, then use output buffering to replace the tokens

oh noes our webs are down
which ones?
all of them

http://us2.php.net/outcontrol

thanks, I am going to review this

dmakalsky, step 2.5 eval($filecontents)

although i don't see a point in having tokens then php variables, just do one of the two only

hardcorelamer, if eval is the answer you've asked the wrong question

or something — in which case assign them to php variables and be done with it

try also php errorlog, messages should be logged in mailer when you send them

what sucks about output buffering is that you will have to wait until the entire template is processed to display it

scottmac, i didn't ask the question

no eval

where php error log?

there would be no way to have the {TAGS} be replaced with php code if you included first, then did tag replacement
unless you wrote out the output to a tmp file, then included it…..

.j #mysql
er

H2020, httpd's error_log?

what are you trying to make? a simple tag replacement template thing?

if i understood correctly, he had tokens *and* php code and he wanted to process both

so $stripped = str_replace("'", '\'', $stripped); would do the job?

thus he includes the file first, that processes the php code — then uses output buffering to replace the tokens
if he wants to replace tags with PHP code, then it's better to create a compiled version of the template anyway for caching - but i dont think that's what he wanted

enable output buffering, include the template file (that may contain PHP code) then store the buffer in a string, then replace the {TAGS}

true, but you're acting like include() and eval(file_get_contents()) are two vastly different things
and they're not

er, they are

they are
"The Zend engine changes the PHP to a binary structure at the START of the file, and then parses it. Every time an eval is called, however, it has to reactivate the parsing procedure and convert the eval()'d code into usable binary format again."

Program mode requires special privileges, e.g., root or TrustedUser. — i see this in error_log, which is probably sendmail

"Basically, if you eval() code, it takes as long as calling a new php page with the same code inside."

yes
can someone please check what times does your _SERVER["REQUEST_TIME"] contain in phpinfo()?

H2020, the problem is, I don't know what user to add as trusted user. apache is there.

please, can anyone understand why $stripped = str_replace("'", '\'', $stripped); doesn't do as expected?
replacing ' for \'

huh?

anybody knows if have any "mod()" function for php?

no, it replaces ' for '

operator %

why would you do that?

you want "'", "\'"

it's not rpelacing anything
do this

are you inserting it into a database?

thankz

$stripped = str_replace("'", "\'", $stripped);

(or use add_slashes() )

btw, did you put full path to sendmail in php.ini?

the function is addslashes

yes

and you should database spefici escape functions

My pear based connection to postgresql works from commandline php but not via apache… why might this be?

he may not be using it for database

try creating a file in php in /tmp and see which user creates it

i think it's for javascript

yes I think it is, he mentioned it before

and you reloaded apache/php?

yes H2020
apache should be ran by user/group apache/apache
according to httpd.conf

so maybe he just wants to escape single quotes and not doubles

ya, ps aux|grep -i httpd confirms that as ScottMac suggested earlier

what did you put for sendmail_from and sendmail_path?

sendmail_from is commented out
sendmail_path = /usr/sbin/sendmail -t -i

true

www.mysite.com/listen.php?v=df537gh to this www.mysite.com/listen/df537gh RewriteRule ^listen/(.*)/?$ listen.php?v=$1 [NC,L] what's wrong?

can you su apache and check if you can run that command line?

check #apache

hm. apache user doesnt have a shell

why would it?

shell shmell

apache error log does not report any error?

ok, i usermod -s /bin/bash apache
and tried running sendmail

you can just do su apache -s /bin/bash

RunAsUser for MSP ignored, check group ids (egid=48, want=51)

and not give it a shell

why would a postgresql database connection work from commandline php but not apache php ??

thanks for that info!
can not chdir(/var/spool/clientmqueue/): Permission denied

check with phpinfo if you have the module installed

Program mode requires special privileges, e.g., root or TrustedUser.
sorry for the pasting

Solifugus what error are you getting?

DB Error: connect failed

i'm trying to get ibm_db2 support available and i'm trying to configure –with-db2 and i get this error: checking for db2 major version… configure: error: Header contains different version

but it works when run from commandline php… so that should indicate that the module is installed.
shouldn't it?

how can i troubleshoot this?

can you do ls -l /usr/sbin/sendmail, where is it pointing?

otherwise wouldn't i get an error on the require_once() line

Solifugus check phpinfo iirc cli and mod use diff php.ini.

/etc/alternatives/mta , which points to /usr/sbin/sendmail.sendmail

Solifugus are you using db abstraction or native?

what are the access rights for /var/spool/clientmqueue

pear

770, smmsp/smmsp

Solifugus have you tried the native functions?

is there an alternative to preg_replace
i'm trying to replace " with '

no i haven't tried to native functions….

snoop-, php.net/strings has a list of functions that perform all kinds of operations on strings along with a short description of what the functions do
Perhaps reading it would help you find a function that would help in this case and in the future, try looking there first

my understanding was that pear is now an official part of php 5+

H2020, are those ok?

and the directory is empty?

yes

Solifugus I don't know about that… but i'd try the native connect function just for giggles

yes, right are ok

what is the quickest way to eliminate duplicates of two identical rows wich consist of 2 columns and indentical meanins that both columns have the same value not just one in a mysql table?
using php of course

and sendmail daemon is running? as what user?

group by in the sql query, in php - one of the sort functions allows just unique instances I believe.

I might be forced to…

CTalkobt more info pls?

I did notice that phpinfo() says it with built without pear (using CentOS). But I installed pear and all the modules using yum, after installing apache.

Just looked - the fn I was thinking of wasn't there - if you've only got 2 columns then just use one of the columns as the index name in an array.

does anyone know why php time would be completely wrong (wrong timezone)? system time is ok, but php time is -9 hours

otherwise you'll be forced to call one of the sort functions and iterate over them unsetting duplicate indexes.

and take each result and iterate though the whole db 32132131 times

H2020, define "php time", as php does nothing to keep track of its own time, it simply bases it around the system time

not that flashy….

H2020, yes, its running

php.ini? date.timezone

i use 5.1.6 and phpinfo shows _SERVER["REQUEST_TIME"] time

it appears to be running as root though

i added date.timezone to php.ini, but it does not help

INSERT INTO newstable (field1, field2) SELECT DISTINCT field1, field2 FROM oldtable

does empty() trim first?

uh?

no

enobrev, really? seems like it should

space = !empty()

Hm, alright.. So is this legal? : $params = array($_REQUEST['firstname'], $_REQUEST['lastname'], $_REQUEST['middle_initial'], $_REQUEST['dob'], $_REQUEST['ssn'], $_REQUEST['citizen_status'], $_REQUEST['high_school_status'], $_REQUEST['selective_service'], $_REQUEST['current_street'],
$_REQUEST['current_city'], $_REQUEST['current_state'], $_REQUEST['current_zip'], $_REQUEST['current_email'], $_REQUEST['current_home_phone'], $_RE
QUEST['current_work_phone'], $_REQUEST['permanent_street'], $_REQUEST['permanent_city'], $_REQUEST['permanent_state'], $_REQUEST['permanent_zip'], $_REQUEST['permanent_email'], $_REQUEST['permanent_home_phone'], $_REQUEST['permanent_work_phone'], $_REQUEST['member_signature'], date("Y-m-d"),
$_REQUEST['gender'], $_REQUEST['registered_voter'], $_REQUEST['race'], $_REQUEST['ethnicity'], $_REQUEST['marital_status'], $_REQUEST['highest_level
_of_education'], $_REQUEST['disabled'], $_REQUEST['disability_specified'], $_REQUEST['veteran'], implode(",", $_REQUEST['reason_joining_program']), implode(",", $_REQUEST['how_heard_about_program']), $_REQUEST['how_heard_about_program_other'], $_REQUEST['previously_enrolled_in_americorps'],
$_REQUEST['previously_enrolled_in_americorps_count'], $_REQUEST['released_from_americorps'], $_REQUEST['member_signature_2'], $_SESSION['TRC_USER']['

woah!
stop

USER_INFO']['member_id'], date("Y-m-d H:i:s"), $_SESSION['TRC_USER']['USER_INFO']['member_id'], date("Y-m-d H:i:s"), '1', '0', '1', $_REQUEST['program'], $_REQUEST['current_email']);
$sql = "INSERT INTO members(firstname, lastname, middle_initial, dob, ssn, citizen_status, high_school_status, selective_service, current_street, current_city, current_state, current_zip, current_email, current_home_phone, current_work_phone, permanent_street, permanent_city, permanent_state,
permanent_zip, permanent_email, permanent_home_phone, permanent_work_phone, member_signature, date_signed, gender, registered_voter, race, ethni

city, marital_status, highest_level_of_education, disabled, disability_specified, veteran, reason_joining_program, how_heard_about_program, how_heard_about_program_other, previously_enrolled_in_americorps, previously_enrolled_in_americorps_count, released_from_americorps, member_signature_2,
createdby, created, updatedby, updated, isapproved, isdeleted, isactive, program, username) VALUES(" . substr(str_repeat('?,', count($params)), 0, -

create a new table with the same fields, make and insert-select using distinct

1) . ")";

$res = db_query($sql, $params);
CRAP
Sorry
kick me

pastebin
paste bin

someone!
I really didnt mean to do that
I must have still had it selected , SORRY GUYS
I AM SORRY

way she goes

http://pastebin.com/

god damn linux middle button paste
if(empty(trim($_REQUEST[$key])))

H2020, is it a problem that sendmail is running as root?

that is what I was going to ask

Comments

I have a Map X How can I remove all entries which have as a value Object Y Do I have to iterate - I figure since

DRMacIver, yea i know i do it sometimes when you need an object to pass through alot of "filters" all adding or modifying it somehow..

does anyone know how to get all the perspectives of a rcp application in an action class, which implements IWorkbenchWindowActionDelegate?

why would we need structs in java?

I have an entity with date in JPQL
JPA i mean
is ito possible to ask for it using JPQL, where e.g. (month = 3)

not unless you use between as part of the query

tx, i'll check BETWEEN

hows it going?

going okay
trying to convince myself that I want to work
failing miserably, too

haha
im trying to figure out why i could not sign into the safari tech books online site from home

Safari? Discount? Huh?

if you are a member of safaribooksonline.com you get a 35% discount if you buy the print version
so i can read them online or buy them at a discount
they have just about every tech book imaginable

g[r]eek: Different allocation semantics to objects. C# includes them for similar reasons.

oreilly books!

how does an allocation for a struct differ from a class in C++?
but… I get those anyway

But I'm not saying it's a serious lack.
I have no idea. I don't know much about how C++ works. In C# they're always stack allocated and passed by value.

All I gotta do to get an ORA book is call Tim

lucky

DRMacIver / jottinger: "no structs in java is the number ill!"

g[r]eek: tee hee hee

i used to get college text books for free

oh bugger, "number 1 ill!"

but thats stopped

g[r]eek: I wouldn't be silly enough to claim that. It's at worst a minor annoyance. There are much bigger ones.

my easy way out of needing composites is to us arraylist and typecast. refactor later :P

~g[r]eek–
Bah

i win.

Saved by the (lack of) bot.
I'll get you next time!

forward the idea to wei gao, i bet he'll have plenty to write about

coach wei and weiqi gao are different people

i'll henceforth stick to gao. can never remember his first name

coach wei is the "smarter" one

gao should be synonymous with provocative

although both are usually pretty smart
bah, gao had ONE really dumb post

im lost
who is coach wei?

(yeah i'm south african, i have no idea)

I'm lost too.

TSS thread. Weiqi Gao posted "the number one ill of java" being package structure matching directory structure

oh
i remember reading that

oh don't leave out "the evil 0-indexed array"

that guy was a moron

g[r]eek: that was probably number two

haha

0 based indexing is pretty much a hard fast rule in comp sci now

but the thing is… he's not a moron. I think he had a MASSIVE brainfart, left skidmarks on his cap and stuff

it's a virtue to always give someone the benefit of the doubt

one of those "did I do that?" moments

"the number 1 virtue"

but I'm a nice person myself, so I make sure to highlight those moments when I can
just wait until Hani Suleiman does that!
(problem is.. the bileblog is a COLLECTION of those moments, so it's hard to find the exact time)

hah

plus, hani's smarter than most of us put together

didn't he and pr3d4t0r have a go at each other

smarter or just more knowledgable?

i recall reading something about that once

well, sort of
Hani and a lot of people have a go at each other

probably both
lol fair enough

in person he's quite a nice guy, very smart
incredibly smart, in fact

so, what is number zero ill of java, then ? *oh, he is not into zero indexed*

you won't look back

I'm smarter than most of you by a mile… and he's smarter than I am

~teralaser++

g[r]eek: im working on it now, got the domain, hosting and some customers lined up

modest as always

nothing personal, you retards

need to find a designer =\
i know im not smart by any means

what kind of designer?

im capable
graphic designer

ah, yeah. If you need a reference, I can give you one.

yeah i do

some day i'll write a haiku about jottinger's ePenis

brb

g[r]eek: you'd need 21 syllables…

17 actually

when you get back, LMK

but i get what you saying :P

I still think limericks beat haiku

g[r]eek: I know what a haiku is, I was being very specific
geez, you must think I'm as dumb as you are

if i did, i wouldn't know it

bwahaha
g[r]eek++

hi
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'cbi4d:16.0' as the value of the DISPLAY variable. when runing: java.awt.image.BufferedImage.createGraphics()
thing is its a CLI application
no gui
i am just generatign a png image
anyone have an idea?

which usually requires some sort of graphics system… try running with the headless flag

yes, you need to tell java web host to run headless

what does that mean ?
is it flag?

~headless

Do you know a component for web application that save a stack of the pages…so that I can show a list of link to say you are here…or something like that?

hmmm, still no bot…

you mean "java -jar ~headless

google for "java headless site:java.sun.com"

?

I have a Map X. How can I remove all entries, which have as a value Object Y ? Do I have to iterate - I figure since there is a containsValue(), there must be some method to aid in this? Maybe retrieve a set of keys which has Y as value?

k back

iterate over the entrySet and call Iterator.remove for the matching entries

I need a stack of the visited pages…do you know something in java?

if you look at the javadoc for containsValue you find that it state that it will usually take linear time…
(which means that for most implementations it will just iterate…)

ernimril, I see. thanks for the explanation - thats rare

-Djava.awt.headless=true
that worked

What happened to the bot?

but i understand if i catch the exception i can make the code ignore it…?
will everything run normaly if i do that?

just run headless if you can

he was probably asked to leave. the other day a non-op asked javabot to leave. why oh why is that permitted?
Blafasel

stupid host…
gimme a sec

g[r]eek: No, javabot is not online

ah, hadn't tried pm

Where do you run it?
g[r]eek: /whois ..

figured you were asking why javabot wasn't in #

ernimril, i am running on a mainframe, it really is headless

can anyone _still_ ask javabot to leave? if so, i'm curious why that's allowed

yes they can. it's allowed because the bot has no ACLs
but that'll change soon.

ok. in the mean time, if someone is messing around and asks bot to leave for no real reason, can we invite him back or must we contact an op?

an op has to
and then hopefully the op will ban that user.
i know I will

ok

man firefox 2 has been giving me lots of problems lately

What about the hoster? Any problems with them?

it looks that way…
i can't even ssh in
i have to bounce that machine via the control panel.

Hmm.. If you need a new place: Drop me a line

who is the host?

The safari stuff is quite expensive, huh? At least for me as an individual it doesn't seem to make sense..

yeah it is
luckily i work for the state so the cover the cost
but its not bad to have if you own/work for a company that can afford it
i wish i could download sections of the book in pdf format though
cause sometimes its a pain to read on the site
mmm little debbie

I prefer reading a real book. Reading it online should be considerably cheaper or it is too much hassle.

heh yeah
they have a cheaper version thats like 30 bucks a month

real books dont have a search function ;-(

sure they do, its called the index

most books have very sucky indexes
/me hates /me

ok whats a good library to do windows authentication with?

I am launching with java -jar … a file.jar file and I've got some errors regarding memory form jar file… but on a other computer all is ok ! the pc where errors I have is a IIS 6 on a windows 2003\
what could I check ? there are any parameters like java /mem force or something ?

depends entirely on what "some errors" happen to be

I can not understand what you said…

if it's a lack of heap space, the -Xmx parameter and it's friends is likely what you need

you could try putting your commands and the full output in a pastebin

let me try

Try? It's not that hard..

ping

pong. Pong. PONG Already! What do you people want?! What will it take to finally get some peace and quiet around here!?!

fuck
stupid host

why do we call super inside my exception ctor class?

eh?

Hm. I'd somehow missed that $ was valid in identifiers.

" + aE.getMessage());

~tell b0r3d about constructors
dammit!
8^)=

hrhr

because the super constructor allways have to run befor the rest of your constructor

i know what's super for
ernimril, i see
ok thanks

if you did you wouldn't ask that question.

Don't educate, make the bot work.
;-p

your object depends on the super class to be functioning so you have to make sure that it is

i'm bringing up the new version with an old database now

Anyway I can get Unixtime? new Date().getTime() returns milliseconds - what is a reliable way to convert that to seconds?
At least - what can I call to know how many milliseconds in a second for this O/S?

hrhr
milliseconds in a second?

http://www.pastebin.ca/648626

Is that configurable? I'd like 42 per second

my bet is that there is somewhere around 1k ms per s …
pretty far out thinking though..

brave guess

System.currentTimeMillis is easier than new Date…

hey! java is supposed to be portable! what about other universes?

1k meaning 1000 this time or 1024 again? Stupid computers..

wb

ernimril, my question is still - how do I convert that to seconds - how do I determine how many millis in a second for the current O/S?

Blafasel, meanin 1000

Thank you, cheeser.

do you know what "mili" stand for?

description of currentTimeMillis - "For example, many operating systems measure time in units of tens of milliseconds."

Your question still doesn't make sense.

fifo_, the number of ms on a s doesent change weith OS?

That means that you might only see results from currentTimeMillies that end with 0 ..

so the description of currentTimeMillis only means that there might be an inaccuracy - rather than a different value?
Blafasel, oh - ok

diffrent OSen just provide diffrent resultion to updates. the scale of the value will always be the same

OH I SEE
freek :/

how can a millisecond be of different value?

the resolution of the timer may be bad (windows… )

poe-t, that bugged me aswell
I misread

for every ms) results

oO(time is never what it seems ;-)

some systems might return 1023 miliseconds
while others would only return 1020 miliseconds
er milliseconds

give java host more memory "-Xmx256m" or something…

time is relative… or so i heard

assuming your distributed system is physically moving

haha
well technically it is moving

wlfshmn, O_o that adds a whole other dimension to logical timestamps!

since the earth is spinning

now, you all do take time dilation into account, right?

well if it accelerates or moves at the speed of light ;-)

or speeds approaching the speed of light….

gah. looks like maybe a DNS hiccup

cheeser!!

what up, yo?

Aradorn, yeah i get that now. I read it and undestood as: Some O/Ss will measure in a tenth smaller, ie 10000th of a second

i think javabot doesn't like us anymore

that would make communicating with the system a tad troublesome..

pchapman, there all programms might behave weird ;-)

wlfshmn, just a tad. I'm sure Scotty or Lt. Laforge could help ya
cheeser, getting ready for a full day of code. you?

I'll just use subspace4j to open a socket

wlfshmn, lolrof

migrating hudson to a new machine

a linux machine?
or OSX?
or [insert any OS but a Windows variant here]?

oooo coffee

mm coffee..
what a great idea!

glad to be of service

~coffee jottinger

gentoo

if you are going to give a man coffee, do it the correct way

oh, hudson. that's on an XP machine

cheeser, extra-nice

i've got javabot on the mind
8^)=

whaley, and how would that be?

^

if you on fedora linux have a native library ( .so ) , and java coughs out "Invalid ElF Header" even though it is supposed to be for linux, what do one do ?

Panic.

ok.
and then ?

recompile with the correct compiler?

well, it would indicate the file is corrupt, or compressed, or some such

compiler/linker

Check if it is for 64 bit or 32 bit while your system is the opposite?

maybe try the file command and see what it tells you

what do file say about it?
gah!

:P

file ?

man file

"file yourlib.so"

ok

never used file?

*trying* … (on another machine)

.oO(calling that command "file" was silly…)

whaley, not everyone goes for the instant (automatic) stuff ;-)

hm, it says "HTML document text" ??

hrhr..

try reading it…

Now that's great
head yourFileHere

probably an error page instead of the lib you wanted…

aaah

pchapman:

gaaa
blah, probably a wget gone wrong…

pebkac?

all bugs are pebkac. you just have to find out *which* cak.

~Duesentrieb ++

whaley, I have no idea what Duesentrieb ++ is.

~Duesentrieb++

duesentrieb has a karma level of 11, whaley

cak? kac!

\o/
pedends on your pov

~pebkac

ernimril, pebkac is Problem Exists Between Keyboard And Chair

^^^

Hm?

cak/kac is the last part….

he just told me i got it the wrong way around

No, really? See my statement about 3mins ago. I was using that acronym (and the right order)

what elements are printable in Java [printable like writing to PDF or sending to a printer]

Thanks

"elements"? "printable"?
you can print by drawing to a printer graphics context. i don't think tehre are any build-in facilities for "print this text nicely to a page" or soething

Duesentrieb, like, what if I want the user to be able to print the window, or save as a .tif or .png

a Graphics Context

most swing components can print themself…

a GC can be a screen area, an offscreen image, a print buffer, an interface to SVG, etc…

nice, thanks ernimril, Duesentrieb

just get a printer graphics and pass it to paint/paintComponent

hm, now the Linux complains about a missing win_driver.dll , while it should be missing the .so

oh, the class ist called "Graphics", or "Graphics2D"

*sigh*

and almost nobody gets Graphics… Graphics2D is everywhere, Graphics is just for backward compatibility

but note that jtable/jlist/jtree may need to be paged, some of them has some support for it…

linux may use windows drivers for some stuff

oh

the so may just be glue

ah

dunno if that's the case here, but it might

thanks Duesentrieb, ernimril, I'll start reading about it when I get home [and drink pure red bull or something]

what are you trying to run?

a firewire/1394 chip programming software thing.
supposedly, it should work under Linux too.

ernimril, I'm aiming to make a stock market graph program, so I think I don't need jtable/jlist/jtree

sure…

obviously the chip programming has to be native, as it requires some special 1394 bus communications.

basic printing in java is easy, if you plan on doing anything complicated (A1 landscape plotting or similar) then prepare for some trouble…

would I be able to print it easily too, if I use jogl? to make the interface more 3D

a lot of problems have been fixed in java/6u2 so make sure you run it..
not sure, I have not used jogl myself

ernimril, I'm still using 1.5 most of the time, or even 1.4

why?

ernimril, I don't remember
some program went crazy
but I don't remember which

So try again

so either fix the program or make sure the responsible party knows about their crappy product

ernimril, I don't remember which it was :P
I'll start "debugging" it next week
it wasn't mine

printer/file? should I expect trouble?

hi how to make user friendly or clean url in jsp? like instead of "http://localhost:8084/ocricket/welcome.onm?p=login" to something like this http://localhost:8084/ocricket/welcome.onm/login

url mappings are up to the webserver.

i am using sun application server host 9
or is it possible with tomcat?

don't know. afaik tomcat has some very limited support for this type of thing. the app server probably has more

java bot left the room? :P

that host is screwed and I'm not going to take the time to call them since i'm at work.

*grumble*. Okay, I'm supposed to have 3000/768 ADSL. Yet the DSL router shows 768/680
u*grumble*. Okay, I'm supposed to have 3000/768 ADSL. Yet the DSL router shows 768/680/u

where's your soap now, huh? huh? huh?
service oriented architecture doesn't men jack when you got no infrastructure, huh

"Is screwed" means s.o. (we're not pointing fingers) screwed it?

something is cratering the "machine" when it boots.
like it immediately runs out of memory.

Ouch

does it have RAM?

Anyone see the James' Blog NB Visual Web demo? I didn't know Java could do such things so easily. Using css for all the layout, you could crank out CGI by the ton.

which maven repository package do you recommend
which Maven hosting repository package do you recommend

is there any lib available to rewrite url?

regex?

htmlparser?

Mm. Are there any good libraries or frameworks for augmenting an existing java hosting library with 'undo' capability?
i.e. I perform a bunch of actions and then want to roll some of them back.
(Obviously I don't expect this to work transparently, just to get some support for it)

compensating transactions you mean?
well presumably you need only to keep a log of what you've done

More or less. I have in mind more like the level of undo support you'd get in e.g. a text editor.

Hmm…

then play it in reverse order

I have Apache installed.

So these are fine grained rather than containing multiple actions like a transaction.

What about Tomcat… is it an installable module?
….like, an Apache module?

someone just wrote a system to lookup configuration details in a db rather than to have property files; am i alone in thinking this is utterly insane and is reinventing not only jndi but also maven profiles/

No, tomcat is no apache module
Yes, there are apache modules that can use/talk to Tomcat

Yeah, something like that. It will be easy enough to roll our own from scratch if we have to. Just wondering if there was some good support for it.

Crap… I was going to have my server running PHP, ASP, and JSP all at once so I'll have places to practice.

not that I know of
but it's a cool problem domain

So? What's the problem?

I can see some nice ways of doing it in an automated manner for simple beans, but the actions I need to undo will be more complicated than just dumb get/sets.

I was just wondering there WAS a module that allowed me to run servlets.

what should I learn if I want to make a simple "game" where the players interact in a turnbased environment?

while() loops would really help in that… and if were net based, java.net.Socket objects would help.

java ?

Dr_Link, it would be for an interactive class
I expect that they would be in groups of 4-5 using a laptop per group

class as in the class that Java uses or class like "I learned it in class"?

finally i found it http://software.softeu.cz/rewriter/

oh.

Dr_Link, what voodoo should I learn to make this happen?

Well…
You should have a Socket object act as a server on one computer…
and have the other computers use their own Socket objects to communicate with the server.
and have the other computers use their own Socket objects to communicate with the server.

Dr_Link, does it get more complicated if they are not on the same lan?

nope.

Is it possible to catch two different types of exceptions in one catch block? and perhaps cast it down to exception/throwable?

you can just enter an IP address or a domain name for that computer.

for example, some would be using wired, some wireless connection

when making a socket connection

… im really starting to hate windows

Dr_Link, the server hosting computer?

No.
….Here, let me see…
OK, you'd take the Server.
the clients would connect to the server using the server's ip address host address
And a port.

isn't that what I just asked ^^;;

Then, the server would allow traffic through the port… say… port 73, maybe… and allow it to run.
Then the turn based communication would use while() loops on the server.

running code as root++

Dr_Link, interesting

So, that's a general overview of how I would do such a thing…

thanks again

Nice comment. I guess they didn't even realize the problem

I'm sure that thought never struck them - no

Is there a way of recieving value change notifications from mbeans over jmx without doing anything on remote servers other then just enableing jmx?

ug samba is being a pain in the ass
rather jcifs is beign a pain in th eass

that happens a lot. i chalk it up to the frailty of SMB networks

Why would SAX not correctly parse this line of XML? EITC_TEXTLIC - License/E & O/EITC_TEXT
The ampersand is escaped correctly and whatnot.. SAX onlly returns the O when I try to get the tag contents.

jcifs is returning that im currntly locked out and cannot log in

The rest of my XML without escaped ampersands works fine =/

Can anyone help me identify something in some JSP code?
%@taglib prefix="c" uri="c_uri" %
Is this a built in feature of JSP?

yes

ok, and where do I find c_uri?

in the jar files for the taglib

Hm.

in WEB-INF/lib? Any way to work out which of the 15 jar files it comes from?

I don't think I've seen anyone actually use those except as a joke before.

depends on your app server

Tomcat 5.5

it's the jstl taglib, look for it

ah, yeah, I see jstl

hi, any Java EE developer?

plenty

anyone knows of a graphical interface for derby (like PGAdmin or PhpMyAdmin)

Nice then
I have a simple question!

squirrel sql, dbvisualizer
we can't tell, since you've not asked it

thanks, I'll have a look at these

I was wondering if Java EE would work for a project I have

I can't imagine it wouldn't

It involves a Dispatcher

hold on - this jstl.jar is standard right? It contains javax.servlet.jsp.jstl..

that connects to a remote 3rd-party server to send messages.

in that case - do you know why I'm getting a compilation problem ("According to TLD or

I was think I could make this a EJB module that servers an application client to send messages

attribute directive in tag file, attribute test does not accept any

?

ugh, sorry.
how can "attribute test does not accept any expressions" be true?

with EJB, can I have an Static Instance of this dispatcher that keeps the connection alive and still send messages requested by the client?
Is there a way to do what I need to do using JavaEE?

Why would you use Ruby on Rails over J2EE?

Time to market.

see the TLD
speed of development

No need for large scale.

the Top Level Domain?

Lots of reasons.

you probably could, but why?
no, the tag library descriptor
~tla hell

With the NB visual web plugin I can't see how Ruby would be faster. Guess I should play with it.

whats that?

Anyone know how to turn off ALL code completion in netbeans?
http://gamblin.ca/ss.png

I'm having some weird issues with multiple instances of an rcp app running? Has anyone else run into this?

oh, RoR is better than that

#netbeans

What, you're not recommending RoR because Ruby is magic and wonderful and makes you a better person?

leip, thanks

I actually don't care for ruby all that much… it's slow, I don't like inspecific syntax

how do I convert ascii string (encoded utf16) back to String? say String foo="p\u00334something" so to output like foo="päsomething"; ?

anyone?

I just don't see what makes Rails's MVC paradigm so much superior over others.

But don't bug them about it

for the most part, it's because you don't have to DO anything

http://www.netbeans.org/kb/50/using-netbeans/editing.html#56504
"To turn off code completion, select Editor in the left pane of the Options window and then click the General tab and unselect the checkbox for the Auto Popup Completion Window property."

where do I find the TLD?

you generate the scaffolding, and then you pretty much have a working app… right there… done

After I first played with it, I just assumed it was hyped and new and thus auto-magically l33t

Fair enough.

and you modify it in pieces to make it look how you want
in the jar file

In actual development, generated scaffolding is frowned on

*shrug* I'm sure it is. It's a great way to get to market *quickly* though…

The actual competitive strength comes in the form of ActiveRecord, migrations, and clean MVC

leip, still doesn't work with that turned off

Oh, I have a strong opinion on Ruby. The language sucks, the interpreter is slow. It is Rails that holds everyone's attention.

migration meaning…?

Migrations…

I haven't found the clean MVC to be all that great, and activerecord… eh

Have you developed in RoR before?

why? Well I thought Is time to use Java EE, or isn't this a good idea for that kind of project?

the term can mean a lot of things

in jstl.jar? That only contained classes.

yes, but I'm far from an aficionado, to be sure

I mean, that's just part of the project

I'm talking about the fantastic feature that prevents you from ever having to write sql statements
db/migrate

to me, "migrations" can mean taking an app from dev to stage to production, or it can mean pushing sets of data from dev-stage-production

script/generate migration Cat name:string age:integer
Or beter yet script/generate model …

bah, DDL is trivial, it's not a competitive strength for ruby IMO
but thank you for clarifying

Being able to deploy the same web app in almost any environment is not trivial

I manage
go figure! I don't have any real problem with that at all… how is it "not trivial?"

did you mean I should look for the TLD in jstl.jar? That only contained class files…

jottinger is just so good he makes it looks easy

it's going to be somewhere in your server.
nonsense… I'm far from being real smart
I'm pretty average, really

the TLD is going to be somewhere other than jstl.jar?

lies!

can be, sure
more truth than I wish were accurate

Anyone use RCP?

hehe

OK… and what am I looking for? any particular filename? anything I can grep for?

8Z ? What does the T and Z mean

seperator, zulu

peace-keeper: that looks like the GMT time from the RFC

the zulu means UTC IIRC

oddly enough, it's not supported by Java, IIRC, unless they added the format recently

aww

Trivial for you doesn't mean it's trivial for everyone or that migrations have not aided significantly to the RoR buz. Rapidly spreading use or awareness of a framework is not trivial.

sure. The reason it's not trivial bugs the crap out of me - it's mostly that java developers don't know how to manage their projects worth shit. RoR did a MUCh better job of making that explicit and up front.

Which again, is not trivial.

sorry to press you man, but I've no idea what I'm even looking for here. Are there any docs on this you can recommend?

but is that an advantage for RUBY ON RAILS or is it an advantage for the RoR community? I say the latter.
*sigh* look for taglib*.*

Can a EJB behave like a Singleton for dispatching messages to a remote server using a always-on TCPIP (or so) connection? I mean, he opens the connection at start and uses to send packages requested by clients.

I don't know where tomcat has it

Although I will whole heartidly agree that java developers don't know how to manage their projects worth shit…

no

Trivial or not is a subjective opinion =p

if you need that, use a connector instead
it's a mission of mine, yes

Would you care to tell me why the art I like is terrible also?

The community aids the framework and visa versa, they are almost unseperatable

I agree with leip wholeheartedly though
so it's a tiny framework?

Yes, but it's still subjective hate seeing subjective things stated as fact..

in all honesty, there's the great unwashed java developer community, and the literati
the literati are more common than people think, mostly because they don't spend their time whining about useless crap, and they, like, get things done
I'm fairly well-known as one of the literati mostly because my job is to be publicly known

A connector? I'll read about it, I'm learning JavaEE, so thanks!

I'll let those comments stand and get back to work.

but again… most of the developers *I* hang with… don't find migration from server to server or platform to platform all that much of something to notice
*nod*
when you get time, if you're interested, I'd be on for discussing further

I will agree though that migration from server to server, if the code is well written and the project well managed, is cake. Personally, I just have found that I have saved a masive amount of time not worrying about writting SQL statements or DAOs.

if i want to import a class or package i've downloaded is there a certain directory i need to place them in

But that swings over to ActiveRecord territory

I'll note that I haven't written manual JDBC in a few years

Hibernate or…?

JPA, JCR

no, but you need to specify the classpath to its location.

I prefer toplink over hibernate, but that's an entirely personal choice. Hibernate has some AWESOME capabilities that hopefully JPA 2.0 will integrate.

has anyone ever heard of javac producing an anonymous inner class, when there is no such class in the source file?

I'd have to see the file

with set CLASSPATH=Cpath

the enclosing method attribute points to a nonexistant constant table entry :-/
the anonymous inner class is completely empty

then you need to put the stuff in Cpath

no fields, no methods, no init/clinit

Why toplink over hibernate?
(brb)

ok thank you

I find it generates fewer calls to the DB for me… that said, I've seen the opposite for other people

https://svn.jboss.org/repos/sandbox/david.lloyd/remoting3/api-proto/src/main/java/org/jboss/cx/remoting/stream/Streams.java

it's just perhaps that I'm more used to toplink

but be careful since some automatic builds override stuff, so gotta pay attention to that.

make that http://anonsvn.jboss.org/….

sheesh, you guys put your SOURCE CODE online? What are you, open sores or something?

oh yes

well, let's see… two classes so far…

there's 6 static nested

ew, okay

but no clearly no anonymous inners

and it's generating an anonymous one?

or inner classes of any type

what's the name of the anon?

yes, an empty anonymous
$1
they're anonymous
that means no names

they get the parent name, normally

right, Streams$1

anonymous inners get named, they're just derivable names

I figured that part was implied

bah, okay
I was seriously wondering WTF you did to get "$1"

~pastebin
wtf

javabot isn't here

very odd..

http://rafb.net/p/nUM0u588.html
a href="http://rafb.net/p/nUM0u588.html"http://rafb.net/p/nUM0u588.html/a
that's the javap output for the anonymous
notice the bytecode for the EnclosingMethod attribute

What happened to the javabot! I'm blaming you… or someone who looks like you ;-)

Class #6, Asciz string #0

i bet it's r0bby

like i've said numerous times already, the host is hosed.

somehow, javabot's porous response time is r0bby's fautl

I tried it with JDK5, JDK6, and BEA's JDK5

lol dfr

Ah, sorry

let me know if you want a new home for it
I can give you an account on mine

can you compile it with eclipse compiler?

Colo?

ernimril, not readily
virtual colo, yeah

well, all the other are more or less the same, could be some javac bug

hmm, looks like something in a constructor for Streams, but why it would need one…
I'm kinda with ernimril here

jottinger, I'd be inclined to believe that in that case the enclosing method would be init, would it not?

85 BST

I think it's a bug

hmm, hmmm
yeah, I think you're right

do I have to use SimpleDateFormat?

file a bug for javac
does jikes do the same thing?
jrockit's compiler?

a grain of sand into the black whole
jrockit does, yeah
but it's JDK5 source and jikes doesn't do jdk5 yet does it?

Failed to mention..

wb

Thank you, cheeser.

~fnord

leip, I have no idea what fnord is.

http://www.javachannel.net | Javascript is in ##javascript | No applets. | Do not paste more than two lines. Use "~pastebin" to list options.

85 BST" into a

~javadoc SimpleDateFormet
~javadoc SimpleDateFormat

cheeser, you forgot a /topic?

I don't know of any documentation for SimpleDateFormet
cheeser, please see java.text.SimpleDateFormat: http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html

hehe. yeah.

:-)

it doesn't do a check to see if the file on the server is newer than the local, it just moves it out no matter what, is there away to resolve this?

Hi!

"API module structure `jk_module' in file /usr/local/apache2/modules/mod_jk.so is garbled - perhaps this is not an Apache module DSO?" error message… any hint?
u"API module structure `jk_module' in file /usr/local/apache2/modules/mod_jk.so is garbled - perhaps this is not an Apache module DSO?" error message… any hint?/u

try #tomcat and ##apache

I believe that may be a feature of the scp command.
i mean to say the scp command line client behaves the same way

damn

can't you ssh over and check if it exists first?

it does

thanks!
bye

would it be proper design to have a Predicate that evaluates whether or not an object has been persisted?

oh, well, doesn't that solve the problem?

NotPersistedPredicate
or something like that?

what? I have files on my local (a ton of them) and I only want to SCP the ones that are newer than whats on the server rather than all of the files

use rsync, not scp

sweet, thanks

np

with no problems. However, when the contenttype is word, the links no longer work. Anyone experience this before?

I have also tried div id="something" name="something"

divs don't have names

lol.. i was thining the same thing

you need to learn html

other than that, his html is valid though
so it's not a major problem
at least he didn't use layer

if you want # links to work you have to use a
to mark the destinations

ugh, does ant have an rsync task? Issue is I'm working with a number of people and some of which aren't unix savy

I know that divs don't have names, but we are talking about microsoft here…

no, we're talking about html
http://www.w3.org/TR/html401/\
rather, http://www.w3.org/TR/html401/

when did microsoft start recognizing the rules of HTML?

a name="foo/

anyways, thats off topic, i will try the a tag
thanks fellas

don't be rediculous
writing stupid HTML just because microsoft isn't very standards compliant is foolish

why are you using a technology like JSP which is meant to render text content (HTML) to output a binary file?
write a servlet

huh?

servlets are your friend

huh?

since when is JSP meant to write HTML to a binary file
and since when does it make sense to tell someone to replace JSP with a servlet
usually JSP is rendered to the user *by* a servlet

jsp can be rtf too

sorry, i don't know if it does
it probably wouldn't be *too* hard to make a custom one calling the ocmmand line client though
if it doesnt have an rsync task..

Eclipse or Netbeans?

IDEA

Both will work fine.

Which one you like best? I'm currently trying to use Fedora's Eclipse approach, is faster but buggy.

do you spend your own money on idea? or does your work buy it for you?

spent my own

I've always found the gcj versin of eclipse to be dog slow. HotSpot seems much, much faster

seems to be all too common..

i gues that means it must be good i'll have to try it out one of these days

Although, I am always on very powerful hardware, so….

Really?

i know companies that buy licenses for their devs
it's the best around, imo.

by HotSpot you mean the normal eclipse?

tmccrary, whynt use javac from sun?

it's a bit supprising that so many companies are unwilling to spent fairly small amounts of money on tools their developer prefers, usually without much thought behind it

javac is a bytecode compiler.
err source compiler

ls is a directory listing program

yes

~ping

Watch where you're sticking that thing!

~wb

Thank you, dmlloyd.

he seems faster
~dmlloyd

dmlloyd, dmlloyd is this one guy who hangs around and irritates people.

tmccrary, well anyway java from sun.com _is_ faster then gcj

I used to work for a smaller ocmpany that (at my recommendation) bought IDEA licenses, but after we got bought up and I tried to aquire an upgrade to idea 4.0, I was told to netbeans instead, because it was free..

by quite a bit
and quite logically too
ewwwwwww

What I was saying is, that at least with Eclipse, HotSpot's JIT'd native code seems faster than gcj's AOT native code

what really annoyed me was that it was explicitly said that the reason I should use netbeans was that it was free..

i don't think it is. just perception afaict
~ping

Pong

~stats

I have been up for 0 days, have served 7 messages, and have 3331 factoids.
bI have been up for 0 days, have served 7 messages, and have 3331 factoids./b

yeah, hence why I buy my own IDEA license these days
at the time, I believe it was netbeans 3.somthing.. 3.2? perhaps

ewwwww, even worse
I could sort of see someone saying NB5.5 isn't so much worse than IDEA that the cost would be hard to justify

issue is that our development boxes are windows

I don't know that I'd agree with it, but I can see that being justifiable

hmm.. that is tricky

but IDEA against NB 5? EWHHHHHHWHWHWWWHWHWHW*SPITSPIT*

is there a windows rsync release? can you cygwin it?

yeah, I tried it and figured the small investment in my prefered IDE would pay for itself in reduced valium costs

I believe there is

hi what is the difference between dispose() and setvisible(false)

cool, so it should be doable to write an ant task for it.. even in windows

dispose() destroys the frame, releasing any native resources

Sorry for the ignorant comment before hehe, I didn't know HotSpot

you can execute external commands with ant

can I add a selector to only get files that have been modified within X minutes?

I'll have to try it out

no problem

I know its not exactly the best solution, but it would work

i have the CA in a keystore, how to sign a certificate request using that keystore ? I mean isn't there an equivalent to openssl that know how to deal with java keystores?

HotSpot is included in SE 6 right?

Good question, I don't know.

yep

Ya that would be a pain puting that on ever dev's machine =/

nice, thanks!

variables also live after dispose()?

dispose releases resources that the component itself allocates

sorry variables also live after dispose()?

Also, if you're using eclipse, I'd recommend setting larger than default heap sizes. This makes the program run faster because the heap isn't changing size as much. Eclipse is a big application and has a lot of memory churn

I'll do it if I have to, but I'd like to find something that will work for the time being

the unix find command can also return you a list of files based on modified X minutes ago
but in windows.. i'm at a loss

i have a login frame starts with program. after clicking login what should i do dispose() or setvisible(false)?

dispose() if you're done with it

check otu robocopy.. the windows guys here say it's rsync for windows
it's free also..

nice!
thanks

np

thanks

… /filset

s/filset/fileset/
keep doing that

Oh cool, ya that sounds like it should do the job. And even cross platform

its not as simple per say as rsync but it should do the trick until scp gets on the ball

i have an abstract method shutdown(), in one implementation of the method an IOException might be thrown, would it be a good idea to catch that exception and rethrow it as a RuntimeException instead?

it's never a good idea to hide exceptions

unless you're 100% sure to have fixed the error.
but since you're throwing runetime, you arent…
s/rune/run

it might be neccesary sometimes because of 3rd-party libraries / delegators.

so my other idea is to change the declaration of shutdown() so that it "throws Exception" is that better?

it's better, but even more so if it's tighter (throws MyExceptionClass, IOException)

if you're shutting down anyway, handling the exception by logging it might be enough =/

Zaph0d^: but then i get a long list of exceptions that must be throw up through lots of code
no, if i get an exception something is really wrong

then you need to handle it. If you cannot handle it, need to pass it to above methods.
and yes that means passing up a lot of exceptions in code. But that makes sense, since each of those methods might fail and it should be aware of that.
and should explicitely specify what to do in that case of failure.

However, you can consolidate the exceptions. If the actual problem isn't important to you (just the fact that it failed) you can create a new exception (passing the old one as it's parameter) and throw that one
so you could throw only one type of exception upwards

yeap, right

Well, I think I have to much plugins on Eclipse
Because Fedora's one still is faster

Zaph0d^: then i just consolidate them to a RuntimeException so i don't have to declare them, sounds great and lazy

no

no, because RuntimeException is not your exception.

well, you could do that, but IMO it's wrong

what zaphot means: void foo() throws FooException { try { … } catch (IOException ioE) { throw new FooException("message", ioe);}

1. RuntimeException is not yours (other things can throw it). 2. RuntimeException isn't declared. You should never hide exceptions unless under a rigid (unchangale) hierarchey
zaphot? ZAPHOT?

s/zaphot/zaph0d^

grr

Zaph0d^: sorry
Zaph0d^: it's my accent anyway…

i think i understand

but basically, throwing runtime exception is a bad style… most of the itme.

checked exceptions are really annoying, i just want to display a dialog box when something goes wrong

Anyway, the rules (well, meta-rules) are that you never hide an exception. You either handle it or throw it as visibly as possible.

they arent annoying once ya learn to use them and appreciate it… the "annoying" is good because it forces ya to check them and you can't "forget" to check an error.

ye. IMO RuntimeExceptions should've been restricted to NPE and IAE.

Zaph0d^: what about uoE?
Zaph0d^: or nfE?
i think illegal state is one too

they are annoying in that i have to decorate my code with lots of throws clauses just to make that dialog box…

no you dont, really…

UOE means you've got a problematic inheritence. NFE could be thrown as IAE.

Zaph0d^: good point.

how so?

I forget.. what do you call someone who is the grandson of your granfather's brother?

you either handle it on the spot in code… or you just consolidate them

second nephew?

brother twice or three times removed.. something like that.

you mean cousin?

why is it annoying? it's like saying it's annoying to write new methods.
it's part of the method signature.

basically, make "MyException" that takes a parameter of a string with a message. And then have your method forward only that exception.

and in modern IDEs it's much faster to do.
ye, only don't call it "MyException". Call it "FailedShowingMessageBoxABCException" or somesuch.

Zaph0d^: its annoying in that this abstract method has dozens of implementors, one of them may throw an IOException so the abstract declaration has to change

and/or handle the exception of the spot by openning that window and not forwarding anything.

yes. that's the idea. you either handle or throw.

the internet is a weird place.. I randomly found a blog of some guy who shares the same last name as my grandfather, and found out my grandfather's brother is his grandfather

Zaph0d^: so all callees to this method also has to pass the exception upwards and so on

well, can they handle it?

If the abstract declartion didn't change, it would mean that the caller of that method would be oblivious to the fact that an exception can be throw out of it.

that'S what exception chaining is for.

no

if you have an interface like, say, DataStore, declare a DataStoreException. If one implementation might encouter an IOException, wrap it in a DataStoreException. Same for SQLException, RemoteException, etc

then you gotta forward it to the enitity that can, right?
s/enit/enti

What would you rather happen - you using a method that has no exception and when one is thrown at you it cripples your entire flow, or you using a method that does declare an exception and then you can decide if you want to abort the flow (gracefully) or handle it somehow.
At work we have a flow that goes through 11 layers of factories / implementors before actually going somewhere else (where it continues to do so). About once per 2 layers we wrap the exception with the layer general exception class and rethrow it.
the result - we can handle problems to flows.

ok so for this shutdown() example, i create a ShutdownException?

for example, yea..

Zaph0d^: that "About once per 2 layers" seems very arbitrary

and if we actually need the cause, we can do getCause()
Factory-Impl. once per 2 layers
+about because sometimes it's impl-utility class

Zaph0d^: ick, I would not like to see your stack traces, 5-6 levels of FooException … caused by BarException … caused by BazException ….

a ShutdownException seems overspecific. You'd proably want an exception that corresponds to your interface
that's pretty common, even in the standard api

enterprise product

more so in frameworks like tomcat
the only thing that sucks about it that you can't read the stack trac in one flow. it would need to be printed in reverse order…

no, 1 or 2 caused by happen, more than that is not common in the standard api…

god only knows how many LoC there are in there, but it's an entire building (~200 people) working on related parts. and it's about 4 years old.

*shrug* depends on what you use i guess. RMI, for example…

Zaph0d^: how do you keep any code quality? code review? copy-paste finding? …
sure, rmi gives you 1 extra, still quite a long way from 5 or 6…
Zaph0d^: keeping _one_ style guide?

code reviews, module-wide refactors. and some of the code is still bad / stale
no on the style guide.

i'm not going to argue, i just seem to remember to have seen more. but wth

So, dude. I don't even recall what the /ban was about

chaining is fine with me. i just want an option to reverse the order in which the traces are dumped

agreed

you banned someone for aolbonics and i umm. said something :P

anyway, gotta fix dinner now

I was just a bit surprised, I almost never see more than 1 caused by myself, but then I do not really do ee stuff…

but not all code has to be top level. some of the code is concrete (end-level? bottom-level? top-level?) code (not framework)

Zaph0d^: get a pre-commit hook in your VCS that checks the style guide, it works wonders…

I regularly see 5-6 "caused-by"
first we'll have to fully adopt unit testing and code inspections. then, maybe.

Zaph0d^: why do you have to _fully_ do something before you start on the next thing?

huh?
oh

Anyone know of a data structure library that includes graphs and can be used in commercial products?

Zaph0d^: anyway, we are just something like 15-20 coders and about 7 years, but our code is readable due to our pre-commit, very nice…

erm. because there's only so much effort that can be made re-educting the dev. and it's better (in my managers opinion and mine as well) to implement unit tests before style guides.

Zaph0d^: sure, unless it causes problems in code review…

not really.

Zaph0d^: and still, if you plan on doing it you will have to introduce one rule at a time, slowly anyway, otherwise you halt VCS-commits too much…

product

Zaph0d^: any copy-paste detection?

pmd will do that.

no

how do you capture the username of someone who is authenticated through jcifs? It dosnt seem to appear in the header…

(though I wish there was)

Zaph0d^: same works well (once you fix that file leak…)
how does pmd do with copy-paste detection, I have not tried it in some time…

same?

Zaph0d^: http://sourceforge.net/projects/same

task

yes, but does it work, is it slow or any other interesting about it? what about blank lines and comments?

we run it as part of our CI so i dunno if it's "slow" or not.

since I am home now I can not run it on the code I have at work…

seems to run reasonably fast

I am trying to add another constructor to anonimous interface implementation. But compiler considering it a method, saying "invalid method declaration". what might be wrong? does new constructors allowed in anonimous implementation?

no, they can't take constructors

you can't have constructors in anonymous classes.

since interfaces don't really have state…
i think.

You can have initialisers though.

you can use final (parameters, local variables) to pass in information
also, you have access to your outer class fields

dfr, but this is no more an interface, this is a class now. i wonder why its not allowed

So that + the instance variables of the enclosing method are usually sufficient.

yes, but you're initializing effectively an interface…
what i mean is that interface has no state… and since you're claling constructor for it, you dont need to specify its state.

paulweb515 but i need access to caller-method variable. i think i need an inner class with new constructor

meaning that initialization of the "interface" should be the same…. since it's all in same state…

there's nothing you can do with a constructor that you can't do with what I've mentioned
caller method variable?

yes. my method uses this anonimous implementation. this method has a variable that i need to pass

so make it final

imo, the idea of a parameterized constructor is to amend the newly created object's state to match the one defined by the parameter list.

paulweb515. oh, that helped me. thanks!

w/ant I have a txt file with a list of files in it, how can I read that into a fileset?

hi, today i got a little discussion about EJB-Entity-Beans with BMP. Is there a rule that any database-access should be done in the store/load-methods or is it ok to directly write data to the database inside the setters and getters?

wooo i got jcifs working with mozilla now to finish gettign whta i need from ie!

paulweb515_ what is a reason it must be final to be accessable from inner class?

since i just modify instance-variables by setters and getters i need transactions to prevent inconsistant views on the database?

paulweb515, to avvoid some synchronization issues?

I'm not sure, although the JLS probably is :-)
~JLS

http://java.sun.com/docs/books/jls/

i am not sure the spec will explain any architectural decisions of java

read it and let us know …

just tested same. does it only detect exact copy/paste? I thought it would detect same code with different constants as well.

i preffer not to know )

lol

any ideas?

test
:-=

Hm.

nobody? is there any more j2ee specific channel available?

Intriguing. Apparently IDEA offers some form of peer to peer discovery for diffing with other users versions of a project.

about the final thing: what actually happens is that the value is passed to a synthetic constructor on the anonymous class creation. If it wasn't final, you couldn't have known what the value is when the anonymous class code was executed.

flerli i saw one on dalnet

What a bizarre feature.

thanks, i will check it out

Zaph0d^ doesn't anonimous class execututed immidiately after being defined?

hello

I'll answer with a question - does a delegator executes immediately after being defined?

anyone know anything about JTextPane's? i have one for a chat client, and when the text goes below the limit, a jscrollpane should appear and start to scrool, but instead, the textpane just keeps taking over the rest of the GUI…
i dont know what to do.

or with a code "form.addListener(new Listener { void onAction(){…} });" - when does the onAction fire?
And if I really wanted, I could even write a small haiku about it

after the ); statement?

hello. is it possible to create a persistence unit (persistence.xml) at runtime ? or at least change the database url, login and password ?

chmod 777

Zaph0d^ yes, i see now.

if you really think that, abandon your chat client and go learn java again.

Zaph0d^ very foreseeingly

think what?
Zaph0d, so what will fix the problem?

well, it has to. otherwise the behaviour would be undefined. however, you can define the value as a member in your class and access it by getter/setter. just make sure that at the time of actual access the correct value is there.
for example: "value = new Value(); …{some inner class that uses getValue()}… value = null"

Zaph0d^ one more thing. you said that this variable is passed to a synthetic constructor. isn't a refference passed? why not to use current value of this variable in the anonimous class?

does JavaFX can be used in webapp ?

of course it's referenced passed. everything in java is passed by reference

sounds like an icanhascheezburger question.

what is undefined then? behavior would be clear for me

the reference to the value is passed. there is no reference for the future value of the variable yet, so what would you pass?

~serializable

rellis, serializable is http://www.oreilly.com/catalog/javarmi/chapter/ch10.html

eidolon:

Value v = new Value("a"); {code} v = new Value("b"). - How can you pass a reference to b while {code} is executing?
you would have to pass a reference to your variable (not the variable data, the actual variable)

Zaph0d^ i get it now! not final varaible can reffer to different place in memory and inner class will not reach it anymore.. right

i.e. to the object that holds it.

yed
yes

yep. however, think about how using the "this" keyword changes everything.
(reference to reference)
it's actually much easier to exaplin if you know C++

this is not a variable, it's a special keyword

nm that.

i don't know C++

jhjh

this is evaluated when it runs. so by using "this" you actually say "the reference to the object". so if you use "this.field" you actually say "give me the value that the field 'field' of (the object that "this" is referncing) is referencing (pointing to)"

so you are trying to say that "this" is a unique analogue of C++ pointer?

in my understanding, reference = pointer… so almost everything is pointers…
except for primitives.

dfr i don't know c++ but guess you are wrong

in what sense?

Zaph0d^ can comment more precisely but i think pointer is "reference to reference"

the problem with the code his posted is that after you do v = new Value("b"), the v has a different reference than previously

dfr, right

so the {code} is still containing a reference that points to previous value of v

You know, you guys could just look up the C++ language spec and stop speculating

dfr yes, and i understood this and agreed with him..

when you have a reference to a reference, you just get the updated value, that's all

pointer" :P

so when you do Value v = new Value("B"), v is a pointer.

not really. reference != pointer. pointer is an memory address number. reference is a handle to something. it might (or might not) be a fixed memory address number. in java it's not.

v is a reference

Zaph0d^: okay, i'll agree with that.

dfr but java has no "updated references" that is equal to pointers in C++, that's why you can't say pointer is the same as reference

think about GC - if java used pointers, GC wouldn't have worked.
or rather, worked very differently than it works now.

Zaph0d^: i just always look @ pointers from the view of "point to object"…
Zaph0d^: the fact that in C/C++ it's hard-bound to memory and stuff i look @ language implementation specific.
s/@/as

I'll C++ for a second - int a = (void*)pointer; a++; pointer = (void*)a;
you can't really do that in java.
(sorry if my syntax is wrong, it's been some years since my last c++)

Zaph0d^: of course! and, imo, one shouldnt really do that in C++ either.

how else can you access arrays?

Zaph0d^: []

or strings

Zaph0d^: []

well? what [] really is?

Zaph0d^: that's implementation specifc.

it's actually telling the compiler "base address of pointer + number inside the []"

Zaph0d^: of course, but that's what _compiler_ does. Not the programmer.

no. language.

Zaph0d^: unless it's an operator on an object :-)

yes
unless ^^^
the default operator however does just that.

Zaph0d^: as i said, imo that's way too low level for a OO code.

anyone know why InetAddress.getHostName() is not reversing IP addresses into host names? It simply returns the IP address instead of the hostname. nslookup (and host) on my machine and network works fine.

c++ isn't really OOP. it's a hybrid. for example a true OOP langauge (smalltalk probably being the first) won't allow global variables / functions. also it won't allow pointers and direct memory access.
java isn't a really OOP either (C# is more so) becuase it allows primitives.

and c++ isn't really java.

it uses the security manager

njaguar, check javadoc. it says that if operation is not allowed it will return IP. try to find out why operation is not allowed in your case

primitives which aren't objects.

How can I find out why it's not allowed?

Zaph0d^, only 8 of them, right?

Zaph0d^: pm?

hello
how do I ask a yes or no question?
in java

uh…

poe-t: huh? 8 primitives? (never counted, maybe). still 8 too many. look at C# - each primitive is actually an object.

System.out.println("yes or no?");
:P

~tell Galant about io

Galant, io is http://java.sun.com/tutorial/essential/io

Zaph0d^, 8 primitive 'types' in Java - thats what I thought about

poe-t: though I don't remember if you can inherit from C# "primitives".

techcuy, how do I define what happens if they hit yes or no?

OO is more of a style of coding rather than imposed by langauge. One can write OO code in java.. and one can write non-OO code in java (e.g. making all methods static )

Galant, you capture their input and see

that's really wrong. at least as far as CS defines it.

Zaph0d^: my statement?

Comments

« Previous entries · Next entries »