Archive for August, 2007

hi im experiencing an extrange behaviour with a call to an external file with JavaScript code i have to load two

I found that document online, but how can i integrate these changes into my application: http://groups.google.com/group/Google-Maps-API/browse_thread/thread/b74bad232d8d2e28?hl=en ?

hey if I have a number that has a decimal point in it… is there a method to chop the decimal point and everything to the right of it off?

How can Reddit be so fast with Ajax?! Digg has a clear delay every time you dig/bury something, while Reddit just instantly switches colors and apparently registers this change. How can this be?

sure that its already saved?

a guess: because the colorswitching is done purely at clientside (everything preloaded) and the “saving” of the setting is done via AJAX in the background

Well… um…
I… guess.
Then Digg and all other sites must be very badly coded.
Well, in Digg’s case it’s obvious

very badly coded?

Yes.

var x=document.createElement()… var y=x; – is Y a copy of X?

Since you “feel” the delay.

if Reddit changes colour immediately before waiting for a response from the server to confirm that the change has been made then I’d say Reddit’s not too hot

no

in all browsers? are you sure?

yes

hello

uh
when i do this
http://pastebin.com/m2ffd5c08
the select field has two rows, first says Fist and second is empty
why is there a empty row O_o

Can anyone help me on a little row visibility thing? I simplified everything to the simplest way that is possible. Just view the page in FireFox and click on ‘Merk 1′, and see what happens. http://www.q13.nl/libohorloges/

its an issue @ opera xD

nevermind, fixed
Firefox seemed to like display = “” more than display=”block”

‘mornin

hello

?

looks ok

hmm, for some reasons I don’t have the alert though

, is it possible to change this var from within the body?

Like onclick

you can’t define a var inside the head tag, js is not that tightly coupled to the DOM
it will become a global variable if it’s at the root of a script file

is in the head of the document

does that make it global?

it doesn’t matter where you put the script tag

So how do I make it global?
in the root of script file?
How do you mean?

var foo = bar; outside of any function, or omit the var prefix (in which case you can do it inside a function body as well)

hmmmm
because my var is defined outside of the function[s]
so i just hafta remove the var!
Not working, hmmm
Raevel, I defined num = 0; outside of the funtion and when I click it is not changing
Raevel, does this look right:? onclick=”javascript: num = 2;”

level9wiz don’t put “javascript:” inside events

I just noticed that on google lol
Hmmmm
still not working
Not getting any js errors from the browser tho. js is on and working on other componenets

Hi. Is there a simple way to catch the event of clicking on a checkbox?

Raevel, onclick=”num=2″ ? That should work right?

is there a difference between an object with numerical properties and an array with a sparsely populated index?
(are numerical properties even legal?)

an array has the array prototype associated with it

`js watch

and the ahref is overriding it

and, properties are always toString:ed

var obj = { 13 : “return”, 9 : “tab”, etc }; alert( obj[ charcode ] ); ?

looks fine

no, illegal! you go to jail!

if not, then use an array
it’s legal

mutilator – i ask because my coworkers tend to clone my code a lot, so if it learn later that I did something that isn’t quite right, i’ve institutionalized bad code practice

heh

i know, cloning code is already bad practice

a= {1 : 23}; a[1]; is fine, at least in the ’shell’ bookmarklet

i’d use an object for that, since the property names are of significance

Anyway to make the onclick event override the ahref? I need the href for rel=”ajaxtab” but i want to use onclick to handel some functions

a href=”" onclick=”fCall(); return false;”

Raevel – that’s what I was thinking, just wanted to check

does anybody know if the [object].watch works in IE6?

it doesn’t

thanks

frames.parent[0].location.substr(0,20) -doesn’t work?
when i console.log the “frames.parent[0].location” i get http://www…../main_content.php href=http://……main_content.php
frames.parent[0].location.toString returns “toString”
I want to check whether a url of a frame is as expected

.location.href

ah
yes was about to say .href etc don’t return a value
thank you

hey, i have a simple form (name:, function:, submit..)
i would like to add a “Add another user” button
so that JS print another form with a specified id

toste – do you really want another form, or another input inside the current form?

another input

hello, can I add a method to a DOM tag, as I ‘d do, for example, for a string string.prototype.myfunction = fucntion() ?
I tried form.prototype… (for the from element!) but get an error: form is not defined :/

section?

I have to do an alert from inside the page, and that’s an included php file, so i cannot modify head

what’s the javascript function to scroll to an anchor?

you’ll have to find y coordinate for target anchor
then, use window.scrollBy(0,anchorY);

are you freakin serious?
you can’t do window.location or something?

“wnix” at 71.6.194.243 pasted “function to find Y coordinate from object” (16 lines) at http://erxz.com/pb/4126

no, it should work in the body too. But if you want access to a DOM element in this script, the script should add after this element to the body.

http://erxz.com/pb/4126

nvm, prototype has scrollTo
woot

or use eg. an event handler window.onload = function() {….your script… }

http://redditmedia.com

hi! can someone give me a hint on how to catch a key event (like keypress/keydown) in a certain svg object?

Hi all. How can I use the value of a variable in a regular expression in javascript? var x = ‘taco’; othervar.match(/x/); clearly won’t work

new RegExp (x);

big thanks leobm

I think I understand. thanks.

hey, a quick question, can javascript access contents on a CD?

no

not from a browser.

hm.. thanks
unfortunate..
any idea how i can load information from a cd like a file with records and display it in a browser?

in jquery?

like let’s say my site normally retrieves data from a mysql database, but if i were to bring a laptop to somewhere with no internet access, i would like to be able to get some of the information into a CD and brining it around and still be able to do presentations using information from the CD.
is that possble at all?

$(“#id”).text() and $(“#id”).value and $(“#id”).html() does not work
Oops sorry – wrong channel

an alternative could be a signed applet.
or webstart application.
search in google for the keywords ‘java webstart” or “java signed applet”

hmm, but that means i would need to code a bit in java..
alright, thanks for the ideas leobm, i’ll be to reconsider my options
s/be/have

Im having problems with array.forEach-command, it does not seem to step through all items in my array but rather a random amount of them. Has anyone played around with this?

can you reproduce it?

yes

http://java-avm.sourceforge.net/

thanks leobm

java 1.6 has a javascript engine included. you can code javascript and can use java classes. look at
“Scripting for the java host Platform” google

Im using forEach because I do not add items sequentially but at scattered indexes, so I need to loop through the array and get the index where each item is located at.

leobm, thanks for the advice and help

the fact that you’re using an array probably messes that up
use a regular object instead

how do you mean?
I have been thinking of using Hash instead, but a regular object is a new one

an array represents a list, if you scatter the indexes it’s not a list, it turns into a dictionary

how do I check if a variable is declared?

typeof theVar !== “undefined”

ah cool ty

“raar” is not an english word

raar is undefined
I didn’t know how to check before
‘document.all.whatever.style’ is null or not an object” – what am I doing wrong; http://www.french-property.com/scripts/tom/edit_mails.php ?
firefox works fine with document.layers

you should use neither of the two

hi

oh? what should I use instead?

it depends on what you are doing, but document.getElementById is one alternative

I’ll give it a shot, ty

(typeof x!==undefinedl)
ups

I made an web application based on Chameleon GIS environment, my problem is that I want to make floating window which contains the keymap. I already made most of that part I can move the keymap layers into the floating div, but if I try to marquee the div that contains the keymap away from
the original position it loses the framing functionality

I mean I can’t mark a part of keymap to be displayed on the main Map, except if I move back the floating div to the original position again

Does anyone have any ideas about why http://httux.htgm.no/statviewer/ just refreshes once and then stops in IE? The JS is http://httux.htgm.no/statviewer/statviewer.js (jquery)

hi, is there any way to get the document height? (not window height)

the main problem that the Chameleon make such stupid implementation of this part it just work with document.write, when it creates the keymap layers it scatters them all over the document

script language” (25 lines) at http://erxz.com/pb/4128

http://erxz.com/pb/paste so uh
ehr
http://erxz.com/pb/4128 why does this have results like x: 1.9000000000000015 // y: 0.7900000000000005 O_o

so I’m looking through google’s map code
look what I found…
if (“GMapEZ” in classes) { … }

lol

Here we are checking if a property named “GMapEZ” is present in the object “classes”.

ya I get it, its kind of clever. I didn’t know you could use the ‘in’ inside an if statemen
t

Probably because of the internal storage format for floating-point numbers.

oh boy…
i so hate computers xD

lol, this is funny
alert(["Your browser is not capable of displaying", "Google Maps on this page. Try using Firefox:", "http://getfirefox.com/"].join(“\n“));
they’re not a fan of just using \n in their strings eh?
such overkill

Search for the article “What every computer scientist should know about floating-point”. It’s floating (pardon the pun) around somewhere on the ‘Net.

That article is kind of intimidating for beginners…

That’s life. :-)

Wikipedia explains the same thing is a bit simpler terms.

document.write(“” + “script src=\”" + src + “\”" + ” type=\”text/javascript\”" + “/script”);
why did they split the from the script?

Probably because they were worried the browser will parse it as a new opening tag and they didn’t properly comprehend the concept of inline JavaScript.

:/

hm.. yes.. older browsers.. right
seems like excessive paranoia, but it can’t be that bad

so

It is stupid.

what happened to the “the computer only does what you tell it”? :P

I’m really laughing at google’s alert box

that wouldnt be true in this case
O_o

alert(["Your browser is not capable of displaying", "Google Maps on this page. Try using Firefox:", "http://getfirefox.com/"].join(“\n“));
the same *exact* thing could just be

All you have to do is use DOM methods, or if you insist on living in 1995, say <script instead of script.

alert(“Your browser is not capable of displaying\nGoogle Maps on this page. Try using Firefoxnhttp://getfirefox.com/“);
but I bet the guy who made it got excited when he learned what join could do
and wanted to use it

what happened to the “the computer only does what you tell it”? :P # what are you talking about?

LMAO.

Does anyone know if it’s possible to unit test Ajax?
…and if so.. what framework is good for such a task…

hi
how can I check the domain the user is navigating to on unload?

I doubt you can. Atleast I hope you can’t

how can one check if a value is undefined?

yeah, i was doubting it too.. I was telling a coworker it would probably be a security risk if you could

myVar === undefined
or

it would be possible to examine where they are going, see that they are leaving, and say “HEY! GET YOUR ASS BACK HERE!” and force them back :L(

thanks, wnix

typeof myVar === “undefined”

the first example did not work
alright
thanks

myVar === undefined works, as long as myVar has been declared
myVar === undefined

Error: Error: ReferenceError: myVar is not defined at line 0: (null)

var myVar; myVar === undefined

true

function f(myVar) { return myVar === undefined; } f();

true

var obj = {}; obj.myProperty === undefined

true

typeof(something) == ‘undefined’;

true

that kind of defeats the purpose mostly
but thanks for playing.

“kind of defeats the purpose mostly”?

mostly

document.myForm.array[0].value, where array is an array of strings and contains the names of the form’s elements (to put it in a loop)?

depends what your purpose is mostly

because I’m not declaring the variables
so it wouldn’t help me
but the other one does

why not?

it’s cool

you can still test for them as properties of the global object

yeah, the other example works fine

this.myVar === undefined

true

document.myForm.array[0].value = “someValue”

no

“array” is not connected to the DOM.. right?
not directly.

myFormElement.elements[inputName].value = someValue;

deltab, hum.. I’ll try that

you shouldn’t use document.myForm, by the way
use either document.forms.myForm (or document.forms['myForm']), or document.getElementById(‘myForm’)
I represented those above by myFormElement

ie6 seems to be having problems dealing with inserting a row into a table using javascript
or is this a programming error on my behalf

deltab, what is myFormElement? the name of the form?

depends on how you are inserting the row probably

no, the form element
as obtained through document.forms.myForm (or document.forms['myForm']), or document.getElementById(‘myForm’)
or the form property of an input

new Insertion.bottom(“tblid”,…)

try using the table’s tBodies[0] instead
it looks like it checks for insertion into tbody and tr, but not the table

is there a cross browser compatible function to check pageYOffset?

you can’t read CSS values if they have not been set with JS before”

is this true?
pageYOffset — what’s that supposed to measure again?

what part of the page is visible
like when scrolling

so… the just the window height?
because that’s not what Mozilla says
“Gets the amount of top page content that has been hidden by scrolling down.”

ok well im looking for a cross browser version of that

this? http://msdn2.microsoft.com/en-us/library/ms534618.aspx

Agamemnus does scrollTop apply to the scrollbar on the browser as well?

hello~

i don’t know and the page isn’t opening anymore
hello

hi!

what’s up?

hi, getting started with Javascript – I can put a style property for a div in a var, but how to show the current value when viewing the page containing the div?
some simple plugin for Firefox maybe?

Does anyone know if it’s possible to unit test Ajax?

attachment_array = attachments.split(/,/,attachments); — for some reason attachment_array is not an array, hmm how can i makeit an array ?

so… is it all just people comeing here to seek help without anyone helping? ^^;;

..and if so.. what framework is good for such a task…

that’s right, Princess^^.
coppershade-org^…

you can’t read CSS values if they have not been set with JS before”

“unit test Ajax”?

Uh.. yeah. Does that sound right?

no, it doesn’t.
what are you talking about?

hi… does somebody knows how can i discover when a window is minimized and when it isn’t?

I guess I should say “integration test” but without opening/closing the browser eeach time
*each

ok so I’ll ask the question I am here for… =P

Selenium is too heavy for my purposes

BARBA_RUIVA, might be a bit difficult

so basically I am using javascript to do an animation and I want the page to go to another page at the end of it
but I don’t want to use like window.location.href = newpage or something

BARBA_RUIVA, look at the screen.height / screen.width values, the browser’s natural height and width window, and the current window size.

cuz that kills the back history -.-

window.location.replace(“http://google.com“); – the history remains unchanged

how can i populate an array from str.split(/,/) ?

does it?
hmm
let me try

Princess^^: yes ma’am, that’s the poitn of the function
Princess^^: compatbility is questionable

Agamemnus, i will try

var ary = str.split(/,/);

i tried with window.onblur… but is not exactly i need
Agamemnus, thanks!

DDustin, thxs

Can the var top be used as a global variable for iframes/anything within a single browser window?

iframe communication is tricky, google it
also, firefox recently released a patch to “fix” an iframe “exploit”. FF 2.0.something might make it impossible now

My company uses iframes in their product, which is IE only, and I wish their was an easy way to just declar some js library once and all “child” frames/whatever will have access to it

nopes thanks for the suggestion tho
think Ialready tried that one before too
window.location.href = nextpage works for firefox but not safari -.-
on safari it kills the history

who cares about safari

errr…

how does it kill the history?
you mean the spanish iphones? -.-

otherwise I wouldn’t care

look at the mac history
if it’s something other than “undefined”, maybe you’ll see how to fix it
well, safari history
also, is it safari 3?
someone earlier mentioned buggy javascript in that

any of you familiar with the safari, back button, iframe ordeal?

enlighten us

does anybody know a way to move an iframe inside the domtree and prevent a reload of the frames contents? insertBefore does moving, but the framecontents reload.. ?

Agamemnus:safari 3, the history looks right just the back function that won’t work right

safari doesn’t add iframe pages to history
also doesn’t add #hashes

http://bin.cakephp.org/view/1738437074
anyone can check whats rong in there ?

http://www.streampad.com/blog/?p=110

hi!i have a definition of document.getElementById(idSTR).style.backgroundColor = ‘#FFFF99′; in firefox it works, i get to see the background color butt in Internet Explorer it doesn’t show
is it diferent the sintax?

oh well thnx guys… I’ll figure something out

I have a question about IE6
tavares, no, I don’t think so. probably you did something funky with the id
in IE6, on the first reload, sometimes images don’t look right (too big in height/width etc.)
and then on the second reload everything is fixed
does anyone know how I could fix this?

press reload?

thank you, i’m here all week

but I want the images to look right all the time
i don’t know why this is happening

because webprogramming sux

seriously it does
nuthing comes out right

Agamemnus:

nor cross compatable

Princess^^: yes I double checked and window.location.replace does just that

try reload like that:
window.location.href=window.location.href;

safari is a browser that is lacking, I doubt it will allow you to move w/o modifying history

lol

if you have server acess you could do a 403 redirect or whatever the number is

wnix, no

Princess^^: yes that’s the correct way to do it, if you have control over the server

I don’t want to reload my page infinitely, or even at all
I think it’s because the height and width attributes somehow get distorted..
I had this problem before too

iwas the “#” before the code of the color it as to be without it…

tavares, what?
tavares, oh.
idk
i’m just a noob

window.location.reload(true);

try preloading the images?

I don’t think it helps

..oO ( is my question that unclear or the domtree too tricky ) ..

but how do I preload an image anyway?
rnix, idk.. i don’t use iframes =\
wnix, but wouldn’t the reload the page?!?

hmm well when I do window.location.href = nextpage; at the start of my function and comment out all my animations it works… must be an issue with my timers somehow

here is my code for preloading:
function cacheimage(curimage) {var preload_hoverimage = new Image(); preload_hoverimage.src = curimage}

the issue is tho then it requires 2 hits of the back button instead of one.. which I could live with

It don’t work Agamemnus

what the heck
wnix, rnix?

hmm, sorry. hover images with javascript? did i missed something?
no hack, i’m another

rnix, what?
rnix, what hover images?
I just pasted my image host preload code and I was asking whether it’s correct

just because you types preload_hoverimage in your example code

var myImages = []; function cacheimage(curimage) { var preload_hoverimage = new Image(); myImages.push(preload_hoverimage); preload_hoverimage.src = curimage; }

oh yeah I was doing something else with that code earlier and forgot to rename it

now works

is it not possible to just define your hover functionality with css?

… wrong hover.

ah

wnix, that just loads them all into an array. i’ll try..

yeah
ah global array
in your version, when function ends, the variable with image will be deleted

i know, but doesn’t that still load the image into the browser cache?

hummmm
I think so
=/

maybe it is some other problem
it’s pretty rare
do you use IE6, wnix?

IE7 too
my IE6 is standalone

can you look at my site and waste some bandwidth clicking the links?
and then tell me if anything gets distorted
maybe it is just an IE6 issue
http://www.flyingsoft.phatcode.net/flowers/index.htm if you want..

yeah… bugged
when click in any item of menu

var id = document.getElementById(‘id’).value;
that will give an array with of id=’value’ ?

or will check for id=’id’ ?

get the value at element and place in variable id

what happens when you click?
you mean images distorted or something else?

uh

Agamemnus, i have tried without results here… do you know some example in the web?
i dont understand exactly you means when you say to check window screen

Hello all, I’m having a strange problem with Firefox where I have a frameset, and I use onload in the frameset, yet the child frames have not completely loaded… I thought they were supposed to be completely loaded before load triggered ?

images distorted

http://bin.cakephp.org/view/699064378
the remove function does not work
wnix, any idea ?

Agamemnus, sry was away, sure you can. Angus PNGfix reads CSS properties.
I know it was ace_noone who said it (before I joined probably) but you gave it to me

coppershade-org^, I thought you had a problem with the same thing earlier?
anyway, thanks I will look at that later.. I changed my div to be made in javascript code instead already, though

is to possible to use multiple statements in a case switch? for example: switch( i ) { Case 1, 2: alert(“ok”) }

ron_asheton, yes
case 1:
case 2:
alert(‘foo’); break;

or you can do this:
switch(true) { Case ((i==1) || (i==2)): alert(“ok”) }

can somebody point me in the right direction for controlling an embedded quicktime movie with javascript?
document.getElementById(“movie”).stop(); isn’t cutting it
got it
http://developer.apple.com/documentation/QuickTime/Conceptual/QTScripting_JavaScript/bQTScripting_JavaScri_Document/chapter_1000_section_5.html

err
how do I get the text width of a ?

Agamemnus, I meant that

meant that?
meant what?

Agamemnus, Case ((i==1) || (i==2)), this kind of syntax. thank you

oh, ok.
sure.

You know all those sites which let you choose a country and then it shows a list of cities or “sub areas”? How do you get this information? Is there a global database?

obviously they have the money to hire monkeys to find out
you can try mining wikipedia

“Information age” indeed…
Sadly, the information is mostly crap. :P

mostly

What do you mean by “mining Wikipedia”?

does anyone know how to get the text width of a element or even to center it…

You do that with CSS.
text-align: center;

with javascript
center on a div
you can download the appropriate files from wikipedia using your own program or javascript
you can extract the cities from the files

What files would that be?

or maybe google has something

What articles are you talking about?

http://en.wikipedia.org/wiki/Cities
List of cities by country
List of cities by latitude
List of metropolitan areas by population
etc..

I wonder how reliable that is…
Or even how complete it is.

http://en.wikipedia.org/wiki/List_of_cities_in_Afghanistan
as reliable and as complete as you can hope for.
55°43′N 12°34′E Copenhagen Denmark

there is a .mil site with a similar list, though probably not the ancient times and middle ages stuff

zhttp://www.infoplease.com/almanacs.html
http://www.infoplease.com/ipa/A0001796.html

is it possible to load google maps on an ajax loaded page? i want to init the load() function inside the ajax page

is there a window.close() that works in FF?

zombor, sure, why not… try iframes?
migs, isn’t that a security risk? :-|

iframe?
cant use that

not in this case

sure, but that’s probably why you can’t find it in mozilla

so it’s IE-only?

im trying to load google maps inside a jqmodal dialog box with custom php host variables

maybe you can find another way
did you look in mozilla’s developer-mozilla.org thing?

I guess it’s okay if it’s IE only

zombor, idk

hmmm

any body know about using Javascript with Chameleon GIS Environment
??

the ajax doesnt load with all the google scripts in there, but it will load without ajax

I doubt there’s a way to automatically log out the user after they hit the close button, is there?
or is that just a retarded question?
nm, it’s a retarded question

yes
pretty retarded… try onunload?
ppl, i have no idea what the ajax is so….
zombor, ppl*

im using jquery
http://kenoshaareachamber.imagemanagement.com/member_directory.html

add it to the button’s onlcik event

tells me nothing cause I never used it
close button in the browser.

how do I force a variable to be type string?

ron_asheton:

so I missed something : )

somestring = “”

what do you mean by “what the ajax is”?

Agamemnus, I mean some method like parseInt( variable );

^migs^, you can use cookies if the user wants to log in again and use a cron script to monitor last-known-activity-time
idk, ron
zombor, well… Idk. IDKKKKKKKKKKKKKKK

ok

lol

use an iframe
if you’re somehow inserting the google script in, look at namespace conflicts maybe

i cant use an iframe
like i said

use ajax

i am using ajax

everyone should use ajax

thats my problem

if the page you’re trying to load uses javascript you’ll have to manually parse and eval it tho

What is the syntax for making a new Object that is basically an array (as I’d like to add my own functions) ?

or if there is a lib that does that, tell me!

in the ajax loaded page

that might work

amf, somearray = new Array()

it doesnt work
i get an error back from jquery

and then add to it by doing somearray[0] = 1; somearray[1] = 2;, etc.

I could set up a cron script on their computer that monitors the cookies. If the cookie says it’s okay to log out, then it logs out

I wrote a function which loads a page with ajax, parses the script tags and eveals them (when its a src=”..” script tag, pull in the file with ajax first and eval the content)

^migs^, nono you got it backwards
^migs^, save their login stuff to a cookie and use the cookie data to automatically log them in if they want to log in again

myeah, a friend had the exact same problem, even with the js parsing and evalling it wouldn’t work
)

^migs^, then use a cron script to track their last login date and use a timeout value to check whether they’re still logged in

=(

I think he means his own namespace, as in
var awesome = { cool_alert : function(a) { alert(a); } };
awesome.cool_alert(“blah”);

cron script on the server

right amf?

of course the first part is not what you asked, but it would help

so i cant have javascript in a page loaded with ajax

the matter would be clarified if we knew why you want to log out the user if he closes a window and how “logging out” proceeds

you can, but the simple ajax scripts you find on the net won’t evaluate the js contained in the page you load

function NewArray() { this.prototype = new Array(); } this is closer to what I want, but wrong

so or extend these scripts or find a library that does

if your script just looks at the IP to test whether the user is logged in, that’s different than looking at a cookie that gives the login info constantly
amf….. what did you want again?
“What is the syntax for making a new Object that is basically an array (as I’d like to add my own functions) ?”

hmmmm

ok, amf, try this..

I guess var NewArray = Array(); then NewArray.prototype.somefunc = function () { } makes more sense than what I just said

hmm, where it it…
maybe this is what you need?
http://www.w3schools.com/js/js_objects.asp
or you already know this?

I thought I wanted to extend Array(), but I just want my object to have the interface of an array but do different things for push(), pop() etc

is JScript.NET still based on ECMAScript? I can’t get some features to work

hello collink

omg!

Do the thing i described
you can build your own namespace, so you can do methods such as .pop .push

you schoolin’ nubs in here?

box is dropped down? this.offsetHeight doesn’t change?

in my off time :P

LOL

s/\?$/\./;

seemed like you were helping someone just now

so you can var blah { = { custom_push: function(a, b) { alert(“pushing “+a+” to “+b); } };
blah.custom_push(“foo”, “bar”);
hows things looking with zeb? still doing work on the drift website?

not much

Is there a way I can use javascript host so that when a user clicks a button, it opens and closes their CD drive, makes their computer beep several times, and gives them a BSOD?

^Migs^: tell them to use IE
then just write code as normal.

nice
http://qdb.us/103393
whee

anyone know how to do that ‘big pixels getting smaller as the image streams’ for graphics-intensive sites?
is it done with some attribute of the img tag, for like lower res pictures?

sure
it’s in my huge HTML 4 book
I remember reading it

anyone know of any existing conflicts with effects.js (from scriptaculous) and IE 6 ?

or even better, is it easy to write a script that loads a lores pic and stretches it, blurring it?

image something

and then fades the real pic into focus?

wait…..

I’d do it with the dxtransform thingy, but I don’t know if it works on mac?

“Simply save your GIF or PNG images with the “interlaced” option, or your JPEG images with the “progressive” option.”

ah

! that’s why my images didn’t look right (distorted) at the beginning

still a blurred image host that comes into focus would be even nicer

I don’t think mozilla does that
coppershade
http://www.codinghorror.com/blog/archives/000468.html
it’s basically the same as you said
I need to de-interlace all my images
dammit

hehe
exactly – but does JS have any processing power for fading a pic away on top of another – I mean rendering capabilities?

yeah sure, opacity
coppershade.. if you know photoshop, is there a way for png images not to be automatically named ____ copy.png?

box is dropped down? this.offsetHeight doesn’t change.

Agamemnus, ??

alex25nj, test if it is selected?

I save pics as png all the time and I never got that

what version?

are you using ctrl+alt+shift+s?
I have CS2

no
me too
i used the dialog box

if you don’t “Save As” but “Save for Web” it should work
I have a special grip for hitting ctrl+alt+shift+s in one go
I’ve programmed my hand :P

aight
can’t you reprogram keywords?
i don’t think you need to program your hand
i like “save for web”, saves a few more steps too

how can i print out all the attributes of a variable?
theres some function but i cant remember the name

childNodes?

Test if a drop-down select-box is in a dropped-down state

onfocus or onselect.

I have a tooltip script that appears in the wrong place only when the select box from which it appears (onmouseover) is dropped down. Hiding it onmouseout, onmousemove, and onchange doesn’t do it.

idk

does anybody know anything about the readystate attribute of embed objects?

Hi all
Hello
Is there a simple way to get a users computer name ?

no, just their hostname

Hostname meaning there net connections name
there has to be a way to get there physical computer name.. Its all on the itranet
intranet

well, sometimes it might be transfered in the user-agent string

hmm.. Ill take a look at that

msg /listserv

but it’s definately not going to be reliable

there is no way to build a realible solution even if i have to ask for users permission in a script to access the system
im not really a scripter I just have the idea

nope

what about using asp? or java?

those are server technologies
nothing to do with a client giving up it’s computer name

gotcha…
ill brb

Hi all

hello again, I have a form that I want to submit using AJAX, everything works ok, except that I don’t know how to send an array with javascript

Can someone please help me with http://www.alexlibman.com/jstest.html (use firefox). Read explenation therein.

xhr.send(data.makeRequest()+’&attitude=’+['salut', 'coucou']);
but it’s converted to a string before being sent

array.join (‘,’) ?

Can anyone help me with the best way to implement namespacing?
I have seen two approaches

hey guys, there is a way to know the screen coordinates of an object ? (Relatively to screen)

in the php file ?

yes, sec

Use arrayname.join (sep) in JS, see http://us3.php.net/split for PHP. Make sure the sep string you use cannot appear in data as usual. Don’t know if there’s a better way, see PHP manual.

this would also work with javascript enabled?
gonna read it anyway
thanks

Alex25NJ ?

sec
Download http://www.alexlibman.com/CieNTi.js let me know if you have questions

what’s the simplest way to fill in a form field?

thanks Alex25NJ

how do you mean

i have a form and i want to fill it with “test”

This is relative to browser object, or do you need the entire screen?

just put value=”test” for the value attribute
or
with JS

entire screen if is possible Alex25NJ

obj.value = “test”;
obj being the input value which could be grabbed it’s id with document.getElementById

wow, i just saw a screencast and the dude keep doing function(){…}

for (var i = 0; i document.forms[0].elements.length; ++i) { document.forms[0].elements[i].value = ‘test’; }

that is horrible coding
ppl like him should go live with monkeys

do you have a code example?

Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there’s no issue with IE). Read explanation therein.

hello, interested in the whole name spacing thing.
Is there a best practice for this?

me too?

does anyone know some good tips on how to get prototype to work well with IE?
IE complains (crashes) when safari & firefox don’t

then it’s working normally
IE is meant to do that.

IE7 crashes or older version?
Ask the users to use latest version, don’t even worry about compatibility with older ones, they’re a security risk anyway.

If neccessary to sort of support older IE, you might find it helpful to cut back features
I do this, if I detect that it’s ie6, I often cut out certain ajax functionality, effects and such like

IE6 mostly;
that might be the way to go

but I thought prototype mostly behaves
bitwise5, what’s giving you problems? anything specific?

ie6 says it’s syntax related; “expected :” also “element not defined”

i have a js function, how do i invoke it?

bitwise5 – pastie your code..

see prototype.js (i’m using 1.5.0)

bitwise5, prototype.js behaves well, so my money is that you’ve got a syntax error. safari and firefox are much more lenient than ie.. Are you using any ie plugins for debugging..
is that your only include? have you isolated it, so there is no other js
not even on the page?
as in no onclicks nothing
this sounds liek aproblem elsewhere I use that version of prototype without probs

yeah, ie6 debugger points to a specific line in each of prototype and scriptaculous;

hello

bitwise5 sounds like soemthing fishy to me. Both those libs are fine. I reckon the error is elsewhere.

need a little help – which properties should I use to change the value of something using javascript in a frameset based page?
I need to update a counter from one frame to another

Are they included in a page with no html other than head body and include js tags
?

i’ll have to try that….
i’m guessing they load fine though, the page dies halfway through (well after the includes)…

so you’re including only scriptaculous and prototype?

no, i’ll try that though; make make a few of the same calls that we do in the other pages

do you have ms script debugger and webdev helper and iedevtoolbar? (sorry if I’m being patronising)
they’llve give you more accurate debugging..

actually, our dev team is on macs so we weren’t even test (GASP) ie6 until a few minutes ago

I sometimes get errors in ie which are total bullcrap, and then use webdeve helper and find the real error, whcih is often in another file, or inline (hence me asking you to isolate your scripts)
I’m a mac too
and I did just the same with www.listen2listings.com

yeah, i’m sure the reported error is bs -

went live and then worked out that javsacript in ie has totally different security features and this crappy debugging situation. expect pain for a few hours, my friend
those tool bars will help alot
you can also get firebug for ie
which will let you execute the code snippets live, and that will help you debug
u include it as a javascript on your page.. If you had a page with scriptaculous – prototype and firebug includes
with 1 div
you could try executing some stuff like Effect.Appear(‘your_div’) and shit, to see if it’s working (press F12 to display firebug)..

yeah, i was thinking just call everything we use by hand, one by one
that’s great advice though, thanks

I suggest build up from that and isolate what IE doesn’t like – I guaranttee you’ve either missed a semicolon, or you’re getting an element back from prototype which isn’t quite supported in ie. The errors will be bogus, coz of the way protoype uses eval – the problem isn’t prototype, so dont;
freak out.. it’s something else.
good luck!

thanks!

`icons // Anyone suggest a generic name for icons like these that won’t be confused with other uses of that name (ie, ‘buttons’ is out)

Say it loud, say it proud, say it way too much: http://gtmcknight.com/buttons/validated.php

what’s the name of that script that keeps the header and fades in what is below (when you switch page)

Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there’s no issue with IE). Read explanation therein.

hi guys, Iam trying to have my text field show available options while typing. any idea? note, iam not a java professional, actually not using it much, but want to use it more in the future

“i am not a java professional” — lesson one: java != javascript

I’ve heard them referred to as “antipixel” before but that seems to just be named after the blog which popularised them

Yeah, never heard that before .. I’m calling them micro-badges

mmhmmm
widgesigns!

you need to use AJAX for the options.

OK, thanks
thanks

You don’t need ajax at all
It’s *useful* if you have a great number of options, but it’s never *necessary*
;google javascript suggest

and is updated onkeypress

http://www.devarticles.com/c/a/JavaScript/Suggest-As-You-Type/

^^ Alloosh

thank you, I know that the available options are js and ajax, I want to add this as an option to one site iam making and its not so important.

(AJAX is an overused buzzword, I know. But you do need JavaScript.)

(do the same google search for other options)

can I use this to play flv files? var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);

No one is helping me… Can you recommend a good forum I can take this to?

tips for sorting a table?

http://rick.measham.id.au/paste/tableSort.htm

hi im experiencing an extrange behaviour with a call to an external file with JavaScript code, i have to load two files, the first is loaded but the second doesnt, it wont work if i change the order of loading the files, and i have verified the privileges, the extrange thing is that if i change
the file to web’s root, it will load nicely.. my tree is /js -where i intend to store the javascript code., can you help me please?
the code im using is script language=”JavaScript” src=”js/validator.js”/script

If you edit the location URL for your browser to open your .js file instead of .html, does it come up or do you get an error?

no, it gets the file in text mode

The JS code might be dependent for them to be loaded in certain order, or from a certain place (in head vs in body, etc).

thanks, you indirectly help me to find the issue, it was firefox cache, that was preventing me to load it.. ohh i hate this things!!, i lost like two hours trying to solve this!
thanks a lot, excuse me for the n00b :P
gotta go!, thanks again
lol

I’m in the habit of pressing Ctrl+Shift+R (or Ctrl+F5) to refresh instead of w/o Ctrl – that overrides cache.

damn, saved my png as interleaved, still it won’t show while loading
pixelated I mean

how do you make a link on a page be a “back button”
window.history.back()
hrmm.. how do you put that in an anchor tag and make it work.

== eww

help meeeee

Available Plugins: oeis jeval spell cpan shorten rt topic squeeze rbeval acronym change managementspeak reverse join translate bibleit core imdb insult tv help echo eval convert jseval mangle restart quit deparse part pyeval reload_plugins goobooblink heap_test rss

someone help meeeeeeee

hey guys … can someone explain me (if possible) how to fix the delay in the reaction of an IE moving the slide ? (works great on FF). http://www.lachapamecanica.com/nuevo/?seccion=chapastudio
just place the mouse over the slide and it will follow it
but in IE a mouse with sandclock appear and do the slide move slow
and FF does perfect
someone knows how to fix it ?

i’ll help you
_IF_.. y
_IF_………….

?
it works
i did the neccesary browser especific things

if you go here http://flyingsoft.phatcode.net/flowers/pictures.htm
and tell me if the images are distorted

taller, yes

goddamn it

i see a left menu, with tall-distorted items

ok, so your problem with IE.
did you just say it works?

yes
try it
it works
but the response time is slower than FF

yeah, i do see an hourglass sometimes

FF works *perfect*
and ie is slow
open it with FF now

How do you get all the methods of an object using introspection in js again?

hmm
for me, ie isn’t slow
but it does have an hourglass
are you using ie7?
and I think I might know the problem

” + object[key]);

try replacing ‘object’ with ‘window’ for a good time

cienti?

Agamemnus IE6

anyway i had a problem like this before.

tell me please

the little cursor thing is an image?

hum, I’ve never used console.log actually – mostly alert and div’s

is a div background (9×9 px gif)

well then replace console.log with the logging of your choice
I wouldn’t do alert, however

yeah i think if you change it to an image it might not be a problem

you’ll be sitting there for a while

it’s a little tricky because you might break it in mozilla if you fix it in ie6

let’s try !

nn all ye brave

i don’t exactly remember my solution though but i think it was a div and an image together

” + ok[key]); doesn’t give anything though (not a single alertbox even)

I just had a look at the code – i want methods not members

my solution does have a URL, but it’s somewhat broken in Mozilla 2.0.0.6 now

what makes you think methods and members are different somehow?

because I’m used to members being variables, methods being functions, the they is used as an arraykey which I guess would retrieve variables but not disclose membernames

“members being variables, methods being functions,” yeah most languages are like that. javascript is not

functions are first class variables in javascript

javascript is typeless, a function type is the same as any other type

as george clinton almost said, free your mind and your code will follow

ah right, so it should work then.. strange.

if “loosely typed” is the term, javascript would be the town bicycle on crack

Agamemnus much better .. thanks a lot

” + t1[key]; \n alert(t2);

yes it should
but it doesnt

sure

the date object seems to have no properties, wierd

test it in mozilla too

s/wierd/weird/

if that doesn’t work you might want to switch whether it is an image or div background depending on the browser

interesting

What is the best table sorting .js, most compatible and faster ?

sort
its an amazing function

DDustin?

any good IE7 toolbars for debugging and speed loading?

it sorts arrays

but i mean tables
i have a table

Is there some defacto place to look these things up? I keep using searchengines, landing random places. Such a grief compared to some other stuff. I realize there are many companies with their own implementation but..

how to sort it

you don’t want to make your own?

welcome to javascript :x

http://rick.measham.id.au/paste/tableSort.htm

(like in my case, the api for the Date class)

probably no

tsb I usulaly use mdc
usually *.. it seems to be the best
for most things

can you believe I’ve been doing web-stuff for years? for some reason I shun sjavascript.. a lack of any good reference might be part of the reason.
right, thanks.

thanks Woosta

most web devs do
that’s the reason I’m making my MMO javascript game

ahah
good grief!

ya. its actually mostly done

WOW Woosta it ownz
:P
Woosta can i use script in body instead of head?
its a php cms

but its to hopefully help prove to everyone that javascript isn’t something to be afraid of

so i dont feel like including it in all

I do that all the time

and would suck to check if it has to load the script or not

It’s JS, you can do whatever you want with it

DDustin it validates still right?

Anyone knows a little about Ext Js and can help me (although I’m pretty sure it’s something I’m missing with javascript)

Woosta love you

I stopped caring about validation years ago :P

i dont, since i get paid for it

I know, it’s a much easier language then what I usually use, it’s just that is is so wildly inconsistent across browsers and poorly documented and whatnot that it just turns me off. There are plenty of offline-implementations of ecmascript as well

ya cross browser is annoying

but yes validation sux

for hobby projects my rule is I only port to browsers that have proper debuggers

and async javascript didn’t exacly make things better
it make for cool possibilities, but compared to sockets and other things it is a nightmare to debug, atleast that’s my experience with it
is the game still behind closed dmz’s or have you published a beta?

uh ya its public, hold on

Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there’s no issue with IE). Read explanation therein.

what was your original question? just looking for docs on Date object?

it was about introspection, I had done it several times before, but had forgotten it I looked Date up on mdc

nfi why js thinks nothing is “in” Date in a for loop

yeah it is public, it looks like I broke it though

instead of doing this manually, are there any editors with intellisense or whatever? I’m sure vim has some omni support for it, but the short description would be good to get as well

let me fix that

Dojo 0.9 is out woo!

http://wipproject.zapto.org/tmp/start.html

I’m guessing konqueror isn’t supported?

no sir

works better than opera though
actually, is there supposed to be more than characters there?

as many characters as there are people viewing the page

right

the left control button fires
are you zues?

yeah. it actually seem to work in konq, except for ctrl

here I’ll fire a bullet at you and kill you

(but that’s because ctrl in konq is an accessibility key which highlights links)

hey … in php you can do a negative comparison just writing ! before ( if(!$var) …) … in JS there is a way to do that ?

hehe neat.. this reminds me of my first allegro efforts

that’s funny, you’ve used allegro?
this script is intended for allegro.cc

if you change direction midair you have to click twice to jump once
haha!
yeah, allegro and then sdl
years ago..

oh
maybe I got it :p

and then sdl/opengl, which is fun but getting graphics for anything but a spaceshooter seemed impossible so it’s been a while..
and then sdl/opengl, which is fun but getting graphics for anything but a spaceshooter seemed impossible so it’s been a while..

Night all

What’s the one-line “if/else” statement look like again (or what is it called?)

omg
i’m running into that problem
there Agamemnus?

what
what do you want

that print issue
http://www.icegn.net/test.html
clic print, print/close are suppose to dissapear
but focus goes back to the window and it redisplays it

the ternary operation, condition ? c1 : c2

thank you SO much!

and it was working fine earlier?

yea, remember, ya tested it
except the code was different

but with style.display=”?

right
remember i had both ways on the screen
resize and style.dispaly

yeah but then we figured out a way to use style.display

but theres something with the html on that specific page that makes it not work

right?
it did work with style.display, right?
with a timer.
you didn’t implement it? :/

because a timer doesnt matter
the focus goes back to the page
i could redisplay on a timer, but theres no guarantee when they click print so it could print the buttons

because you need to change your onclick
that’s not what I mean
instead of onclick=”printWindow(0);”
onclick=”start_timer()”
the timer should hide the button then start a 1 second timer that activates printWindow(0)
or less if it works

ok..

do you know how to do that?

yea

ok..
do that and tell me if it works…

dont work
problem is focus seems to be returned after the js function executes
so it redisplays the window
er
button
reload it
i made it alert on focus

show me your code

notice when ya click the button
it popups up and says focus

can you show me your code….

ya
pastebin is slow
hold
http://www.pastebin.ca/666328

The paste 666328 has been copied to http://erxz.com/pb/4131

didn’t you forget a 0?

no, was leftover from the resize function

printwindow(0)?
oh, ok

just got rid of it

but wait
you don’t need the focus part anymore

how will it redisplay the buttons?

did you try it with the timer and without the focus?
worry about that later

thats all i’m worried about
it hides the buttons and prints fine

so it does work?

yea, that has worked

ok, so now the buttons

the problem is focus gets returned
s it redisplays them

ok ok hold on
why not set a timer on the onfocus?

what’d the timer do?

well, actually…
when does the onfocus activate?
when the button is clicked right?

right after your onclick
yea

ok so you need to set a global var
set a global var when the timer is set
or rathr..
how about this
onfocus, set a var
nono…

well
global it on print
and then onfocus check for it
works

if (var1 == 1) {make buttons visible, set var to 0} else {set var to 1}
you could do that too

the disturbing part

but just put the global var in the onfocus
easier to maintain

it worked on the other test page i did
but not this page

maybe your onfocus action was defined at a different time vis-a-vis your onclick action

http://www.icegn.net/test2.html
check it
its odd

idk,
but your page isn’t totally fixed yet
i have an error in IE6…
and ur global var isn’t in the onfocus

ya, error is cause it onfocus and printed doesnt exist yet
printed being the global
haha
guess what was causing it to refocus?
right; in the div tag
if i remove it, it doesnt return focus to body onclick
er no
position:absolute;
thats what it was
o_O

thats good to know
and also quite strange

aye

does a mix of position: absolute and float make sense?

heh nope

anyway, going to sleep, nn

the code is so bastardized from where it came from
trying to figure that out

: )

evenin

`dom ref @ Woosta

dom ref: http://w3.org/DOM , http://mozilla.org/docs/dom/domref/ , http://krook.org/jsdom/ , http://www.zvon.org/xxl/DOM2reference/Output/index.html

`ajax ref @ FlashWolf
nothin?
ow
xit
have 2 go

There is no such thing as ajax .. it’s a concept

cya plpe

`js ref xmlhttprequest // this may be what you want

The XMLHttpRequest Object specification defines an API that provides scripted client functionality for transferring data between a client and a server. http://www.w3.org/TR/XMLHttpRequest/

sorry…
wht shame…
so long
so long folks
mom is callin me
xD

how do i switch the order of an array ? like i have: [1] = blah [2] = hello [3] = bye have it [1] = bye [2]=hello [3]=hello ?

`js ref splice @ Elagic

js ref splice: Changes the content of an array, adding new elements while removing old elements. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:splice)

that is a script?
i want to know how to do it manually

no, it’s a command ..

so i can modify this table sort you gave me
to make it list ASC and DESC

note the URL “Core Javascript 1.5 Reference”
Oh, you just want reverse?

yeap
just to reverse them

`js ref reverse //
bah
`js ref reverse

Transposes the elements of an array: the first array element becomes the last and the last becomes the first. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:reverse)

ownage
thanks
excelent
Woosta considering the code you gave me, where would you put the tableData.reverse(); ?
i made it i thin
had to change the class of the th to verify if it was asc or dsc
Woosta this has a problem, its doing if th.className == “asc” it wont match if class= someclass anotherclass asc
for example
how to say “if asc is in classname” ?
actually ” asc “

if( /\basc\b/.test(foo.className) ){ it’s there }

that is a regexp match?

yes

that is the .test for?

that’s a method of the Regexp object

wow
weird name for a method
:P
lets try it

A lot faster than the match method of string

kewl
regex rules

\b is a word break .. it will work if you don’t try using hyphens in your class names

damn, im spanish, hyphens were?
works very good
oops i found a bug
if asc is in className it makes a .reverse() and sets className to desc

class=”foo-bar” will match the regex as two words

but that will lose the rest

you’d have to replace the asc with desc

actually \basc\b with \bdesc\b

foo.className = foo.className.replace(/\basc\b/, ‘desc’)

exactly
but desc should have \b also right?

No
\b is for matching

oh ok thought it was to match a space

no, it’s a zero-width word boundary

ownage
it werks

and i still cant find out how to remove $ and , from matching string … anyhelp ? ;o

vbm, are you there

yup

still having problems?

yes :$

“and i still cant find out how to remove $ and , from matching string … anyhelp ? ;o”
what are you talking about?

$ 1,000,000 ( that’s million dollars and i want to have just numbers … 1000000 )

yeah ok
i know A way to do it
It’s not the shortest or the most efficient but it’s A way
it’s a string, right?

yup

(typing)

tnx for your help in advance

“$1,000,000

Error: Error: unterminated string literal at line 0: “$1,000,000

oops

noooo this is mine

“$1,000,000″.replace(/\D+/g,”)

1000000

don’t say anything
goddrn67d467dn578mfd689,g7.890890,m567

type faster

haha

ignore woosta

i will … he’s a bad dude :P

for (i = 0; i mystring.length; i++) {
for (var i = 0; i mystring.length; i++) {

“$1,000,000.99″.replace(/\D+/g,”) // I’ll leave this one for you to fix though

100000099

“$1,000,000.99.99″.replace(/\D+/g,”) // And how do you want to treat this one?

10000009999

;o

no wait.

dont confuse me ;/

let’s do this.
and it’s always in the form $1,000,000?
that is, the commas and such
no decimals
and nothing silly like $0?
or $000?

there is sometimes $ 0
it’s a bank page :]

$ 0?
like “$ 0″?

yup


can you control the entry form?

yes

you need to make the entry form not accept invalid values like “$ 0″
don’t allow any keys except $0123456789.
and ,
allow ,

$ and , is not allowed

strip out the “,”, we don’t care if it’s in the wrong position
then it’s not really a problem is it
lolz
ok don’t allow anything except “0123456789.”
do you know how to do this?

well … if i knew i wouldnt ask :P

oh and one more thing
you don’t want a hacker to crash the system
so you need to do client side checking later
i mean..
server side checking
you can’t trust input that you get from the form

it’s for greasemonkey script … and it’s for web game i’m playing ;d

a bank?
in a game?

yup

you’re programming a bank in a game? what?
…..
?

im trying to create “withdraw money” button

As opposed to withdrawing it some other clumsy way

click on amount that is visible in td … remove $ and , and fill in the form
more or less

but the website that you don’t control receives the data?
um… anyway… someform.onkey() should not allow the $ and ,

Comments off

i want to just get the raw exact data from the post and then use it if i am going to use it in a mysql query i

mattmcc, right, but nothing in program files is in my path

it’s a posix layer, so of course it’s not going to let you execute cmd.exe commands unless you explicitly run that shell

err… not really running on unix

caffinated, i meant more like progams, nut builtins for cmd.exe
i installed mplayer for windows and couldn’t run it from my bash shell
piss on that.

you would have to cd into the place it is instelled to.

fireflymantis, yeah, and thats jus tnot ok with me. because the place its installed to is too far away.

why you’d want to use mplayer is beyond me .. windows already does media fairly well.

whoever came up with the name “Program Files” should be shot
caffinated, i’m addicted to mplayer. I hate every other media player

progra~1

shudder

lol. yeah i hate that more than the full name

It’s VLC and winamp for me when it comes media on wndows

yay totem.

Cool, that only took 9 minutes.

hey, nice
chanserv++

VLC is okay, but it never shows up on the right screen (I use tv-out_) and it gets all buggy when you try to open a file and the play is already open. you ahve to drag it between screens and resize it.
plus no other media player has the keyboard controls that mplayer does

Does anyone see something wrong with this code? http://pastebin.osuosl.org/2045

Attempting to use an array as a scalar?

bkero, you need to lose the $ before stuff un 4this-stuff

if ($thing) array_push($this-$stuff,$thing); should be if ($thing) array_push($this-stuff,$thing);

should be $this-stuff

o, so no second $

right

3

Syntactically valid, but not likely what you intended.

Danke

with the $ would be a variable variable reference

i didn’t know that would work.,

does anyone have strong mod_rewrite-fu? I’m after a rule to translate /* to /vfs/* – assuming of course that it’s not already /vfs/..

is anyone good with php/openssl bindings?

fireflymantis, is that how simplexml does those dynamic properties?

so if $foo == ‘bar’ then $this-$foo == $this-bar

actually i think that kind of works in the opposite way

Is there a way to make PHP not store large ints as X.XXXXXXXX EXX ?

http://ca3.php.net/bc

Hahah.

http://pear.php.net/package/Math_BigInteger

what is this php webhosting thing for? fb?

Euler Project

Is there anyway I can use a variable to declare a variable name? like: $_POST['q'.$i] ?

hmm

$$?
i think thatll do it

hm

when you have is correct.

Xinil, that example you posted should work too

/s/when/what

what do you know about creating a mailserver?

Some
PM Me about it though.. this isn’t the channel :p

well I am going to have questions about its operation with php anyway

ok…

ah, $key did work
dunno why, just thought it wouldn’t work for sure

because when I validate someone and make them able to log into the site, it is supposed to send them an email allowing them to do so

Xinil, your example looks to me like it would obviously work, but php is capable of more surprising things than that for dynamic variable names.

Is there a mail server running already?

it lets them know they have been accepted on the team
mailserver? naw
not yet

WOOT Works great

thanks andre_pl

DARKGirl.. linux or windows?

OSX (Unix)

Uhh… lol
No idea

haha
its just the same as Linux, silly

if you’re banning those mass join/quits they’re just bots heheh

Its unix based, but the same applications won’t run on it
DARKGirl, look into the PHP mail function
Should work fine though

sure they will

OSX (Unix) Lol. I wonder how much we’re going to see OSX being called unix host now that its got the seal of approval. not that anything actually changed.

csc`: yep, they’re bots which won’t join/quit after i’m done

lals

what if those ip’s are stolen from others :

It’s just a perl script connected to a pool or tor proxies
so you’re banning legitimated users from your channel
np

you just have to compile whatever application for OSX than Linux

Aww
Opps wrong indow
window
Having fun?

heh… so aqua data studio works, but it still doesn’t solve the problem that I’m connecting to an mssql server to get data dumps…

Notice how everything starts with either “88″ or “85″ ?

wietz0r, you can’t ban a whole subnet though :p

goddammit just blanket ban tor from the channel

hi

hi brenden

I have to Logins screens on my App, one is for admins, and the other one is for customers, when an admin logout of the app the customer session getlost…. anyone can help me??
is two, not “to”

omp arent you ruby

csc`: yeh

do if(array_key_exists($key, $array)) {} and if (isset($array[$key])) {} do the same thing?

NemesisD they are very similar, I would double check on the case of an initialized key pointing to a null value, because that should return true for array_key_exists, but it might return false for isset($array[$key])

hey there

hi guys i’m trying to learn how to hack php

ok chewy, i think ill go with isset in that case then
hack();

k

yeah thats what I would do

have an embarassing question
re logical operators in php i’m used to seeing && when doing a logical AND statement

was php made for people who can’t understand perl?

however in Drupal I’m seeing a lot of & instead of &&
is there a difference?

&& is logical AND || is logical OR, & is bitwise AND, | is bitwise OR

not especially. an alternative, yes.

ahh bitwise that would explain it!
thanks chewy one of the items is indeed bitwise

why use perl if yyou dont have to… sure I can understand it, but that doesn’t mean I want to deal with it.

eh.. perl is fun

perl IMHO

in fact, a lot of people in here can write perl, and just choose not to.

for web scripting definitely
btully np

NemesisD, I agree… i wont doubt the power of perl, but its just too nasty to look at.

perl is a lot more fun that php for one liners

yeah, if thats your idea of fun.

i prefer video games for my fun :P

‘one liners’ are generally not realistic.

well I do a lot of php -r one liners
and perl would make a lot of that easier

what about in an if statement you need to see if 3 things are true/set and only one is a bit

but then I would be writing perl code to generate php code and thats just too much of a head ache

if one of your goals when you code is to make things readable without 10 lines of comments, the ‘one-liner’ is usually not a good idea.

if ($foo && $bar && ($num & 32))
caffinated well I just use one liners for code generation, so its more of just quick hacks than never get looked at again

fair enough.

lets bash asp.net instead. I just found out that’s one of my classes this year, and theres no php at all

ouch that sucks

if ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB && $item['path'] && _menu_item_is_accessible($mid)
) {
does that make sense?

i think its ridiculous. I understand forcing us to use .net for general desktop programming, because they want to make people know whats going to be used mainly in the workplace… but lets face it, ASP.net is a HUGE minority on the internet.
not giving them php experience is shooting them in the foot.

MENU_VISIBLE_IN_BREADCRUMB is the bit
the rest are either true or false

that looks alright, I would put parenthesis around the bitwise and

eh, any programmer should be able to pick up at least rudimentary php in a week or two.

but that seems fine

it’s hardly complicated as far as languages go.

caffinated, yeah but in school, most of the people in my classes are idiots who need to be spoon-fed everything.

and they’re the ones who will fail.

if they dont learn it in school, they wont learn it.

you mean if ($item['type'] & (MENU_VISIBLE_IN_BREADCRUMB) && $item['path'] && _menu_item_is_accessible($mid)

yeah php is pretty quick to learn because it lets you do whatever the hell you want, haha

?

you don’t need to be concerned about them though. you only need to be concerned with you.

caffinated, i wish that was the case. but no. my school sucks and everyones stupid.

naw I mean if ( ($item['type'] & MENU_VISIBLE_IN_BREADCRUMB) && $item['path']…

ahhh i see
thanks!
and if i need to add another item that is bit but i need to check that it is not set?

that way you’re sure its doing bitwise and comparing item['type'] and MENU_VISIBLE_IN_BREADCRUMBS, rather than bitwise and between item['path'] and (MENU_ITEM_IS_ACCESSIBLE && item['path'])

just out of curiosity, for anyone who is in post-secondary school in the US, what are your computer courses like?

$item['type'] & MENU_VISIBLE_IN_BREADCRUMB ~ MENU_LOCAL_TASK)
?

I always forget the precedence tables so I like to make sure its not an issue
andre_pl absolute crap
I dropped out of comp sci and I just work full time now

Is there in PHP anything similar to “friend” keyword from C++?

btully you can add && !isset(NEW_BIT_ELEMENT)

nice

JaBoJa is friend similar to protected, or is more of a casual relationship

thanks SO much!

I have a php script that generates text files from a mysql database. The files are probably 20-60 kb in size each and about 5-15 files at a time. When this script is running, although only a few seconds, I cannot execute other php script on the server simultaneously?

yeah np

it blocks other requests and it shouldn’t. the server is fast enough and with 4 gb ram…

Crytor well if you’re doing a db dump then the db is locked

it allows to access protected members from methods of another class

chewy, I’m in college in canada and i’m pretty confident that i’m not going to learn a thing until at LEAST my last year.

check http://dev.mysql.com/doc/refman/5.0/en/table-locking.html

well, SELECT queries and file_put_contents – on selected fields from database. not a total dump

andre_pl ya know, I thought that too, then I started getting into the more advanced classes and it was just letdown after letdown

aha

I had an operating systems class where we did a fucking play for the dining philosphers problem

LOL

Crytor well as long as you’re not locking the db, and you’re on a multiuser os then you should be fine

chewy, my OS class was using VMWare to install windows, then we learned about some of the advanced control panel things, then we install sisoft sandra to inspect our hardware.
that was it

wow that sucks

MUTEX EXIT STAGE RIGHT
I’d love to see the script for that play.

chewy Totally. 10 assignments, every one of them was “Create a power point presentation with screenshots from your VM. showing the following 10 screens”

mattmcc lol

I think mysql locks the table anyway per default

andre_pl ahhh that sucks, we got to do a final project where we analyzed the VM of an os, so I did it on unix version 6.0, using my lion’s book, so that was pretty cool, but there wasn’t anything in the class I couldn’t have done more effeciently and had a lot more fun, doing it outside of
class

Crytor you might be right, but I didn’t think it locked it for selects

chewy, in my java class, we were supposed to be using linux hosting (just to give us a taste) but my teacher put it off ALL Year (i assume because he didn’t know how to use it) and then he ended up just giving us a bonus 5% if we demonstrated hello world
running under linux.

LOL

the issue is that lets say you have long running query A. then along comes a update B. then there is another select C. B has to wait for A. and C won;t run if there are waiting updates (b)
(where A is a select of course_
)

I used linux all year for everything

but won’t those queries be queued?

yes

but also I thought he said he was just doing a series of select statements
that should just take a min longer if hes doing selects and updates, but it shouldn’t lock him out completely

with MyISAM, it often does

if A is a select and B is an update why would B have to wait for A to finish?

heh… time for some regex fun… gotta take an mssql create database dump and then convert it to mysql

because otherwide A’s select could be corrupted

andre_pl because you can’t have the update modifying rows while the select statement is running
caffinated see thats something I would probably write a one liner for, going from mssql to mysql

INNODB has row-level locking, and might solve your problem Crytor at the expense of a small loss in speed.

well I might make that an actual script in case I need to run that again, but that would be a fun one liner

erm, i would use an adapter pattern

does anyone know how to dynamically create div tags based on a list?

What type of list?

How about a loop?

well, i am supposed to read from a mysql database hosting a list of users that have asked to gain authorisation to log in
this is an administor-apprroved site
you cant just sign up with a username and password and expect to log in right there

foreach($users_needing_auth as $user) {echo “div$user/div”};
like that?

ah an echo?
facinating

yeah, that’s kind of complex

well you could just kep adding to a string and then send it out all at once.
complex?
how so?

he’s being sarcastic.

oh, lol

Nah, just echo it as you get it

well I will need some special stuff. I will need a checkbox to be added next to a userid to show what settings the users have on their accounts

DARKGirl, you can add all of that inside the loop

that is so cool

lol, pretty basic stuff.

I didnt realise echo was that powerful

its not echo.
its the foreach
echo just prints things

ah, I am familliar with foreach
ask Thecks

Nooo!
I am not an oracle

yes, you don’t even support views

nonsense, youre a PB programmer just as I am

PB?

I don’t support views? :o

Oracle does

aye, but its supposed to load all of the users in the database

I’m learning Zend framework… that uses the view model
I meant An Oracle… that mystic thing you go to for advice :P
PB = Pure Basic

i’m just being an ass. don’t sweat it.

its a user managment system. it allows me to easily remove/modify users without having to resort to the damn console

http://www.evolt.org/article/Storing_form_array_data_to_MySQL_using_PHP/18/60222/
Take a look at that, it shows how to load all the data from MySQL into an array
And cycle through and output it

aye! thats something of what I was talking about!

Its more … untidy than the foreach example

its going to be a makeshift table though

But you get the idea

not a real one
just something I made myself

well, you can also do it directly in the result set loop

I do understsand the concept now, yes

it really depends on your code logic

DARKGirl, http://pastebin.ca/669698

pastebin is a nono
lol

why?

http://rafb.net/paste/
use that
because its slow
VERRY slow

i’m not gonna re-paste it.

eh, pastebin is fine. you’re right, we were encouraging people to use other things in the past, but that’s because it was taking like 3 minutes to render the page

it was just a simple example

i wont be able to see it then

its fine for me. not slow at all

improvements have been made since then

DARKGirl, it loads fine.

I tried it
its still loading
it almost never works for me

thats messed up. never had a problem here.

fast for me as well
it must be a netowrk problem

i was going to copy it to rafb but when I copied from pastebin it numbered the lines and made a mess of it.
don’t feel like cleaning it up

ah good, you use mysql_fetch_assoc()

caffinated, imho only a moron wouldn’t.

“Safari can’t find the server.”

who wants to refer to column names by a #?

i don’t have to use my ##php user vodoo doll

yeah, I can never connect to that
it keeps timing out

caffinated well an adapter pattern would work, but then I would have to make that, and thats a little more complicated than I’m looking for, for two reasons, 1) This is just a table dump, so there is only 3 regex I need to parse the whole thing, and 2) if I made an adapter pattern that would
imply that I’m expecting to run into this again, and I really don’t ever want to do this again

what can i say, i’m a sucker for punishment

haha
well at least I’m going to do this in a script rather than a one liner, I’m not trying to punish myself that much on a friday

someone in the community channel was making some joke about someone eating something, and representing it as object/method calls. I fixed the composition. :P

lol

caffinated, sounds like my C++ final project.

well, a lot of people here don’t really understand object relationships too well.
which is fine i suppose, considering php’s procedural nature

caffinated, strangely enough, when I started lto learn about OOP in java, i found it easier to apply the concepts to php than to java.

haha yeah because objects in java hosting are just annoying

likely because java is very strict.
php really allows you to get away with a lot. some would argue too much.

yeah I think php is too loose

I’ll never agree to that. the looser the better!

But, that’s what we’ve got ruby & python for.

eh… a loose language is nice, but its annoying when you don’t have variable checking so typos create interesting little bugs
of course its nice being able to declare and increment a count variable inside of loops and conditionals

chewy, that’s so rare though, I almost never mistype a variable name, and its just not worth all the hassle.

if that made any sense

yeah it did

well I would just like use strict for php
haha

chewy, I think theres something you can pass to error_reporting that’s supposed to indicate possible misspelled variables.

in php5 oo you can force methods to accept only objects of a certain class

E_NOTICE

thats it

which is some kind of exception to the loosiness

Cahaan, I didn’t know that, but I can’t see how I would ever use it.

mm .. loosiness

Colbert-style programming.
Boolean operators that determine truthiness..

yes. it has an exceptional truthiness quality

well I don’t use many objects, but I would like to at least have my variables checked that they have been declared

lol

That’s great until you want to type hint a string or int.

hey is there some way i can use php to change my current link in my navbar?

yeah you should then create your own classes to encapsulate string, and int
byeah you should then create your own classes to encapsulate string, and int/b
which starts to be annoying

And eventually you’ll have a nice Java class hierarchy…
Oh, wait, Zend’s already working on that.

if i had a stick, i would poke you with it

see you click on the different links but it doesn’t change because its reloading the new page in the middle iframe
carlolorenzetti.com

I don’t mind

lol

eh, I would rather have ruby style objects that just allow you to add methods on the fly to predefined classes, than be able to make wrapper classes for primitives

class String { } … that is a little overboard i think

lol

Yeah, then you get a few third party libraries into the mix, and pretty soon you don’t have the foggiest idea how a string behaves…

well it exists in Java, in C++, and a lot of other languages

well, yes, but it’s a part of the standard library

sure it is

AND Those are “Strongly typed languages” php is not, and shouldn’t be

mattmcc well I don’t remember exactly how ruby does it, but I’m pretty sure you could keep the changes in the third party library isolated

that wouldn’t be. worse, it would be in userland code

I agree andre_pl
I’m not trying to argue actually

Monkeypatching gives me the willies.
I don’t know how ruby folks can like it so much.

so it is possible to do yes?

they are all crazy macbook users
and they like danger
method_missing magic really angers me some times. people abuse the hell out of it.

My Dad wants a MacBook for his next laptop. :P

clos, you’re not making much sense. php can probably help you, but you need to know more than just that you want your links to change

tell him it’s a trap.

I like it because then you don’t have to makes functions to act on passed in values, but rather functions to operate on values
caffinated lol

andre i’m just starting to learn php and i think i need to echo back some html somehow

I find it a non-coincidence that he started thinking about getting one around the same time he started poking with Rails.

do you think OO in php webhosting can be interesting for some projects ?

if you go to the site you’ll see what i mean

I’ve got a macbook and I love ruby, and my good buddy who is a ruby hacker also has a macbook

it’s sort of hive-mind mentality i think.

i just need to change the current link

Silly humans.
Sorta like how everybody has a webcast now.

clos, if its loading in an iframe like that, then you probably need to use css & javascript to change it

Cahaan not really, because you’re limited by the lack of state, however there is a pretty good book on design patterns in php 5, and you can do some cool stuff, but you are significantly limited in the useful of design patterns compared to most languages

After all, how are people supposed to learn about your software if they can’t watch a movie?!

write a mac virus, and set it loose on the conference wifi.

that’s right

We already know nobody reads documentation..

yeah i fugured i could do it with javascript, but i don’t want to
i fugures i could do it with php

clos php can only change a page when it is refreshed. that page never refreshes

i see

well, the quality of most documentation is very poor until said project reaches a certain mass of followers.
most people don’t like to write documentation. even fewer are good at it.

and since OO seems to change with every new version of PHP, I would think twice before using this paradigm

and then once you get the mass of followers you get the comment system that is php.net

Django’s docs are pretty good, I’d say. However they made (imho) a critical error in making the default docs apply to the dev version, rather than the latest release.
Case in point, http://www.djangoproject.com/documentation/tutorial01/

caffinated psssh… write documentation? shiet I don’t even like writing comments

my comments are usually commented-out echo’s

A couple weeks ago, ‘max_length’ in trunk used to be maxlength (As it was in all released versions to date). It was changed for consistency, and to avoid confusion with the HTML attribute.

that’s the ruby attitude too – if you need a comment, your code is too complicated.

Now, at the top of every docu page, it says “This document is for Django’s SVN release” with links to the docs for the last two releases.

as a result, there is a lot of poorly documented “magic” ruby.

And yet when max_length was renamed, we literally got a dozen bug reports about it.

caffinated haha yeah seriously, ruby is all about breaking things down into so many small cases that if you try to comment it, you will more than double the code for thank chunk

“Your docs are wrong!”

hah

*for that chunk
wow I’m having issues typing today

well, it’s good until you understand how much the community loves to metaprogram

it’s quite fun to write documentation

its friday and I’m ready for the weekend, but I’m going to be here at work all day tomorrow

then simple-to-understand things become simple-to-understand-for-the-initiated

tools like doxygen can make it even more fun

caffinated yeah they tried to avoid doing shortcuts like perl so that it didn’t have the initiation overhead

as with all languages though, the core group doesn’t give a rats ass if you understand it or not
i hear it a lot at the conferences that people are afraid ruby will be “overrun by php users”

haha yeap, and they shouldn’t beyond an extent, I mean they’re the people who are using the language constantly, so they have the best idea of what it does and does not make sense to turn into shortcuts
caffinated haha yeah I could see that, because ruby on rails lets you knock out a lot of code very effeciently once you’re used to it
so as ruby becomes more widely available I’m sure a lot of php users will switch over

well, also, if you go from rubyconf to railsconf, people at rubyconf have a disdain for the people at railsconf .. even though it’s a lot of the same speakers
some hardcore eliltism there

caffinated really? I didn’t realize there was hostility in the ruby community like that, as powerful as ruby on rails is I would have thought the ruby people would be all over it
“hey cool I can knock out badass MVC websites using ruby code.. sweet!”

well, people at rubyconf are interested in the language, and some see rails as a gateway to let idiots in.

I don’t see why they wouldn’t like having that tied into their language
caffinated well anytime a language gets to the point that you have really cool features that can be easily used, you get a certain amount of hype from people who actually know how to use it and love it, so then you get a lot of idiots switching over
thats just part of the internet tho, eventually you can’t hold the idiots back

oh, it’s just like linux power users wanting to keep linux complicated so the newbies don’t pick it up.
it’s kind of sad, actually

Every tier of society has to have another tier to look down on, to feel better about themselves.

what is a registered, but unused domain name worth? like if i want to make an offer on it?

person Y want item X to be popular enough that you can do it as your job, fulltime. but in the same token they don’t want it so popular that idiots use it. however, that sort of adoption is in person Y’s _best interest_

caffinated haha well I do agree with that to a certain extent, to be honest I don’t really like the current state of linux distros, ubuntu rocks and has a lot of cool features, but its become bloated and unreliable, I’m not much of a fan of suse or redhat or mandrake, slack is cool but I would
rather just run freebsd, and my old distro of choice, debian, has been overshadowed by ubuntu, so there isn’t really a distro I like that much right now

right. which is why there will be another one some time in the future to further add to the confusion.

I love fluxbox, and I played around with getting fluxbox working with ubuntu, but all of the cool ubuntu apps require tons of gnome or kde libraries, defeating the purpose of having a lightweight WM like fluxbox

i hate how fragmented linux is.

caffinated, it hates you too.

well, distros are i should say

:P

caffinated yeah no kidding, its becoming a serious issue

no its not.

distros? they sure are.

theres like 4 different MAIN Distros. and they’re similar enough

to be honest, I’ve switched over to OSX with my macbook, and I use freebsd/openbsd for my servers now

hi aain

i swear, i’ve screwed up so many times on this batch i probably couldve done it manually by now

andre_pl they don’t have many similarities, they all have different package management systems, they have different directory trees, they have different base applications, etc etc. Linux distros are getting farther and farther apart rather than becoming more standardized

similar enough to you.

extracting all images from a dll, renaming them in order, removing every 4 starting from 2, renaming them to (style)(color) then converting to transparent png

if they were “similar enough” i should just be able to install a package on any machine with minimal hassle using any packaging format i like.

what would you name a variable that stores either ‘ASC’ or ‘DESC’?

caffinated, i can install rpms on debian, thats good enough for me
`cb, $sort_order

yeah, good enough for you

yeah but installing rpms on debian just makes me want to stab myself in the eye
I hate rpms, they are evil

order… hmmm
good enough

downloading and installing .exe’s is worse. who wants to click through all that crap… and then having to google for your software and downloading it fro a wbe page.
thats so old shcool

to be honest I would rather download and install an exe than an rpm

ever use apt-get or yum ?

because at least the exe comes with everything it needs, shit rpms are just a trail of installing random rpms

apt-get install [package]
gg

yeah i’m not going to argue that rpms are total crap.

I love apt-get, I try to avoid yum as its slow and fills my screen up with downloaded header messages

they’re terrible, but i’d still rather just have to type one or 2 commands to install something hten google, download, unzip etc.

`cb I’m just saying I hate rpms, you should use a package management system
but overall my favorite package management system is freebsd’s ports tree

yeaaah, im not really interested in compiling and whatnot

I really liked gentoo
’s portage
just got sick of compule times.

mac spoiled me D:

I have an array with a bunch of ID’s in it. Is there a way I can run a query with the WHERE statement matching *ANY* of the ID’s within that array?

¿?
lols

IN ()

`cb I like it for servers because then you are always right there to change the make files to what you need

implode to a comma sep string first

SELECT * FROM table_name WHERE id IN(2,4,5,,8,12,43);
err, ignore the double comma above

oh! nice… thanks guys :-)

after the intel switch I love apple, my macbook is by far my favorite laptop I have ever used

exactly

Anybody know of any places that you can submit your database structure too and a database architect will take a look and give their feedback?

Is there a way to pull data from a pdf with a php script

yeah right here, but I charge $50 an hour

depends on the PDF

And I love my Vaio’s keyboard that people keep thinking was an Apple thing, when Apple really just lifted the idea from the Vaio X505.

$50/hr is all?

chewy.. I’d be willing to pay that

`cb, What am I looking at for issues? What matters?

As long as you can guarentee it won’t exceed X amount of hours

takes balls to buy a sony product now-a-days

run your queries with EXPLAIN too. helps you optimize the,
..the structure a bit

In PHP regexps, escaping just a space (and not any whitespace as with \s) is just backslash space, right?

Thecks well the amount of time it takes is completely dependent on the complexity of your db, but I can give you a rough estimate

`cb: Oh, hell no. I’ll never buy a different brand laptop. My first Vaio lasted 5 years, I beat the crap out of it. Second one survived two liquid attacks before finally giving in.

Anyone use PHPGTK here?

`cb: They does not screw around when they build a solid product.

http://www.devshed.com/c/a/MySQL/MySQL-Optimization-part-1/2/

all i know is the last few dvd players, tvs, and other assorted stuff have been pretty crappy

i use it quite abit, but not enough to be able to help anyone

mattmcc, I believe they’re one of the few companies that actually have a laptop factory too

`cb: Ah, yeah. That stuff is virtually a different company.

Can I specify character set for file functions (like require, fopen). I mean the charset that is used to encode file names, not the content. I ask because I’ve problem with filenames with non-ASCII letters (I use UTF-8 in my script, but filenames are [probably] encoded in windows
encoding).

Just play around with it or?

nah, just my apps end up sucking :P

craigbass1976 I had a buddy who parsed pdfs using ruby and he was able to get a text dump and regex the data out of pdfs that were locked, I don’t remember what he was using to get the data out of the pdfs tho

Indeed. Gateways and HPs are all outsourced, iirc, along with most Dells.

All dells

:P , I was just wondering if it would be worth learning and playing around with it. Obviously I wouldn’t be building any large scale app with it :-p

I was amused a couple years ago when Gateway & Dell had a line of laptop that were completely identical.

they might throw hard drives and more ram, but they dont’ make anything

yeah, but it’s 5mb and open source if you want to distribute it

These days they try harder to have slightly different offerings, so that you can’t make apples-apples comparisons.

does anyone have a function that will strip all special characters from a variable?

ahh

because magic quotes is broken
the thing is

I probably won’t learn it, most likely end up learning C++ or Python.

I only want/need letters and numbers from any input from the user anyway

special characters for HTML or for insertion into a SQL query or wat

DARKGirl, html_strip_special_chars I think

mattmcc, http://gen-x-pc.com/laptopmanu.htm
there is also a chart somewhere I saw of who buys from who

…are you sure that function is not broken?
because they told me that I would be better writing my own

html_strip_special_chars() is non-existant

right now I use “mysql_real_escape_string”
but they said that is not fool-proof

Damn/.

mysqL_real_escape_string is fine, so long as you check for magic_quotes first
otherwise you can get some nasty things like \\\\\\\\\\\\\\\\\\\\\\\\’ appearing in your content

Heh
are you doing something like user registration?

thats right

and you awnt to restrict to like alphanumeric?

are there any special characters that are not dangerous?

ah… if you only want to allow certain characters, validate against regex
for passwords, just hash, and allow whatever characters they want

ctype_alnum checks for alphanumeric, returns true if yes, returns false if special characters.
http://us2.php.net/manual/en/function.ctype-alnum.php

oh, I dont strip the passwords, because they are immediately MD5′d

PHP-WTF: http://rafb.net/p/YDiIVc43.html

nice !

holy crap

heh that function is not really helpful because I am looking for something to strip the chars, not just check if something is there

oh ok. sorry.

please tell me what’s wrong with this code? http://pastebin.ca/669727

DARKGirl what chars are you trying to strip?

if you strip, and do not warn, they will not be able to log in

its should be returning “img there” because the $_SESSION['profimg'] session is set

and you will be accused of releasing a broken product D:

`cb: haha, fnny

it’s set to show img there if the session is NOT set.

well I am stripping any user input fields before I actually process them

stripping them of what?

doh! thanks

:P

that said, usernames can only be alpha-numeric

how can you validate them if you strip them beforehand?

what about preg_replace(array(‘a’,'b’,'c’,'etc’),array(”,”,”,”,”), $input)

How to get know which encoding filenames are in?

also, not sure if your a fan but, check out ‘Terany Operator’.

never heard of it

= ? : ;
3

`cb: how? well they are not allowed to create usernames with special characters anyway

ternary yay!

yeah ternary operators are good times

so, if they try to create one, make it fail validation, so they can change it

except php is kind of weird when dealing with nested ternary operators

http://us2.php.net/operators.comparison

don’t change it for them

do you mean ternary?

Magic quotes is not dependable and many shared hosting servers do not allow users to use ini_set

sorry, thought that’s what i put :-p

i don’t nest ternary in php

what does it do?

`cb: that is already in place

`cb yeah neither do I, I always have issues with it

i try not to nest ternary in anything really
so whats the problem?

http://us2.php.net/operators.comparison Check out the heading Ternary Operator

thanks

i was just wondering if thats all I needed

I like to use them in sprintfs when you don’t want several levels of if statements

Im having real trouble with conditional tags, anyone see anything which looks wrong? http://www.nomorepasting.com/getpaste.php?pasteid=2985

does a session end when you close your browser window?

It usually does
you can specify the settings in php.ini
or using the session functions in php

by default I mean

default is kinda vague, depends on your distro’s default settings
butt, usually yes

hehe you said butt

hehe

It was meant more of a but….
should have used …

distro?

butt distro… I like it!!!

distro refers to your distribution of linux. Many distributions come with php bundled by default and have their own settings
depends

hmmm
’cause I’m setting a session variable in a page that I haven’t gone to yet, but its showing that variable form the previous session I was in
how do I delete a session variable then?

unset
the variable

it would be easier if it deleted when I closed my browser window….

wouldn’t it?
so, set it

can I do that?

yes

go on…

you can do anything you put your mind to

lol

use google man
come on
why do I have to spoonfeed you
just google php + setting session properties
something along those lines

that is the purpose of a session
it carries over to pages you haven’t gone to yet
if you have previous sessions, perhaps a call to session_destroy() might help you

thanks

closing the window won’t do anything, you need to quit the browser

want to empty your session data, simply perform $_SESSION = array ();

yeah, also what sean` said

thanks

hmmm… anyone see why preg_match(‘/^CREATE TABLE (\[dbo\]\.)?\[([A-Za-z]+)\] \(/’, $line, $matches) isn’t matching CREATE TABLE [dbo].[CC] (

`cb, what if it’s the last window of the browser :p

so if someone forgets to logout, it will clear the date

swimrr, if you forget to remove the session data, it will stay as long as its ment to be there

its failing on the [dbo].

sean`: if you are using Winblows, it quits
but not on mac

`cb, I stand corrected :p 50% at least :P

I can match create tables with the [dbo]. but I’m failing on any that have it

swimrr, assuming there isn’t anything else that interferes, like emptying the local cookie data

hmmm

sorry it matches any without [dbo]. but it fails with them

eh

any ideas?

my regex method is the ‘trial and error’ method

hmmm – right now, if I log in as one user…then go to the site again, log in as user2 – it keeps some of the session data from user1

you aren’t cleaning sessions on logout?
are you using cookies or session saving extensions / addons?

‘cb – that’s just it, what if they don’t logout?
they just leave it there?
you know how users can be

session eventually timeout

oh….
okay

ok this is starting to irritate me, any ideas on this guys?

how long?

hmmm… anyone see why preg_match(‘/^CREATE TABLE (\[dbo\]\.)?\[([A-Za-z]+)\] \(/’, $line, $matches) isn’t matching CREATE TABLE [dbo].[CC] (

variable, depending upon server
you can set in php.ini iirc

thanks

or more specifically why (\[dbo\]\.) doesn’t match [dbo].

it should match just fine

hehe yeah thats what I thought too, but I’ve got empirical evidence to the contrary

you’ve peaked my interest

Check your variable I guess.

piqued

I can match CREATE TABLEs without the [dbo]. but it fails on any that have it

chewy, whats up

why are you regex’ing on that string?

http://pastebin.ca/669748 – when I ran that on my localhost, it echo’d true.

I’m trying to use preg_match(‘/^CREATE TABLE (\[dbo\]\.)?\[([A-Za-z]+)\] \(/’, $line, $matches)

why?

CREATE TABLE [dbo].[CC]

chewy, strpos (‘create table [dbo]‘, $string)

JymmmEMC because I’m trying to write a converter from mssql create table sql files to mysql

oh, duh

sean` well the regex matches any create tables that don’t have the [dbo]. in them

chewy, so.. your point?
You’re telling me you can’t achieve this with strpos?
strpos ($string, ‘create table [dbo]‘) * mixed them up

I’m sure there is a lot of ways to do it, but a regex works just fine as long as I figure out whatever syntax error is there

chewy, it doesn’t seem to work.. so why don’t you go for the approach that will work 100%?

lol

silly

sometimes I wish PHP/RegEx were explosives…. one lil mistake and no more problems.

chewy, I’m not saying you should not investigate the error i fyou’re interested, but why let it stop your work.. continue with your work and think about it some other day, maybe when your mind’s a bit more clear

well first off, I like regex more than strpos, second off its more convenient, 3rd off it should work 100% of the time

lol @ jymmy

because I need this working right now

what Sean said

heh

then use string functions
try your hand at regex when you have learned how
!+mre

http://www.weitz.de/regex-coach/, or http://www.ilovejackdaniels.com/regular_expressions_cheat_sheet.png

heres the thing, I don’t want to rewrite this using somethign less useful and less convenient because theres a stupid syntax error, thats a lame way of quiting

chewy, so.. I like a 100$ bill more than a 50$, but if you hand me 2 50’s I’m not gonna say no cause they aren’t 100’s

hahahaha yeah you’re right I don’t know any regex
I think you don’t know any regex if you’re idea to fix that is to stop using regex and automatically assume I’m some random noob who knows nothing about regex

So you want to TRUST something that you are not 100% proficiant with?

yes as a matter of fact I do

chewy, we aren’t assuming you’re some random noob, nor are we assuming you don’t know regex (however you just told us)

http://dev.ngisedesign.com/test.phps
chewy:

because I write regex all the time, and I would say I’m at least 72% regex proficient

We’re just giving you a feasable and easy to integrate solution


FIGHT

Usaing regex as a “cure all” is not the right approach, lots of overhead, use the right tool for the job,no more, no less.

chewy, is your ego that big, that us helping you upsets you?

chewy, i think you are high, cuz it works fine on my box

I’m not looking for an alternative solution, I’m looking to know why the fuck (\[dbo\]\.) doesn’t match [dbo]

chewy, watch the language -.-
Anyway, good luck, I’ve got better things to do

then stop trying to tell me I’m a noob regex tool trying to use a grenade to blow my foot off because I have a subtle error in my regex
this is a rather simple regex that isn’t working

chewy, stop saying stuff that hasn’t been said

if it was a subtle error and you know what you’re doing, then why have you asked repeatly in here?

because I am not subtle today, I’m exhausted, overworked and I have to work tomorrow on my day off
you want to see some fun regex? :%s/\($this-\([a-z]\+\)Values.*\)\@=\($indexed\[[0-9]\+\]\) \/\*\([a-zA-Z0-9_]\+\*\)\*\//$this-getFeats(\3, ‘\4′, ‘\2′) \/*\4*\//g thats some vim regex I wrote this week

and your point is?

haha

DAMN, you’ve really got some issues

chewy use www.regexpal.com

http://dev.ngisedesign.com/test.php // http://dev.ngisedesign.com/test.phps

it’s a great tool and helps with testing

nothing wrong w/ that regex

JymmmEMC I’ve already made my point, and my point being it doesn’t work, but we’re way past that now

There are more ways to rome, remember that

Does anyone see why this is returning 0? http://pasteosaurus.com/415

!+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

JymmmEMC what have you contributed to this conversation? you’ve done nothing but tell me to rebuild what I’ve already built and that I don’t know what I’m doing… you said what you’ve had to said and you keep reiterating that you’re just trolling
because I’ve already said several times before that it failes on [dbo].

!+go

it doesn’t

but whatever, I’ll figure it out

[GO] Gross Overgeneralization. Everything that we tell you in ##PHP is what we consider “best practices”. Of course, only YOU know your own requirements, so you may feel you need to do something we told you not to. Just don’t say we didn’t warn you.

lay off the pipe, sir

hey, thats a nice one
@ GO

hahah yes because OMG STAY AWAY FROM REGEX NOOB is your official best practice

chewy, who in here actually called you a noob?

using php native functions is good practice

JymmmEMC

I call em, as I see em.

haha yeah and you’ve established that you have 123/89 vision
get your eyes checked

chewy: So you want to TRUST something that you are not 100% proficiant with?

-.-

arguing about this issue won’t solve your problem

yes because no one is 100% proficient with anything

you must realize you’re in an IRC room and nobody’s perfect

chewy, we are actually giving you a better, faster and easier way of achieving your goal..

so, let’s try to solve your problem

ASnyde1, liar!

lol

what sean` said

and you can then decide to take our advice or not. That’s your decision. But realize that you’re coming into a room of strangers that are willing to help you.

Jymmm, wish me luck

it’s best to not create enemies

hey guys what do you think of this idea? http://www.doctorrescue.com/

I just turned 21 and tonight’s the night my work buddies take me out
I may not survive, but my IRC connection will

pregnant? (You, not your female half)

InuZ|afk thanks for the help, I know its matching on some, but not all of them

Ah, well congrats. GOT BAIL MONEY?

wtf…. is that english?

sorry

i forgot to update my nick

Jymmm, got bail money + my medical insurance card on me

sorry I’m not trying to be argumentative guys, I just got a little irritated when you guys told me my method is flawed, that I’m not the master regex master of the world, and that you’re alternative solutions are strictly better despite the fact that you don’t know what I’m trying to
accomplish

In an envelope in my pocket, labeled “In case of emergency, tear here”

lol\

chewy, you are trying to check if a string does NOT contain your string

you obviously dont want our help, so………

no no yoou can’t bail yourself out, someone else has to

and we’ve given you a solution for that using strpos

one of the key things I’m using preg_match for is to get the matches array, because I’m not just checking the string, but I need to parse the string

Is it next to the Pocket Shot?

Oops
Yeah.. I have three priorities tonight, in order:

and I have several other working regexes covering the rest of the code

sean`: ^ at the beginning of a regex marks begnning of the astring

1) keep my clothes on 2) do not make passes at female (or male) co-workers 3) do not throw up all over the bar

`cb, I am not looking at the regex, but at what he said

ah

sean` no what I’m trying to do is parse every line of a file, divide it up into distinct cases that give me different data from each line so I can rebuild it

Bad Boys Bail Bonds – Because Your Mama Wants You Home 1-800-BAIL-OUT
http://www.badboysbailbonds.com/html/index.html

chewy, and what do you want to achieve with regex?

Expect to throw up, just also expect photos to be posted at work too

Julian|Work, YOUTUBE :P

Order a Cadillac Margarita, on the rocks, with salt

JymmmEMC, just drinjk 15 tequillas, works good fo rme
some mix-drinks, and the perfect night is almost there

sean` what do you mean? I’m using regex to classify each line and then pull the desired data out of that line

sean`: http://www.drinksmixer.com/drink7393.html
sean`: a href=”http://www.drinksmixer.com/drink7393.html”http://www.drinksmixer.com/drink7393.html/a
Ok seriously…. Do NOT mix alcohol, stay with one type, run, vodka, tequilia, wine, etc. A beer in there is okey. Avoid eating sweets too.

chewy, and what do you want to extract from create table lines?

sean` bah I figured it out, give me 2 mins and I’ll show you what I’m up to

good to hear

Jymmm, that’s good advice, but may be hard, since people will be buying me drinks
I’ll wear a shirt that says “VODKA ONLY” or something

2 asprin + a glass of milk before you begin.

Darker liquors and drinks that taste like candy will be particularly bad combinations.
And food. Eat stuff.

Yeah, I’m picking up some bready food on the way

heavy stuff, chili, burger, etc
mexican food will be the best
the hot sauce will sweat out the alcohol too

But the worst coming up, hah
Alright, it’s time to go

HAPPY BIRTHDAY!!!

I’d say, have a good day and happy birthday Julian|Work

Thanks guys, take care
I’ll report back one day

I’ll watch the newspaper in the morning for ya

‘one day’ :p

!pastebin

Close enough

ok here you guys go
http://hashphp.org/pastebin?pid=27526
thats why I was using regex
so I’m curious if you guys still don’t think regex was the viable solution for that

i am having a little trouble with escaping characters in php, I have a textarea which posts its contents to a php script which escapes it with the mysql_real_escape_string and then puts it in a database, another page then retrieves it with a SELECT mysql_query and then directly puts its value
inside a textarea

my problem is that a single quote will come out the other side as a \’ in the textarea, what did I do wrong?

I think its getting escaped twice
often the server automatically does addslashes() and stripslashes() without you knowing

[fields], that was my thought too, but its not… i have checked so many times

gpc_magic_quotes is off?

I need some desperate help, can someone private chat me to help debug a PHP script?

either way, throw a stripslashes before outputting to your textarea and the problem is gone

[fields], just to clarify mysql_real_escape_string will only put one \ in front of a ‘ and that is not actually stored in the database, it just makes sure that the ‘ is stored in there right….? am I right?

sure
I don’t know. I haven’t needed to use mysql_real_escape_string

[fields], havent needed to use it? im curious how that is….

You REALLY don’t want me to answer that.

I remember the days of php3 where I needed to addslashes() and stripslashes() on just about everything

JymmmEMC no actually I do, you have a more effecient method to perform that same task?

I’m having a bit of problem with this PHP script:
http://pastebin.com/m4056d0a0
Can anyone tell me how to make my server show the error message?

which one, ragon?

well, i really dont want to just strip out backslashes…. there has to be a reason for this, does mysql_query() or mysql_fetch_array() escape characters…?

never mind, it was set to report all error messages
Can anyone debug this script anyway? http://pastebin.com/m4056d0a0

on post it happens

Ragon_, if ($check != “FALSE”); is a bad statement
use if (!$check) or if ($check !== FALSE) instead

[fields], so posting data will escape it?

yep

err. use if (!$check) or if ($check == FALSE) instead

[fields], on the clientside or the serverside?…

serverside
thats why you’re getting doubled

[fields], you’re sure?

dude… test it for yourself for proof

[fields], so, is it php that does it or apache?…

I think its php
yeah, its php

[fields], just a general escaping… or one specifically for mysql?

every server I’ve used since 2001 automatically escapes post data

[fields], perhaps i should turn it off. ill look it up online, do you know if there is a name for this feature?

see, before that, you had to addslashes() to every single damn variable, oh that was time consuming
gpc_magic_quotes

i see
interesting
so, i really dont need to be using mysql_real_escape_string to all my input then….

exactly!
but if you must…
then use stripslashes() too

odd, i was just always taught to totally distrust input, but if php pre-escapes it then…
huh

you’re gonna love it when magic quotes is removed :P

haha

It dies in PHP6

InuZ|afk, probably good

i cant wait

i’m using php5

you in france?

means you don’t have to do stripslashes on all input at least

think I should disable it in php.ini then, i assume i can?

In the UK

magic quotes is a good thing. Its real annoying to addslashes() on all your input before putting in the database and stripslashes() on all your database queries/variables
but if you want to, have fun
reminds me of 1999
party like its 1999

technically, it’s not. addslashes doesn’t always do the same thing as mysql_real_function name I forget.. afaik anyway.
so depending on the DB type you’re gonna use, you’d have to use stripslashes first anyway

mysql_real_escape_string

yeal, that thing. that function name bugs me I wish it’d just been mysql_hawt_escapage or something. oh wells.

InuZ|afk thanks for the help a while back, sorry I couldn’t reply as I don’t have a registered nick, so I can’t send private messages

i dont understand stip slashes, why would I use that?

oh really? forgot about that. glad you got it all working anyway

yeah it was a stupid little error, I was missing an _ in one of my character classes

ah

i want to just get the raw exact data from the post, and then use it, if i am going to use it in a mysql query, i want to use mysql_real_escape_string before using it in the query, then when I retrieve the string, it should be exactly the way it was before the mysql_real_escape_string…
right?

but hey, now I have a script to convert mssql sql files into mysql sql files
_Quintus_ yes the data should come out of the db without the extra escapes

chewy, so it sounds like i want to disable gpc_magic_quotes in php.ini and then use it the way I have been using it, with mysql_real_escape_string… does that sound right?

Anyone know of a way to discover the tablename of a particular query from a mysqli_result object? Don’t suppose it’d be possible, eh?

fieldnames yes.. table name.. don’t think so

I’m not too sure, I haven’t use magic quotes that much, but as long as you do any escapes before you run mysql_real_escape_string then mysql should handle it just fine

darn. thanks anyhow.

or sorry, if you _don’t_ do any escapes, and only do mysql_real_escape_string you should get the data out fine, but if you escape it before mysql escape you’ll get things like foo\\\\\\\\\’bar and that won’t come out of the db properly

So… I guess it’s not possible to override magic_quotes_gpc on a shared hosting server (not my own), am I right?

might be, htaccess php_flags I think it’s called

Most likely not. You can simply undo its effects, however, with stripslashes and get_magic_quotes_gpc.

if you have permissions to change php.ini you can probably change it with ini_set

No, it’s too late by the time ini_set is seen.

mattmcc so you can’t change that on the fly?

you can override any of those server settings with .htaccess

From within a script? No.
Magic quotes has already been applied (If it’s on) by the time your script is executed.

[fields]: how often does a hoster allow that, though?
I can try it, but I’m assuming my hoster won’t allow such a thing.

mattmcc ahhh ok, yeah I haven’t played with magic_quotes much, but I have used ini_set fairly often to change other ini settings

I don’t see why a host would disallow .htaccess

Not htaccess in general, but allowing to edit php settings.

matmcc, chewy, ah ok. So stripslashes is used to just undo gpc_magic_quotes on servers where people dont have access to their php.ini, but for a dedicated machine its fine just to disable gpc_magic_quotes?

[fields] its pretty common to disallow both, or at least that you have to get htaccess enabled by your host

If you can disable it, by all means do so.
If you can’t, then naturally you’re stuck just undoing its effects.

if you run phpinfo() you’ll see there’s two columns, one server side (php.ini) the other is local (optional .htaccess modified)

mattmcc, ok, thanks for the help!

Is Perl a dependency for pHP?
PHP*

don’t think so

Hm. FreeBSD ports seems to think so.

Why would it be?

Not sure.
B-deps: autoconf-2.59_3 autoconf-wrapper-20070404 libiconv-1.9.2_2 libxml2-2.6.29 m4-1.4.9 perl-5.8.8 pkg-config-0.22

Hm, magic_quotes_gpc says Off On now, but it still adds slashes. Does that mean it failed?

that would be funny if php runs all its pregs through perl
but if it did, then you would be able to do non fixed with lookbacks, so I don’t know what perl is required for
s/with/width/

It’d make them more functional.. PCRE doesn’t have quite everything.

yeah that would be helpful

What is the ‘Suhosin protection system’?

Do you think its worth taking courses to get the qualification for Project management.. Its not a case of learning the stuff but getting the qualification.

Nevermind, got it.
http://www.freshports.org/security/php-suhosin

bloop

I’m building a newsletter sending system. When an admin clicks “Send,” the PHP script will send to perhaps thousands of addresses… we want to send to a set number of addresses (say, 200), then sleep for two minutes so the server doesn’t melt
how can I impliment this without having the user wait for the page to finish loading after the entire queue is run?
I was thinking I would fork another process and run it from there… but process working in web apps is bad

use a cron job
also make sure you don’t send 200 message all at teh same time

in other words, put the messages in a queue then have a cron job process the queue?
how can I ensure I’m not sending 200 at a time? I guess I’d foreach through the queue and run mail() for each?

I think there is a sleep command
http://php.net/sleep

yes, I was going to use that… but you said not to send 200 at once, which is what I’m processing each iteration (after each sleep)
yea

well, what I was trying to say, don’t try to send 200 mail messages as fast as possible

oh, yeah :-)

also do a MX lookup for each domain and make sure you don’t spam one mail server with 200 messages/minute
so you spread that a bit

ohh, good idea

fopen(‘./’$user’.txt’, “a”);

no

is that what the manual says?

No

fopen(‘/.’.$user.’.txt’,”a”);

Thank you

read about the concatentation operator

Sorry I am new to PHP

that’s what the manual’s for

php3333

why not fopen(“/.{$user}.txt”,”a”);
Not sure what path you are actually trying to use…

./myusername.txt
Thats the path

Why use files for users? MySql is the best 333

why is mysql if you can use files

Except I need to use txt files, my sistuation is a bit tricky
And now… Parse error: syntax error, unexpected T_STRING in register.php on line 28

Comments off

Hey everyone — Ive got a question Ive two tables Im working with in mysql using PHP as the backend When I add

do a SHOW SESSION STATUS before and after the query and substract the values

thx
a common question I see :P

Is there a way in mysql 5.0 to apply an SQL statement based on the results of anohter sql statement? Like for instance…. I want to get a list of users in my system, and foreach user, Insert a record in another table with that user’s ID. Is this
possible?

!man insert select

see http://dev.mysql.com/doc/refman/5.0/en/insert-select.html

thanks

tag team

You set ‘em up…

i assume that was for me?

yes

show session status gives me a syntax error on mysql hosting 4.1.14

4.1.14 is … ooooold
do yourself a favour and think about going to the latest 4.1.x or even upgrade to 5.0

4.1.14 is what dreamhost has installed

hmm, k
is this mysql-server all yours ?
perhaps SHOW STATUS is good enough here

no, shared host

I can use sql variables in stored-fucntions right? like: select @var := field…. ?

the host is shared, but is it also a shared host mysql instance ?
yes

hrm

i think it’s a shared instance, is there a way to tell if i don’t have access to the machine the server is running on?

ahem. totally off topic: is there an IRC channel for Microsoft access?

keep in mind that @var is connection wide

so hypothetically, I could do ……… INSERT INTO user_permission (user.id, 20) SELECT user.id FROM user
does that look right?

[[thufir]]: check msdn.microsft.com

INSERT INTO user_permission SELECT user.id, 20 FROM user

weigon_ thanks

where 20 would be some permission ID

Firefox can’t find the server host at msdn.microsft.com.

so even if 20 is a hard coded number, it would go like that as part of the select statement?

yep

I’m trying to create this functio: http://paste-it.net/2909 but I get: error near http://paste-it.net/2909
hmm…

ok cool Ill try it out

‘DECIMAL(20,2)’ at line 5

thx for your help

come on, take your time to try to solve your problems alone first
[[thufir]]: take a minute to read the domain name

sorry… it’s probably a tiny problem…

what is the trick for concatenating the results of two queries into one result set? SELECT … UNION SELECT … ?

they moved it, it’s like msdn2 now. got it.

that’s it.

excellent snoyes, thank you

can you please have a look; i’m following the documentation, but can’t figure out what I’m doing wrong: http://paste-it.net/2909

this method didnt worked

Which of the three on the page did you try?
I find the last one, starting “Alternatively, on any platform,” to be the simplest and most reliable.

both
the init didnt gaved no error but still I cant log in
and –skip-grant-tables –user=root gives error:

alright .. spatial indexes are nice — but why didn’t my query work?

mysqld –skip-grant-tables –user=root
9 [Warning] Ignoring user change to ‘root’ because the user was set to ‘mysql’ earlier on the command
ok the second linux option works.

could you please have a look at this? : http://paste-it.net/2910

still error near DECIMAL(20, 2)?

arrrgh. i surrender. how do i optimize this query? http://pastebin.ca/625168

looks like the derived table from the subquery has 20k rows

hah yep

What’s the subquery supposed to do, that you can’t do in the outer query?

whats is the question you are trying to answer with that query?

do you know what the problem is with that decimal() ?

Did you change the delimiter away from ;
Aye, I think that’s it. DELIMITER //

iratik, in the given date range, i want the number of unique phone numbers that exist in the database for that particular location.
(the ‘00000000′ is just a way of saying “from the beginning of history”.)

SELECT COUNT(DISTINCT area_code, phone_num) FROM orders_p WHERE ord_date… AND store_num = 1;

there you go
he’s quick
alright… i have a problem — its kind of a mysql problem — its kind of a ruby problem …http://pastie.caboo.se/79981 — more of a mysql thing … about a spatial query

And the problem is?

well.. it doesn’t pull up the closest location

How far apart are these locations typically?

ummm.. like every 10-20 miles
i mean… however far cities usually are from each other

did you mean that “delimiter” for me?

greatest circle calculations are overkill for such small distances. the pythagorean therom is plenty close enough.
yes

i’m getting a syntax error on that. do i need a particular version to be able to use distinct in that context? server is currently 4.1.

I’m using that

When I set my delimiter back to ;, I get the error you report. When I change it to //, no error.
Did you cut and paste? You’re supposed to fill in the … with the relevant bit.

hi i seriously need someone’s help
it’s so simple
please message me

We only do the non-serious help here.

im on the brink of insanity

It says so right in the topic.

i didn’t cut and paste, but i did hack up the existing query accordingly. let me take the cut ‘n paste approach.

really?

i just need help with sql host and c$

really

i just want to know how to display a database link object on asp?

Which client are you using?

what are you talking about?

http://www.15seconds.com/issue/050210.htm – does that help?

a query?

yes
link object from a access database

phpmyadmin

Ah. Don’t.

what do you use?
the mysql client?

i guess i did something goofy. cut ‘n paste worked. it’s not much faster though.

the command line client, or sql yog, or query browser
Let’s see the EXPLAIN of the query now.

Ok a quick question, I have one site (LAMP) and will be moving to a new site. what is the best method for switching server while still live ?

http://pastebin.ca/625193
there’s the new explain.

I’d expect that to be a lot faster than the one you showed before.

that query had nothing about great circle distance in it
picture i had a database of peoples ages and weights … (name,age,weight)

i’d have thought so too. (i hadn’t really thought of using DISTINCT in that context.) on the plus side, at least i now know there’s some cruft in the table that needs to be cleaned out.

Hey guys I keep getting “#1075 – Incorrect table definition; there can be only one auto column and it must be defined as a key “

it’s strange because I added other functions usin gphpmyadmin

Anyone know why this is?

yes, it’s because there can only be one auto column, and it must be defined as a key.

http://pastebin.ca/625194

How do Idefine it as a key?
‘_’

`user_id` TINYINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, is the most common

Yeah.. but how do I define it as a key?

I just told you.

I event get an error when inserting it using the query browser

i know someone named john is 21 and weight 160 …. so to find a person whos closest to a given age 21 and weight 160 (that should be john)… i would do select name from people order by age-21 asc, weight-160 asc limit 1; should pull up john.. but it pulls up chris ……not an exact
equivalent example — but thats basically whats wrong

Using a resultset tab, or a script tab?

I used the above input area

not enough info. how busy is the site? what is the network bandwidth between the servers? how important (ie valuable) is a few minutes downtime? etc.

I think you need an absolute value on those differences in the order by. -3000 is smaller than 1

absolute value of the whole thing — or absolute value of the longitude
or latitude

this is what I get http://paste-it.net/2911

File-New Script Tab, then do it there (with the delimiter change)

I’m so confused e_e

of the difference.
line 2 of your paste – add PRIMARY KEY to the end as shown.

thanks — i’ll try that real quick

Yar har har Igots it!

Hi, can i traceback on mysql when a database was created, if it was done very recently /

You could look at the ctime of the directory in the datadir, or check the binary log if that’s enabled.

stat the directory,

ok thanks

hmm I think the error reports of mysql are incorrect
it definitely not the DECLARE DECIMAL thing

You could try changing that to SELECT field INTO @var style.

yeah that’s probably the problem
but how?
like select into?

just like that. Instead of SELECT @var := x, use SELECT x INTO @var
http://dev.mysql.com/doc/refman/5.0/en/select-into-statement.html

so I need to declare them?

no, you can use the user variables like you have.
SELECT a, b, c INTO @x, @y, @z

I want to design web access to my personal mp3 collection… where I can both stream a lowfi version of each album or download a higherquality version of the song. Has anyone seen a tutorial on doing this type of thing in mysql?

hmm nope doesnt work either

thanks.. thats abs thing works great

damn you shot me down
you would just put links to the music in the database though correct, pointing to some place on your hardrive…. it’s not like you’d but whole mp3 files into the table? (I’m new to sql, trying to do it with ruby on rails)

try to avoid storing files in db generally. path/filename

whitespace is nog important in procedures or is it?

depends where it is. typically not.

is there a way to sort by the most common values?

field

ORDER BY FIELD( country, ‘US’, ‘Canada’, country ), country; // This will order the list by placing the US first, Canada as second, and the other countries in alphabetical order

or, ORDER BY COUNT(*) DESC, if you don’t know what they are.

but the most common entries will be first?

anyone familiar with mytop? i’m wondering if its showing all the activity on the server or just the database i’m looking at?

that’s what the DESC is for. That assumes you’re using some GROUP BY.

group by goes before or after

group by before order by
except after c, or when sounding like ‘A’
which makes for some weird science.

thanks
another question
is there a way to do a where when I need to match anything in a column?
like
I have clients, which have jobs
and the jobs have files
I need to search all files from jobs owned by x client
make any sense?

its really strange, see this: http://paste-it.net/2912

why do i get this error? http://mysql.pastebin.com/m8d1893f

SELECT files FROM jobs JOIN clients ON jobs.clientId = clients.id WHERE clients.name = ‘x’;
because DATE() was added in 4.1
syntax is SELECT a, b, c INTO @x, @y, @z.
not SELECT a INTO @x, b INTO @y

ah.. but than I can’t do my calculations as I did before

why not?

should ‘comany_name’ be ‘company_name’?

SELECT get_item(), get_products() INTO @house, @price
You either need to upgrade MySQL, or use the DATE_FORMAT() function instead.

the files are in a table by themselves

you chose an alias name that is the same as the field name?

or LEFT(quote_date, 10)

sorry I didn’t give you enough information
the Files have JobId references, the Jobs have ClientId references

thanks!

SELECT Files.* FROM files JOIN jobs USING (jobId) JOIN clients USING (clientId) WHERE clients.name = ‘x’;
er, pardon my odd capitalization. Keep the table name case consistent throughout.

wow you are fast
this is a backup table so I’m trying to find variable files
your a big help

pastebin

http://pastebin.mysql-es.org

What’s a variable file?

can I get a recommendation on a good book or website to learn about database design

files that change alot and therefore get backed up alot

book

http://www.kitebird.com/mysql-book

normalization

http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html and http://datamodel.org/NormalizationRules.html and http://mysqldump.azundris.com/archives/20-Nermalisation.html and some here http://www.keithjbrown.co.uk/vworks/mysql/

thank you very much

how do i know how much space my db is taking up? and how much space i have available on the server for my database?

when I did a select x,y int @x, @y; can I than do: reslut = @x + @y ?

not in the same statement, but on a later line, yes.

df shows you the total disk space available
under linux, of course

great….. do you know how to see how much space the DB is already using?

check the size of the data directory

http://paste-it.net/29131~ snoyes ?

check the data directory size and also the binlog size (if binary logging is enabled)
it might also take some tmp space from time to time

oh god this is a massive query

finding it out for a single database is difficult if you use innodb with a global tablespace

You need SET on line 26, 31, and 32

usually you add up the fields DATA_LENGTH and INDEX_LENGTH from the information_schema.TABLES table

okay

And your line 35 can just be RETURN COALESCE(o_price_netto, 0);

SELECT SUM(DATA_LENGTH + INDEX_LENGTH) FROM information_schema.TABLES WHERE TABLE_SCHEMA=’yourdb’;

is that result of the query the size in bytes?

I hope so.

as opposed to kbytes

yes it’s bytes

cool
thanks

you can divide by 1000 or 1024 yourself

alguem sabe me dizer se o mysql armazena array??

maybe

1[n02,00ils12,00_1,00]01: they alguem knows to say me if mysql stores Array?

you can’t store arrays in mysql…

como criar um campo desse no banco?

at least not in one column without changes. You can store it as columns or rows.

1[n02,00ils12,00_1,00]01: How to create a table in the bank with a field of Array of infinite size?
1[n02,00ils12,00_1,00]01: help-me tanks

hmm I don’t understand, you might want to read this: http://dev.mysql.com/doc/refman/4.1/pt/tutorial.html
and http://dev.mysql.com/doc/refman/4.1/pt/column-types.html (tipos de campos)
and a href=”http://dev.mysql.com/doc/refman/4.1/pt/column-types.html”http://dev.mysql.com/doc/refman/4.1/pt/column-types.html/a (tipos de campos)

in mysql? evil.

longblob with comma seperated values
that would be the typo3 way to do it

35,000 rpm hard drives made of Unobtainium!

for storage that’s fine. for searching, garbage.

they use it for relations…

storing multiple values in a single col is just not a good idea, relationally.

that’s the most funny part

byebye performance. it’ll work, just become dead slow when tables grow. so it might be ok for a moderate size dataset.

yeah I guess for most setups performance is not the problem, but try to develop on that, you have to do most joins in the application

I dunno how big a typo3 dataset tends to get

asp.net structures and php custom classes

many apps out there do evil things like this, ad most of the time it’s just ignorance about how a relational db works.
it’s rather silly.

yeah
many times they point out it’s for database abstraction…

wordpress is much better now. cleaned up quite a bit.
give them a banana.

hehe

Hey everyone — I’ve got a question, I’ve two tables I’m working with in mysql, using php webhosting as the backend. When I add a record to one table, it has an auto incrementing field for the ID. That auto incremented number needs to be included in one
of the fields in the next table when I add the records. I’m adding both records at the same time. is this possible?

well I quit my crappy job months ago, so no typo3 work

interesting to call that db abstraction ;-)
I quit my not-so-crappy job last month. freedom is nice.

Anyone have any ideas here?

last_insert_id()

hrm

now freelancer?

Hi all

!tell SexyKen about autoincrement

SexyKen http://hashmysql.org/index.php?title=Autoincrement_FAQ

Question — on a new installation for a fairly heavy OLTP DB, would you recommend separate volumes for binlogs and table data?
and specifically with innodb, should the innodb log files go on the “log” disks (7200 RPM)
or are they random-accessed?
The table-space drive will probably be a RAID 10, 10k RPMs

and log?

hi all

probably 7200RPM single drive, maybe RAID 1

don’t put the log on a single drive

The whole thing is mirrored over DRBD/LinuxHA over a gbit crossover

y?

maybe the binary log, but not the innodb log.

so it’s already mirrored in case it dies

or a way to tell the client to format output as insert statements?

select into outfile?

if you have a raid controller with bbu use that for the log

hi folks, is this channel for user help?

bbu = battery backed write cache?

that creates a file on the server. i need it on the client box.

yes

yea, we’ll be doing that for sure

also… that dumps tsv, no? i need insert statements

by “log” you mean the innodb log, not the biglog, right?
er, binlog

yes

is the innodb log sequential write or random?

as long as you have tablespace *AND* innodb_log you are safe

basically, i want to synchronized data added to the table on server a to the same table on server b. “real” replication would be massive overkill, binlogs are not really an option performance-wise.

sequential afaik

so it doesn’t make sense to put the inno log on a separate 7200RPM?
(if it’s sequential it seems like a waste of the 10K)

I have a shell script that tries to talk to mysql, but it’s stopped by the password, how can I fix this problem?

the mysqldump manual entries include a reference to “…–where=’where_condition’, -w ‘where_condition’…”

unfortunately some of our tables are still on MyISAM for FT indexes, also… so I’m assuming we need to do backups of the entire DB state so we can restore from binlog

“Dump only rows selected by the given WHERE condition. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter.”

recovery is way faster from ib_logfile than from dump + binlog, as only uncommitted transactions need to get rolled back.

I figured for point-in-time recovery, I’d do a flush with readlock at 3am, then do an LVM snapshot of the data, and save the master status
then if I lose data, I can untar that snapshot, and replay binlog from the recorded point on

ah, nice, that seems to be what i wanted. thanks!

yes.

yeah
Lagfest \o/

and that covers both innodb and myisam together

well especially with BBU you won’t have many cases where full recovery is needed. Most times you can just start mysql again (think power outage), repair the myisam tables and innodb applies logfile.

can mysql do multiple distinct selects?

yes, with subqueries.

right, and since I’m running over DRBD, if I lose a drive on the primary, I’ll jsut fail to the secondary, right?
and it looks like a “power outage”

select (select foo from bar), (select foo2 from bar2) where…

with raid 10, losing a drive shouldn’t be a problem

NO ONE selects me, not even my own thumbs

what is the maximum length of a username in mysql?

oh shush

What about raid 0 though, mirrored over DRBD?

I got “The host or user argument to GRANT is too long” with a 17 character username, and a ‘%’ host

2 times more likely to fail
per host

sure ;-) but if it fails I just fail to the pair

SELECT * FROM channel INTO OUTFILE ‘/dev/null’ WHERE irc_nick = ‘foo’;

yeah, the other host would then apply the rest of the inno logfile at mysqld start, then you just need to take care of the myisam tables
so same procedure, just add an IP takeover

sry about the newb question but if I pass postdate thru a SQL QUERY – what kind of format will the data be stored as?

yup
performance-wise, what do you think about raid group partitioning?

That would largely depend upon your scripting language

4 disk RAID 10 for tablespace and inno log, 2 disk RAID 1 for binlog?

i’m using php
ok i’ll check up on it

hm, username can’t exceede 16 characters, even though mysql.user is 60 characters long
wtf.

Yep

Seems sensible to me, hopefully you won’t have too much random access on the binlog, and in every-day operation, I’m sure the disk caches will minimise the I/O altogether

hi

sounds fine, binlog doesn’t need so fast disks as it doesn’t write so much data (think of an update query, potentially changes a lot of data in innodb, but is only one entry in the binlog)

ooh, [RainMkr] is here

on my system, mysql.user says it’s varchar(16). mysql.host is varchar(60).

Ssssshhhh! It’s a secret.

from a python prog I’m getting an error, “Incorrect string value” which seems to be charset related. Wondered if anyone can give some advice on how to fix it – http://dpaste.com/14770/

but well you might not even need that extra disk if you have bbu as fsync() will be very fast.

right, was thinking 7200RPM for binlogs, 10K for data

15k for data!

i’ve problem with mysql-5.0.26, when i want to add record to table, query returns error that table is full

15k is a bitch, since it’s all SAS, not SATA
we looked at it but couldn’t build our own 15k machine

there’s plenty of space free on disk

15k is not all SAS

there is still some SCSI stuff around

right, ultra320

SCSI isn’t that uncommon

and database takes only 500MB of space

ones*

but that’s also annoying to build ourselves

SATA

this table has 210000 records

My DB is also horizontally partitioned
so I think the pricepoint of 15k wasn’t worth it

sekretarz, check your innodb settings in my.cnf

if it fits in ram…

!man table full

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/table full

hopefully the working set will be in RAM, yup

Enough ram and disk caches and you’ll be alright
Worst case you’ll have to slap in a read slave

don’t know how much more you pay for 15k rpm disks… last time I checked the 73GB SAS disk was 20 EUR more than the 10k SATA

we’ll throw 8G RAM in the machines
but we couldn’t find any SAS motherboards

hmm

!m sekretarz full table

intel or amd?

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

either

there are some around, at least for xeon

10k SATAs don’t have the reliability of a 15k SCSI

or just ask dell

yea, we looked at woodcrests

Why do you need SAS?

fibrechannel? :P

we specced out a PowerEdge from Dell, and something from HP, and they were both around $8k

strip out the ram

Dell… the Walmart of computing.

whereas we can build our own box with 10K SATAs around 4

i’ve read this already

I’m not the hardware guy so much

what’s in it for 4k $?

i think that this error can be coused by this variable in my.cnf
innodb_data_file_path = ibdata1:10M:autoextend:max:128M

Hardware’s not my strongest field, but can’t you just put a card in ?

how can i define that mysql can use more ibdata files

Sometimes, it’s worth $4k to be able to bitch at someone else about hardware failures.

I think that was 4 10K 36G SATAs, 2 250G 7200RPM, hotswap for all of them, and some RAID card with battery cache
dual dual-core opteron of some sort

ok

You don’t want the 36GB 10k.

hardware guy’s on the phone talking to some guy about these boxes

We’re talking Raptors right?

not even sure what brand he was looking at

innodb_data_file_path = ibdata1:1G:;ibdata2:1G;ibdata3:autoextend:max:128M

sekretarz, remove the :max128M or add more table spaces

150GB Raptors are the next generation of WDC’s drives, and much faster.

even if we only have 72G of DB?

IO is always your bottleneck

We’ve got a machine at work which’s got two woodcrests and scsi raid
15k rpm tho

I figured IO write speed was bottleneck, not size

yeah, especially then. You don’t want to “max” out a disk

so you’re suggesting a bigger disk just so we stay on the inner cylinders?

Outer

and have better density?
er, that’s what I meant

yes

is the thing smart enough to put our data on the outer cylinders first?

You set your partitions

Ok, another newb question, how do you select the last row in a table?

bigger disks are faster

Define “last”

you really think it’s wroth the price difference? the 150G raptors seem pricey

Also, bigger disks usually mean “newer technology”.

about the same price as two 74Gs

150GB Raptors are what… $200 a pop?

maybe I found an out of date price. one sec

if the table is a big long list – selecting last would be the very last entry on the bottom of the list

Put it this way, what good is a dual dual-core processor if it’s always waiting on IO?

You have the theory right, but in practice, how many ms gain are we talking about?
There’s a ms gain / $ to take into account, Toad is obviously on a budget

TIme to go!

good deduction — startup company ;-)

bah – he left

hmm

Ok, another newb question, how do you select the last row in a table?

it just seems silly to get 150G drives if my DB is only 20G

hmm

I’d say stick with your original plan, nothing says you can’t expand, should your startup do well (then presumably you’ll have a larger budget as well)

what about backups…

if DB is 20G, and I have 4 36Gs in RAID 10, that’s 72G of usable space

indeed

which should be plenty of space to do LVM snapshot and backup to the binlong disk
and from there ship off to our distributed storage
(500G barracudas on other machines in the rack)

3.889,00 EUR (+ VAT) for a dell server, quadcore xeon 2,33Ghz, 8GB RAM, SAS RAID controller, 4 73GB 15k RPM disks.

No off site backups? Shame on you!

the only way to guarantee the order of a database, is to order it in your sql. ’select * from table order by column desc limit 1;’ sort of thing.

and ship off to our office, or encrypt and ship to S3, or whatever
hmm, hardware guy just got off the phone

well and the ram is like 100% of the normal price at dell.
more like 150%

1230 EUR

(502 EUR for 8GB Kingston in normal hardware store)

does that server have space for a couple more disks for system + binlogs?

4 extra disk would fit

hotswap?

3161 EUR if you buy the ram somewhere else, should be close to 4k$
yep

which dell server is this?
hw guy says it was about $6700 for the one he specced

Power Edge 2950

that query will use two fields as unique identifiers instead of one?

well I don’t know the prices in $
Euro performs very well these days

yea, $ sucks these days

the subqueries will be independant.

tell him to leave out the RAM

and yes, they will be returned as two separate identifiers

and everything else that seems too expensive

he says in his experience mixing and matching RAM can be unreliable

Yeah, don’t do that

really?
well I don’t know what dell puts in it’s servers, but I think you can buy that on the free market

if you must buy RAM, buy all the same kind.

anyone able to help with “Incorrect string value” using python

502 EUR was for PC667 Kingston FB DIMM, 4x 2048

show us the query you’re trying to run.

hm

what is mysql written in?

what do you mean by the subqueries will be independent

C
some assembler

cSql = u”INSERT INTO temp1 values (‘%s’);” % e.description
e.description apparently has some non latin1 chars
‘latin-1′ codec can’t encode characters in position 3684-3692: ordinal not in range(256)

thx

souped and c++

well it might be that it is so cheap here because of the bad performing dollar.

Taran/win 62

yea i’m checking again

I guess my problem is, that Different File entries can have the same path and name, and I need to sort by path and name as a set distinctly

my 3161 EUR are 4400$ already…

then let’s analyse your problem

I’m showing $5221
for quad 1.8Ghz, 4×36G 15K
8G RAM

no one likes text encoding problems :-(
http://dpaste.com/14770/

yep. dell ram

also, check that the disks you’re speccing are hotplug

they are (first option I think)
If I buy a beer at a bar it’s 2.50 EUR, if I buy it at the store it’s 0.50… Same with RAM and Dell.
but raptors are fine too.

except that Dells are more picky about their ram than you are about your beer

that depends on the person.

yea I think raptors with a 3ware RAID card is probably our best bet for now

not long time ago, you were drowned in your own beer if it didn’t conform to the standard in this country

also in terms of gettin gthe machines quickly

yeah, be sure to buy PCIe Controller

well, I’ve bought name-brand non-dell ram and had the server reject it.

not PCI-X?

buy the dell ram and the server was happy

PCI-X is fine too

ok cool

hmm I wonder why.

don’t know, it was too costly to do a trial and error on. :-)

a standard path would be like c and a standard file name would be like boot.ini, and there are multiple copies of files in the same path with the same filename, I just want to see it once

either there is something special about dell stuff, or they just found a trick to sell there overpriced ram.

could anyone tell me if ~/.my.cnf is used by shell scripts when connecting to mysql?

the command line client uses it.

well, I have a grumpy shell script

I could put down Dell and theorize that they’ve somehow rigged their ram, but I’ll settle to say their ram is just very picky

your mysql commands do whatever it would do if it werent in a shell
so if mysql by itself uses ~/.my.cnf, then so does your script

is there any problem putting a PCIe x4 intoa PCIe x16 slot?

ok, anyone know how to get MySQL to allow inserting of unicode data from a python script?

no problems

it should be like agp

I don’t know anything about graphics cards at all :-) is that a yes?

tables are in utf8 encoding, connection charset it utf8?

I don’t know how to make the connection charset utf8

well it should be okay

here’s the problem, the script works as expected when manually run, but it fails at the point where it would connect to mysql when called from a program, the same user is used in both cases

if anything the system just wont post if it hates it

hmm.. but in theory, it works?

yea

how are you managing passing the password to mysqld?

‘nohup: redirecting stderr to stdout’ does someone know whats wrong?

thanks

character_set_client variable in mysql I think

if it wasn’t meant to be it wouldn’t fit at all

will look, thanks much!

point

by .my.cnf I thought

nothing really wrong, your initscript uses nohup which redirects stderr to stdout…

hmm, oke

so it’s no error, just a note from nohup to tell you where stderr goes.

aight, k

ok, last question (I think) — is there a significant performance benefit to using a raw device for innodb tablespace?
vs a dedicated ext2 drive?

hard code it one time in your bash script and see if it works.

no real benefit
why ext2?

Is there any way mysql will take advantage of more than one processor?

er, ext3

xfs should be faster

k

Tarantulafudge, it does

which OS?

Evening all

Gentoo Linux

Got a cluster issue

should work

I ran a query which took 6 minutes and it seemed to peg one processor (err core I mean)

Unable to find connection between nodes
1 [NdbApi] INFO — Failed to get dynamic port to connect to: -1 – Repeated 6

you see anything wrong with software RAID-1 for the log drives? (250G 7200RPM)
the price increase between a 4-port RAID controller and 8-port is pretty big

Anyone got any ideas how to start getting to the bottom of those errors?

yep, every query uses one (virtual) core/cpu.

no multithreaded queres?

there are also some other threads around which do various stuff.
no

can’t you use DISTINCT or GROUP BY ?

I can’t use distinct twice
I’d need distinct filename, distinct path

with a subselect…
hmm

DISTINCT applies to your whole selection
SELECT DISTINCT foo1, foo2, foo3 FROM foo_tbl
it’s the same as SELECT foo1, foo2, foo3 FROM foo_TBL GROUP BY foo1, foo2, foo3

oh ok thanks

in some cases, DISTINCT is slightly faster than GROU BY

now doing a test run

nothing wrong with that…

cool

thumbs what cases?

100000 rows was slower than DISTINCT

on average, GROUP BY took an extra ~100-150 ms

is it completely stupid to make a event logger on mysql?
should i just go straight to a flatfile?

logging to SQL is much slower than using a flat file

right
sigh

in some case, where data retrieval is more common, it might work out.
parsing log files is slower.

i just want a event logger with sql grabbing tools

the key is to evaluate which portion of the process needs the most speed.

probably writting
oh well

the actual writing step, or the retrieval step?

entie_, batch the inserts

the writing part can be lessened with the absence of indexes
but then, data retrieval would be slower.

i think statistics are key, and sql makes those easier to read
but it probably isn’t worth the risk

the risk?
like archivist said, you can improve the storage speed by batching your jobs.

entie_, maybe calculate summary data while inserting to spread the load

the risk of slowing down my app more than i expected
and having to take the code back out very quickly

I would benchmark it regardless.
you could be surprised.

yeah, for sure

entie_, what insert rate do you want

maybe 30-40/sec

oh slow

really?

yes.

what would ‘fast’ be?
i know it is hardware based

I get nearly 3k on a 800 meg box 3 indexes
no other load

that is very good to know

but individual inserts are 26 per sec
its the batching

Once everything was using utf8 it worked, thanks!

maybe i can just write to a flat file, and analyze them later using sql
less worry

http://pastebin.ca/625434 # could someone explain the syntax error on line 12 ?

imMute, missing error message

good job.

hello

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 ‘ON((`v1`.`id` = `k`.`kicker_user_id`)) ) JOIN ( `view_user_id`’ at line 12

hello, can someon tell me if I can get a log of queries to a particular database?
or enable logging? im on debian etch.

imMute, and a waste of brackets there

i need to see if an app is pounding the DB.

i dont really know much about joins, im trying to use some other one thats similar to what I need.
what do you mean they are “wasted” ?

(())
and also on( is not a function

its on the other guy’s view
and my db is a fork of his

I’m not sure if this is the best way to describe this, but is there a way to join tables across users? ie, if I have a user that can access table1 and a different user that can access table2, but neither can access both, is there a way to run a query on both of those tables at the same
time?

bI’m not sure if this is the best way to describe this, but is there a way to join tables across users? ie, if I have a user that can access table1 and a different user that can access table2, but neither can access both, is there a way to run a query on both of those tables at the same
time?/b

imMute, from table

its a join, there is no table ?

outcome?
cricketcricket
Thin-sliced marinated flank steak, baked potato rubbed in olive oil and sea salt, salad, corn on the cob, iced cantaloupe, bottle of cabernet sauvignon – I believe I’ve just had a foodgasm,

Any reason why MySQL wouldn’t be creating a socket file?
Or any way to kind-of force it to do so?

server process (mysqld) not running?

It is running. But there is no sock.
dbconn: mysql_connect: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Server isn’t running, or something deleted the socket file after the server started

make sure mysqld is running, run locate mysqld.sock to find out where it is, update php.ini accordingly

That’s a client error, anyway

I tried locating it, it’s nowhere to be found!

then examine your /etc/my.cnf

the sock file is created when the mysqld process starts, and is deleted when it stops. do you have shell access to the server?

obviously.
It’s supposed to create it in /var/run/mysqld/mysqld.sock

when you do INSERT INTO … SELECT …

obviously, what proof do you have that the mysql server is still running?

should you see the table filling up in real time?

the location depends and configurable

I’ve done a ps aux |grep mysql

i’ve got such a query running for the past 26 minutes but the destination table remains empty

show processlist
and check the state

it is running
sending data

check permissions on /var/mysql it should be owned by mysql

has all of this worked previously? is this error a new thing?

it did.
I only recompiled Apache and PHP, and boom. All of the sudden, MySQL decides to go down.

clue?

?

well, always look to recent changes to explain errors. Can you restart mysqld?

I can, and I did already a few times.

insure that where mysqld writes the sock file is owned by the system mysql user.

is there anyway to “combine” permissions from multiple accounts in one query?

though that should cause mysqld to stop itself if it isn’t
when I install php on CentOS, I have to make sure that I install php-mysql to make the connection
that would be a security flaw, wouldn’t it?

how so?
if I a real person has access to two tables through different accounts, how does being able to join them affect security?

conflating mysql user privileges? how not?

if anyone of it has grant priv, you can combine the priv

Hmm… I now tried mysql to connect via tcp/ip
Can’t connect to MySQL server on ‘127.0.0.1′ (111)

!perror 111

Connection refused

is that possible on-the-fly, or only by granting permissions to the second account and flushing privileges?

out0xCF8 grant will do, does not need flush privilege when you use grant

show me the output of ‘ps aux | grep mysqld’

out0xCF8 not on the fly, i guess, you need 1 user to grant, the other user to access

pauliukas, check whether you have skip-networking in your my.cnf
or skip-network it is

if you use mysql5, it can be easier, there are views

I’m trying to avoid granting any more permissions to existing users or creating new users

but views also require priv

http://pastebin.ca/625509

so the mysql security model is working.

pauliukas, ok, that means mysqld is running

if the users are used by 1 person, why need so many accounts

Well, the thing is I’m trying to make a software that aggregates information from, say, 5 different databases with identical structures but different data. The user might only want to look at 1 or 2 of the different databases at one time. Is changing the aggregated databases possible with
views?

it looks like you have a dozen mysqld processes running.

No idea why.
I just did a usual /etc/init.d/mysqld start

stored procedure maybe

you might kill 11

why use different users?

If I use mysqld stop, it stops them all

but not advisable for security

is it normal that an INSERT … SELECT query on 4.1.X ’s state is Sending Data … but the destination table seems to remain empty during the process?
45 minutes and counting … select count( * ) from dst_table = 0

fascinating

are you sure you can select when inserting?

Trust me, I’m seeing this all for the first time mysql.

meaning? locked table?

the way it’s setup there are classes of users within mysql for certain functionality. So, for example, the 8 users that can add records to a table all use a single mysql user but authenticate within the software with different usernames and passwords
so one user who can add records to two different tables and view records from a third table migh cause the backend to use 3 different users to access their data

and i don’t see a single reference to a sock file location

doesn’t it refer to my.cnf?

have you looked through ‘defaults-extra-file=/usr/local/mysql/data/my.cnf’

It’s a blank file..

SHOW TABLE STATUS shows dst_table has 6.5M rows … all is well then

erp, sorry, I responded to your question to kimseong …

Where is the mysql log located?

mysqld –help –verbose at the end has the default, look for socket

i can expect to wait another 1.6 hours though :-(
then have to do a second time

with all instances of mysqld killed, as system root try ‘/etc/init.d/mysqld_safe –user=mysql &’ and then try the ps aux again

gracias

feliz al ver otro cliente satisfecho

the log location is system specific, often /var/log/mysqld.log

!tell nils_ about external

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

well, I’ll just find another way to implement, thanks for responding kimseong & threnody

good luck

I’m seeing the few errors.
A few file not found.
/var/lib/mysql doesn’t even exist…

that’s where your databases are stored, I think
I shouldn’t say that, that is system specific too.

Right…
the person put that in /home/mysql

I don’t believe your system mysql user account should have a ~home directory.

damn debian with this old_password stuff

hi
guys is there some news saying that there’re extra ultra violet because of a change in the atmosphere or something like that?

is this a joke?

no I’m very serious
0 PM and stuff like that
hopefully my friend is just trying to make me panic !

It would be all over the news sites, my friend.

I tried but didn’t find anything that serious
my apologies as well cause I thought that there’s a weather channel and that I’m already on it

anyone here use libpam-mysql ? Im having a problem where my client system is querying my database nonstop for linux group information
i need libpam-mysql to control authentication to X-windows, that part is working

bbl

but the system nss queries are all falling back to libpam-mysql, which is badf

hi. can someone take a look at this query? http://chris.quietlife.net/tmp/error.txt
this query was working fine in 4.1

kevinl–: so what is the problem?

I just upgraded to 5.0 and it’s bombing out with that error

is it okay to truncate a table even if it is already empty?

kevinl–: fr one thing, you should enbale the mysql query cache with such apps because there are may repeated querie and the underlying tables won’t chaneg that often. I found the same with postfix and dovecot.
is fine

thx

intresting. some join logic has changed in the parser for 5.0. what I’d recommend doing is rewriting the query to use explicit JOIN syntax rather than commas. i.e. put the join conditions in ON next to JOIN rather than in the where clause.
that ost likely also gets rid of your other problem, although I’munsure why you’d have the prob. could be a bug. which 5.0 version do you ahve there?

the error is coming from the ON clause not the where

SELECT VERSION()
so?

arjenAU, ey?

sorry wrong…
SELECT VERSION()

i think i found it

the issue is the construct in the FROM clause.

it was the implicit grouping of FROM that took precedence over left joins in 4.1

do tell

i had to put the tables in FROM in parentheses before the LEFT JOIN

good. nevertheless it’s good to use explicit joins. more readable.

ya that worked..
cool

correct, that the change in mysql5

just saw it in the docs
wow, actual documentation

i would like to obtain full insert statements (1 complet statement per row) when i do a mysqldump. I tried the -c option but it does not seem to work.. does anybody know what should be the option?

extended-insert=no

thanks Xgc

Sorry. false, not no.

xD.

On the command line: –extended-insert=false

ok

Also look into –complete-insert=true

regarding triggers, is there a way to make http://hashbin.com/17db.html more managable (let a lone work, as I haven’t tested it yet)?
it’s more psuedo code than actual code…

–complete-insert=1 will also do. basically you want to disable (part of) what –opt does. which is now default

ok, thanks all
got it

I’m getting a message about an invalid atom, and don’t see why http://pastebin.com/m750458cf

[[thufir]]: and this is related to mysql how?

rofl. thanks arjenau, I was like “why is no one in gentoo saying anything?” rofl. oops.

is there any performance difference between WHERE Id IN (1) …. and WHERE Id = 1 ????

I’m guessing that the db engine compiles both about the same.

alright
thanks

np

another newb question – is it possible to store arrays in mysql via php?

well basically that’s what you do anyways
you fetch arrays, you store arrays
it’s just that an array is equalivent to a table or table row, not a column

i jes don’t wanna store like a 50 element array into 50 seperate columns

well if you don’t need to search or join on that data, you might want to check the serialize() function (php)
!php serialize

string serialize ( mixed value ) Generates a storable representation of a value http://php.net/serialize

!php unserialize

mixed unserialize ( string str ) Creates a PHP value from a stored representation http://php.net/unserialize

cool nice
thx

if you are going to ever search that array, you shoul ddesign the db appropriately. its not 50 columns, it’s most likely 50 rows in a separate table. normalisation, not spreadsheet ;-)

arjenAU++

;-)

Evening. I need to mirror of a mysql database to a secondary machine, so business users can use ODBC tools to munge through the data and make reports. I’m figuring the obvious answer is some cron jobs to dump the database, rsync to the dump to another machine, and load it into the second
machine’s mysql installation.

Is there a better way to do this?

uhm… replication?

what jbalint says.
what you wrote is only the obvious answer if you don’t know mysql.

How hard is it to set up replication?
And how much impact does it have on the master server?

between 3 and green.
your main server should be doing binlogging anyway for backup/recovery, the rest is just some network traffic, but spread out. your rsync would be worse.

Does replication require significant configuration on the master server?
Besides binlogging.

Me, I like your original idea. Just contrary, I guess. Plus a big fan of rsync over ssh…

Well, I’m looking for the simplest way to do it. Part of why I want to do it this way is because it’s simpler than prying loose the sysadmin for the primary box.

has no relevance to mysql though

instead of opening another port on your firewall…

He said it’d be no big deal to enable direct ODBC access, but a) I don’t want the business users hammering the live db anyway and b) I know he’s already overtasked.

port 3306 is already used.. what new?
no.

er, he’s already overtasked, so it may take him a while to get around to enabling ODBC access.

you don’t want to run analysis/summaries on a primary server. that’s never a godo idea.

Yeah, that’s what I said ;-) .

(replication fascists)

apart from the analysis, the slave would act as a backup also… never hurts.

Yah.
How much fiddling with the master mysql install does replication require?

between purple and mauve.
if you ask sensible questions, you may get a sensible answer.

You’re a big help :-) . Is this on a chart somewhere?

what kind of chart woul that be. one with a mythical puff scale of “how much” and “how difficult” ?

Well, sensible answers might start with a) none, b) massive, c) a few settings changed in the mysql.ini, d) recompiling with different compiler flags, e) changing some options on the database in the sql creation script.

http://www.lbl.gov/MicroWorlds/ALSTool/EMSpec/EMSpec2.html

yes.
mostly c and a cluelevel. mysql.ini indicates windows?

hmm Zend PDT sucks

the fact that you even mention d makes me very worried about the second thing I mentioned.

Linux, actually.
so /etc/mysql/my.cnf.
I think that’s a holdover from when I had to support an app that ran on both.

no settings in the server ever require a recompile.

In any event, it involves editing my.cnf, which involves getting root access on the box in question, which involves convincing the admin of that box that it’s a wise thing to do, which means “hard”.
That’s good to know.
Though incorrect according to http://dev.mysql.com/doc/refman/5.0/en/compilation-problems.html
Still, I’m sure _most_ don’t require a recompile.
I’ll keep that in mind, in case I ever meet any pack primates on irc.

lol

what relevance does that manual section have to what I wrote?

whats the sql for checking if a column is null?

Hey guys i need a quick way to make a bunch of rows with a common field value into a single row.

IS NULL
Common gotcha: any comparison on null value (even column== null) will always return false.
Please clarify your question. You have a dozen rows where column foo is the same value, and you wanht to do what now?

my current table is product_id, product_name, product_value I need to make a row that says for all product_id #1 product_name = product value.

I still don’t understand what you’re trying to do.

So the columns for newtable will be the product names and the values for those columns will be the coresponding values.

First, you’re create a new table?
First, you’re creating a new table?

I was thinking more of a temp table. Or if I can do a query that would return a row of data like i descriped based on the product id
product_id is not the table’s promarry key. There are many of the same id

I’m still not sure what you’re trying to do.
Step one, you have a table product, with columns product_id, product_name, product_value.
Step two, you want?
You want to select all of, for example, product_id #1, and then do what with the values?

a result with all of the product names and values in one line result

In one line of output?
That sounds like more of a scripting language job than a mysql job, though MYSQL has a zillion little specialized functions that can probably do it.

so, product_id product_name_1 = product value 1, product_name_2 = product value 2, ect

So it’s a report.
Are you using a different programming language to access mysql? It’d be trivial to do that in, for example, perl or php or java.

I have a relation talbe of attributes that i need to check id that exact set of attributes exist for another product_id.
I though if mysql could do it it would be more efficient.

Who knows. What are you going to do with the output lines? If it’s just a report, then the speed difference should be negligible.

I could query each set and loop through to check them but when i have 1000 ( later on ) products that is not effient.
It is not a report. It is a duplicate check.

Ah. So back up a step and tell me why you’re trying to do this?
You have a product table, you have an attribute table, you have a product-to-attribute table?

is there a way to define an array in a store proceedure, and iterate through it?

co if product one hass attribute 1 = 2 , attribute 2 = 3 ( in seperate rows mind you ) and product 2 has attribut 1 = 2 and attribute 2 = 3 i don’t want duplicates.

in mysql 5.0

No

31449600′ but it’s deleting all my tables..

in 5.1?

a product table and a product_attribut table.

oops, not all my tables, all the rows

doing a select with a limit using the same where clause helps spot problems
also the claus eis just wrong for index use. you want something like WHERE started (NOW() – INTERVAL 1 YEAR)

So product itself is an attribute table?

you want the col on its own on one side of the expression, so an index can be used

mostly

GROUP_CONCAT() will do what you want, probably.

What’s the relationship between product and product_attribute? Does product_attribute have a foreign key column that matches a primary key in product?

yes, product id is the FK

thank you arjen, this brings me in the right direction.. (newb)

Okay, so let me restate this and tell me if it correctly describes what you want to do. You have table product. You have table product_attribute. A row in product may have many rows in product_attribute. You want to remove duplicate attributes.

I want to test fr them before adding a new product.

Ah.
And a product is pretty defined by a bunch of attribute rows?

yes
So i need an effiecent way to ask the server if a specific set of rows exist for another product.

So what you really want to do is “Check and see if any set of product_attribute rows (where a set is identified by a common product id key) already exists .

Nope, the other way, i want to identify them by the attribut set.

Hm.

The products are customized by a script that adds then to the system as the cutomer orders them.

while any given group of attributes is grouped together by the product_id, you’re checking to see if a group exists with the same set of attribute name/values.

yes
Sorry
( Just for the record this i a pre-existing system that i am adding to, not one i wrote )

is there a way to define an array inside a store proceedure? I would like to interate through that array, to make this code maintainable. http://hashbin.com/17db.html

Heh… how often that’s been said :-) .

oh, field is a keyword… I’ll have to change that.

Well, I don’t know if there’s a mysql function to make this easier. I think I’d end up programatically composing a big where clause.

There is not way to create a view or temp table with the layout i want?
Then i can query it to see if it has the row i need.

guys hi what is the problem with this insert?

I have mysql 5

`

try again.

mmm ok a-l-p-h-a_

?

no
insert into `headers` (`to`, `from`, ….)

mmm ok
thankyou

hello
SELECT * FROM SiteInfo WHERE EMS-PSF NOT LIKE ”;
can i not use hyphens?
Unknown column ‘EMS’ in ‘where clause’

Vme, you can… SELECT * FROM SiteInfo WHERE `EMS-PSF` NOT LIKE ”;

nice
thanks

m[
np

Hello all. I really hope you can help me with this.
I am tryign to use LAST_INSERT_ID and it returns 0 always
I’ve red the documentation backwards and forwards and I swear I am following what they say but it still returns 0

select LAST_INSERT_ID();

insert into test_table(TestID,TestValue) values(null,’testing’);
select LAST_INSERT_ID();
returns 0
insert into test_table(TestValue) values(‘testing’);
select LAST_INSERT_ID();
also returns 0
I’ve been at this for 2 hours now reading, re-reading it just won’t return a value other than 0

I think I remember something about it being the same connection.
“For LAST_INSERT_ID(), the most recently generated ID is maintained in the server on a per-connection basis.”

yes it should return last id by connetion, so other users inserts do not effect the value i should get

DougMelvi, how are you calling it?

right now I am using the query browser
insert into test_table(TestValue) values(‘testing’);
select LAST_INSERT_ID();
as two sepreate staements, the isnert goes okay but the second returns 0

what version…?

5.0.41 I am installing 5.0.45 now
or do you mean query browser?

does your table test_table have TestID autoincrementing?
just to make sure…

yes
i built the test table incase my real tables where at fault

ahh. I know why now.

also does the same thing when executed via asp using the MySQL ODBC 3.51 Driver

insert into test_table(TestValue) values(‘testing’);
select LAST_INSERT_ID();
run that.

um.. that’s the excat same code i just pasted

oops. sorry.

jsut restared the service with 5.0.45 gimme a sec
still getting 0 returned
does the table need to be a specific type? the docs didn’t say but who kows at this point
would not be so bad if i was being paid by the hour…

i’m out of ideas. sorry

goinan try rebooting since i’ve update mysql server version

I accidently deleted a mysql db on a local server of mine, I don’t have a backup of it (just made it) and it will take a bit of work to restore… Thing is, I have the db set to innodb, anyway to restore it using innodb? doesn’t it store records?

You changed the tables in the mysql schema from MyISAM to InnoDB?

yah, by default they are innodb

No, they never are.

oh =\
I thought they were, because everytime I exported the db using phpmyadmin, it created them innodb

you can change the default engine to be InnoDB, but the mysql schema is *always* MyISAM unless you go in and manually issue an ALTER TABLE user ENGINE=InnoDB;
Do *NOT* use phpMyAdmin for backups!

if they were innodb, would I be able to restore them?
I know, I use it to make dumps

No, and your server would never start.

anyone interested in buying sqldeveloper.org ?

This is not an appropriate place to advertise such things.

oo sorry
i just figured this is a sql channel so if anyone wanted it

this is a *MySQL* channel.

I guess i’m gonna have to set MySQL to backup often :P

All a function of your data change rate.

doesn’t the mysql ab do auto backups?
if so, i need to re download it

No, it doesn’t. MySQL comes with a utility called mysqldump which use for making logical backups.
!m mysqldump

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

That’s pointless.
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

thanks man
I hate chatzilla, I clicked that link and it took the page i was currently playing runescape on and sent me to the mysqldump page

LoL!

I was snaring a ton of birds, too =\

The max you can have is 5 traps at once, not a big deal.
hunter level?

33

nice.

but I had the traps to where the birds were stayign in oen area
now they are spread out

total level?

1364

hi. it’s me again..i just want to delete all the rows if they’re older than a year from now.. can someone help me with the command?
SELECT * WHERE posted (NOW() – 31449600)
how would i place it in a variable and then call that variable and delete them?
mysql style..

http://pastebin.ca/625712

doing this ‘delete from atable WHERE starts (NOW() – 31449600)’ deletes all my rows

Figure out your problem?

Not really
I guess I will have to do it the bad way. I will have to load every product and test it against the current one. It’s fine now but iterate through 1000 products with 60+ attributes each and you have a very long script. I hope it will hole up…
*hold

http://pastebin.ca/625712 Help is greatly appreciaaated!

found it…delete from atable where started ‘2006-1-01′

Does anyone know of a dictionary DB that I can specify a couple of letters to find words containing said letters?

in any part of the word? or just words that start w/ those letters?

wordnet!

In any part of the word

and LIKE

either way, could just get some huge word list and do some basic text parsing
google.com/search?q=word%20list

Yeah… WHERE word LIKE ‘%A%’ AND word LIKE ‘%B%’ AND word LIKE ‘%C%’…
oooh, that works. Thanks
oh, look at the time….
!fooP

hehe
where I had my scrabble utility

how can I specify multiple db’s for replication in my.cnf
on the slaves
for e.g now I have replicate-do-db=copy_db
i would like to add more databases / tables

add multiple rows
replicate-do-db=db1
replicate-do-db=db2
etc

thanks _ _0/

\o/

replicate-do-db is asking for a disaster

need help, how do i reset my user and password for mysql.. since i can not get the root for mysql. what should i do..

Comments off

Hi everybody Need to find a way to go We have webapp in production under Tomcat6 2 servers with load balancer

shudder

Comments off

everybody i am a newbie with mysql what is the best way to keep a coherant relationships database please what

someone that knows about epoch?

http://pasteosaurus.com/264 thanks

jabbadoo_, do you mean in datetime values?
Alex_Gaynor, any particular reason to use bigint(20) for user_id and other primary keys. do you expect this database to outgrow a regular integer?

Hrm, probably not, although I won’t swear to it, can I just up it later if I need it?

Hello community .. I need help concerning an encoding issue

gnari, yes

how can i set a field to 2 digits instead of 1?
e.g: 01 instead of 1, 02 instead of 2….

zerofill

http://hashmysql.org/index.php?title=Zerofill

I have a website written in PHP, old database’s charset was set to latin1, data were in Arabic and I used windows-1256 in the meta tag for the page encoding .. But I want to convert the DB from latin1 to utf-8 . I tried so converting them but results on page were like ?? ???? ??? ????? … I
changed the encoding of the page to utf-8 but still the same ugly results! I created another database with utf-8 and reinserted data using phpmyadmin .. but still the
same problem .. any tip or help will be appreciated

jabbadoo_, what do you want to do?

Okay. I need some help. How do I query mysql to sort by a certain field descending?

[...] order by fieldname desc

Like, “SELECT * FROM `table` ORDER BY `field` DESC?
Okay.

yes.

Thanks, pizza_biz
pizza_biz++

gnari, transform a float into date/varchar and transform a date/varchar into float from epoch

hello when creating a table is there anyway to set the default to the maximum int of a column?

why not use AUTO_INCREMENT?

its not a pk

I have a website written in PHP, old database’s charset was set to latin1, data were in Arabic and I used windows-1256 in the meta tag for the page encoding .. But I want to convert the DB from latin1 to utf-8 . I tried so converting them but results on page were like ?? ???? ??? ????? … I
changed the encoding of the page to utf-8 but still the same ugly results! I created another database with utf-8 and reinserted data using phpmyadmin .. but still th

e same problem .. any tip or help will be appreciated

are you using a new mysql?

jabbadoo_, you would probably use unix_timestamp() and from_unixtime(), although i do not know about the fractional part

hmm, svn.mysql.com seems to be dead

Hello! Any help people?

charset

http://mysqldump.azundris.com/archives/60-Handling-character-sets.html

read that url

thanks

gnari, that’s exactly what i needed, thx a lot!

is there no column setting where i can set the amount of zeros?

zerofill

http://hashmysql.org/index.php?title=Zerofill

in a php mysql web hosting statement how can i seperate 2 conditions? like ( name = uname and name 2 = uname2 and gid = gid ) OR ( name = uname2 and name 2 = uname and gid = gid) ?

just like that

thanks

Bear10, in this particular case the parentheses were not needed, though

how do I give a column of a table a default value?

add a default value in the column definition.

Just remember default values cannot be functions
(the output of a function)

i just wanna set it to 0

DEFAULT 0

does the table exist already? you’ll need to ALTER TABLE if you want to add a default.

na, im creating the table
writing the CREATE TABLE thing

[...] foo INT DEFAULT 0, [...]

Exactly

does mysql care if I use integer instead of int

i think they’re aliases.

k

the manual covers the various datatypes.

is there a way to use a wildcard to drop multiple tables w/out dropping the entire db, short of a script?

prefix drop

http://archivist.info/search/index.php/Prefix_drop_table

drop all tables

There is no wildcard support for the DROP TABLE syntax. You can use MySQL to generate the list of tables to drop; see http://thenoyes.com/littlenoise/?p=44

ty
i think this will work just fine
it was about what what i would have written, but saves me the time

hey, quick question…I’m running a massive update on user data in a database…I want to back up stuff in case things go wrong..is there an easy way to use phpmyadmin to back up current db?

pMA has an Export tab.
Some people have reported some issues with the backup it generates, depending on the version.

thx
yeah
that’s my concern
right now, I’ve used it for that database

after you order by a field, how do you figure out the position of a row?

although, I don’t get the “file name template” stuff

It just means that you can use __TABLE__ and the file will be called nameOfYourTable.sql

oh, ok
Thx much!

dam
i’m doing something like ’select id from my table order by score where uid=5′ , now i want to figure how how far down the list, score is…. how?

It’s easiest to handle it in your application. You can use a user variable, e.g. SET @row := 0; SELECT id, @row := @row + 1 AS position FROM…

ok thanks snoyes
in command this works good, but doesn’t seem to work calling as mysql query all in one string
SET @row := 0; SELECT @row:= @row+1 AS position FROM know_summary WHERE uid=8824877 ORDER BY score

mysql_query doesn’t allow query stacking. Make two separate calls to mysql_query, or use mysqli_multi_query

ok thanks snoyes
your knowledge amazesme

Error dropping database (can’t rmdir ‘./social/’, errno: 17) mean? I get it when trying to drop a database

!perror 17

File exists

What do I do about it?

drop the database, then the file won’t exist.

I get that error when I try to drop the DB

You get that error when the directory can’t be removed. Perhaps the user as which mysql is running doesn’t have permissions.
Or perhaps there is some other file that’s been stuck in there that doesn’t belong.

Ok snoyes you type faster.

a) Is it possible to set up multi-master, multi-slave replication (ie, A-BC, B-AC, C-AB)? b) Can anyone point me to a good resource about said configuration?

Not like that, but you can do A-B-C-A

rmdir won’t run if there is a file in the directory.

No slave may serve to masters.

Its empty, I found it on my HDD, can I just delete the folder manually?

I assume it’s in the mysql hosting data dir?

http://dev.mysql.com/tech-resources/articles/advanced-mysql-replication.html

Yeah, I’m on OSX, and its in MAMP-db-mysql

you might stop the server first, the do ‘rmdir -rf social’
you might stop the mysql server first, the do ‘rmdir -rf social’
using the full path to the dir you want to remove

Yeah, I have a little CLI experience
Yay, its gone

im having some trouble setting the mysql root password
i was following the steps of a tutorial

gotta be careful advising the use of ‘-rf’ ;^)

haha, nice snowman

sorry, I just see text.

mysqladmin -u root password ‘foobar’

I don’t know what you did but after ‘-rf’ I see a snowman :/

but i mistakenly typed mysqladmin -u root -password ‘foobar’

; ^ )

and then tried again the original way, but was told access denied
mysqladmin -u root -p
it lets me in
mysqladmin -u root password ‘foobar’
error: ‘Access denied for user ‘root’@'localhost’ (using password: NO)’

either -p or –password

Any oppinions on table types for this: http://pasteosaurus.com/266 I’m thinking MyIASM for all besides the _mod ones which will be InnoDB

but i mean it appears i have no password set, because it doesn’t prompt me for one when i use -p/–password
but if i try to change it, it tells me “access denied”

innodb with logging is safest for disaster recovery. it can be slower on selects than myisam. big players use innodb masters, replicating to myisam slaves, and let the slaves handle the selects from the public.

much appreciated

I’m not that big, I figured the tables that would be mostly writes are the _mod ones, which keep track of user moderation of content ala digg/pligg

if you don’t have to worry about superhigh performance, you’re better off with innodb.

Well, for now its not super important, but presumabely if it ever gets really big the performance might be worth it right?

the difference can be important, but we’re talking eBay size.

Well, I don’t rationally expect to get that big, but I don’t want to plan for failure after all, howe difficult would it be to switch down the road, if I need the performance and have exuasted all other options?

a simple alter table

Oh, you can switch on the fly, i never realized that
So InnoDB on all, now I need to figure out the indexes

far more important for performance, really.

These indexes look ok: http://pasteosaurus.com/267

you won’t know till you match them up with the sql hosting queries and see. remember to use ‘explain’ before your queries and that will tell you what indexes are being used. Indexes are easy to add/drop.

I guess its time to go make the tables, and start coding the app then!

enjoy!

Yep, I’ll be back in a few hours with 100000001 questions :P
What type should I make my indexes?

trying to migrate an existing mysql install from server A to server B which has an existing install/users, mysqldump will not dump information_schema, any suggestions on how to accomplish?

is there an easy way to divide a TIME field by half?, I would like to hear some tip rather than converting the TIME to hour, second, minute, dividing by 2 and reformat

the default is fine

lo all

So 257 questions?

Has anyone tried to import a compressed SQL file into mysql?
I was trying to do so with a download of wikipedia’s link categories, and even though i ran it overnight – it just didn’t finish!

Haha, sure, I just took my Comp Engineering(ECET-100) Final today

(Size of the file’s about 1GiB)
Is there an efficient way of doing this rather than mysql -u user -p dbname file.sql?

If it is compressed you couldn’t do that anyway.

mhillyer, ah yes, i realized i couldnt so i had to gunzip it. or use bzcat on the sql.bz2

You could try SOURCE file.sql from within the client, but it should be the same. You might bypass some packet limits.

Crud, the description column I supposed to be 400 chars max, thats too long for a CHAR, should I use text instead?

hey, I’m seeing the message [Warning] Could not increase number of max_open_files to more than 65535 (request: 81930) .. then shortly after the server stops taking new connections.. is there a way to fix this?

man ulimit
but you’d better review your system, something must be fishy there

how so?

mhillyer, hmm, I did tweak my my.cnf file to something like this – http://rafb.net/p/s2giPa78.html – but that doesn’t seemed to have helped

one of the (more poorly written) programs that uses it constantly opens and closes connections.. but it should never hit more then 300 concurrent connections (bad, I know.. we are in the process of replacing it)

perhaps there’s something which i’m overlooking then?

Did you try the SOURCE approach?

mhillyer, well, i haven’t yet – i’m just cleaning up the messed up tables right now..

Use the source…

yep, started it now
hmm, so what exactly does this mean?
Query OK, 13716 rows affected, 2 warnings (0.92 sec)
13716 Duplicates: 0 Warnings: 2

open/closing is not a prob, jus tmake sure you have a thread_cache on the server side

it doesn’t seem to be increasing, OR decreasing in number
or is it that each query modifies those many rows?

hey, whats the default value for wait_timeout

do SHOW WARNINGS directly after that

its kind of a problem when it opens a bucnh, then crashes.. so they arent closed cleanly
or at least, thats what I think the problem is

- so it can’t be interrupted at the moment.

I doubt. if a process crashes, connections would be closed.

oor is there a way to send a mysql job to the bg?

righty. well the above would be the result of one insert or load data line. the warnings will be like data truncation, out of range integers, etc.
ctrl-z then bg
standard unix

hey!

ah i see!

the ctrl-z briefly suspends it, the bg will make it a background process. better to use screen though, but you cant do that with hindsight
aloha

arjenAU, yeah, its on my local machine, so i guess i’m ok
so, does anyone have a clue about how long it might take a 1.1G sql host file to get imported into the db?

10 minutes.

given a dual core 2.2gig intel with 2G of ram

depends entirely on a lot of things. “a while” might be the right answer

right.

But that assumes you have a badass RAID backend.

chances are your server settings aren’t optimal for such an operation…

Is this a legitimate query SELECT sum(Value) FROM table WHERE comment_id=7, and this will return the value of all the entries in table where comment_id is 7 from the column value?

mhillyer, hehe, think “laptop”

I can go with that

arjenAU, indeed. i did tweak my my.cnf file a bit based on som forum postings at mysql..

Come to Canada arjenAU, there’s a great Belgian chocolatier here.
They do factory tours.

we have some here ;-) but yes I’m aware. an been there. well, as far as Vancouver at least.

mhillyer, which part of Canada?

did a Cadbury factory tour in Dunedin, New Zealand. that was good ;-)

Southern Alberta. The guy is in Calgary.
Bernard Callebaut – http://www.bernardcallebaut.com/
Noo doot aboot it eh!

anybody else have issues with skype right now?

i saw something about that on isc.sans.org today, i thought, in the most recent handler diary there

yeah, couldn’t log in myself

I do arjenAU.
Reports say it’s down for about a day.

well has been for about half a day for me, yes.
that’s nasty.

Yes indeed.

apparently it is an internal software issue with Skype ( http://heartbeat.skype.com/2007/08/problems_with_skype_login.html
)

arjenAU, still around?

is there a way to get the actual create statement for a table from a query?

somewhat

hey again. your idea of using source worked, thanks – the system seems to have imported everything well! but, doing a select * from table limit 1; hasn’t exectued even after 5 minutes!

SHOW CREATE TABLE;
tada
SHOW CREATE TABLE foo; to be proper

thanks

hmm, so it looks like this query is taking eons to execute!
does anyone have recommendations for docs or resources to help increase resources granted to mysql?
i did tweak my.cnf – http://rafb.net/p/s2giPa78.html – not sure if i need to add something else?

hello everybody, i am a newbie with mysql, what is the best way to keep a coherant (relationships) database please ? what features should i look for in the manual please ? where or what google keywords should i look for in order to find example queries to clean a database ?
is it possible to use joins in a delete query ? not as far as i understand (probably not very far) the manual for DELETE
i have a class of objects (15k of them) data stored in 17 tables of the database, note that a few of these tables must keep MyIsam engine because of fulltext index … Thank you in advance for any tip, even the shortest of them

how would i go about enabling all privileges for a current account?

can’t
you need to alredy have them to enabled them

well i can login as root shouldn’t i be able ot change their privileges for other accounts from there?

that would work
it’s the GRANT query type you want

ahh okay than thanks

!man grant

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

thank you

have a schema question regarding storing a “large” (500,000+ records) that will be sorted
if I’m storing each record as a unix epoch time, indexing that column, probably isn’t a good idea, right?

only if there are lots of records at the same second

which there aren’t
so, should I then have “two” columns for time?

hmm. this is weird, i’m sure my cnf file has all the relevant innodb enable option but phpmyadmin still shows that engine as disabled!

nod, that’s usually quite unlikely with timestamps,

any ideas why this should be?

one for “date” and one for “time”

naw, that’d use up a lot more space, which would make finding records even slower

Xinil, depends on what queries you want to make

how should I be storing/sorting then?
is unix epoch not a good idea and I should be using datetime?

does anone else find myphpadmin buggy as hell?

Xinil, will you be sorting by this column?

yes
often

keeps logging me out

it’s very buggy

how do I see the queries coming into my mysqld?

like the actual php part of is n’t too good
it keeps logging me out and refusing to work with the correct pass and such

Xinil, will you be querying on this column, like between x and y ?

sometimes
like, count(*) where dayyesterday and daynow

Xinil, if you are going to make a lot of aggregates based on date, you may be better off with separated day and time

hm

Xinil, but i see no real problem on just indexing your epoch column, either

well

how would i go about checking my privileges for a user? It seems my root user has been restricted for some reason?

500,000+ records, that index is going to be massive, won’t it?
because each record is going to be unique
cardinality will be 500,000+

Xinil, on the other hand, the index’s selectivity will be grand
Xinil, 500000 records is not much for an index, i would not be worrying about that

hmm
well, the growth is quick, so it’ll be reaching 1mil in under a month from now

Xinil, i think it is mostly a matter of how your queries will be. if most queries return relatively few rows, then a indexless sort is not a great pain
Xinil, if most queries are by date or a rage of whole days, a day index is more efficient

well, i’ll be using an indexed where statement

Xinil, but i have divided such a column in the past into a day column and a time column, and regretted it when i had to do queries with timexone adjustments

where mem_id=8 AND timethen AND time now

hey guys is it a bad idea for me to edit the mysql for my permissions manually using a gui like cocoa mysql?
i’m just changing the permissions from N to Y then i just figured i’d reload it and it’d be fine?

thanks for the help gnari. I’ll stick with unix epoch for now, it won’t be too hard to change in the event it turn sugly

Xinil, a good rune is not tooptimize prematurely. keep your schema clean, until you know you have performance problems
Xinil, should be easy for you to test it. just populate a similar table with 5 000 000 rows and see how performance is

unfortunately, i often optimize too little, so I’ve recently begun to delve a lot more into indexing and watching mysql take less and less resources
good plan

Xinil, well indexing is not optimizing in my book. that is just tuning, one should constantly do that

haha hey how do i log in using console from 127.0.0.1 instead of localhost?

Xinil, optimizing is making changes to your table schema or modifying your queries

this is going to sound really weird but i somehow don’t have permissions on localhost but i do on 127.0.0.1

anathematic, have you tried just connecting to 127.0.0.1 ?

how do you mean sorry?

anathematic, what is your connection string?

i’m trying to find out which position someone is based on how high their score is… anyone know how to do this?

well i’d been trying to connect using mysql -u root -p
however i don’t know wh at parametres i need to connect to a certain address?

snoop-, count how many have higher score

i guess i need to find the variable page

anathematic, -h 127.0.0.1

it woudln’t let me connect : “ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1′ (111)”

‘t
rewrite /server-status
whoops
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 mysqld

i am making a website users table and I have a selection list of 100 checkboxes, which may grow, how should I store that? a field for each or do it bitwise with a double or something?

I didn’t know a process can use more than 100% of a processor, hah

snoop-, what about select count(*) from foo where score(select score from foo where name=’x')

is it legal for a foreign key to reference it’s own table?

yes

foo, dual/quad-core

skull–: no, store them in a separate table

Is that a question?

foo, no, its a statement

skull–: checkboxid, state

a separate table with 300 fields?

To me?

delete from table_foo where id_foo not in (select id_foo from table_bar) ? mysql reports an error at occurence of where word

gah. ok, can someone tell me if i should be facing a ridiculously long time in executing a “select * from blah limit 1″ query on a table with about 16,000,000 records?

checkboxid, state, userid right?

I didn’t know a process can use more than 100% of a processor, hah

skull–: yes

ohhh, err, yeah, I kind of thought that.
Thanks
Now to figure out why it is

foo
vIkSiT, select * is stupid, and yes, it will take ages

tibyke, so assuming i wanted to return just one row of the table – what would you suggest?
oh i see – a select * would select all records, and then return just 1?

no, select * return all columns.

vIkSiT, * is horizontal, fields.

and the “all records” probably takes the long time. hmm.

wrong.

vIkSiT, 16.000.000 and limit and order by is the slow part

hmm i see.
so how would you recommend i work with this table?
assuming i wanted to see the first record of the table?

index the field your order by

For some reason a query from the replication thread (this is a master/slave setup) is what appears to be locking the database… so other queries get stacked up, load spikes… any ideas? I can’t figure it out why this is happening all of a sudden
uFor some reason a query from the replication thread (this is a master/slave setup) is what appears to be locking the database… so other queries get stacked up, load spikes… any ideas? I can’t figure it out why this is happening all of a sudden/u

thumbs, sorry, not sure i followed that

foo, show slave status;

index the field/column you use to order your query.

i could do something of the sort “select col1 from foo order by bar” – but how does that help?

Nothing weird there, other than seconds_behind_master gets 10-500 seconds behind master when this happens

then index the `bar’ column vIkSiT
`bar`, too

foo, and what happens then? whats the error msg?

Nothing weird there other than seconds behind master … eg. there is no error message

an index wont help too much with 16M records and a limit/order by, im afraid
foo, and you wait, and what happens later? it “comes” back?

Usually, yes. But right now it’s constantly locking up the database for some reason. A that’s causing processor usage to be 100%
This has been running fine for months… don’t know why this would happen all of a sudden. Database on this slave is 8.5GB

show processlist;?

What am I looking for there? I just see 90 queries, and one insert from the replication thread… all other threads are in state LOCKED

so you got it

I’ve already said/noticed that.. my question is, why are they locked.
This has been solid for months, and all of a sudden this
No reason for them to get locked up. And I checked all tables with check table … extended; 10 hours ago, everything was fine

other insert/update is locking the table

and probably still is, so I doubt it’s table corruption
Right, so it’s taking longer than normal, I wonder why it’d be taking longer than normal

check that very query
my crystal ball is broken

shoot, it is?
hmm
insert into newtable values(LAST_INSERT_ID(), ‘Commodities and banks bear brunt of market slide’, ‘The FTSE 100\’s 4 per cent tumble was the biggest daily decline since March 2003, as intensified credit market fears fuelled a sell-off that hit banks and commodities hardest.’, NULL, 108, 669,
‘3c966145e5a3f10a162dd1886bdea151′, 1187306242, ‘http://business.scotsman.com/markets.cfm?id=1300082007‘, ‘Commodities_and_banks_bear_brunt_of_market_slide’, ”)
the State on that query is LOCKED

how do i reset the permissions for my root account?
i seemed to had slipped and changed them so i can’t do anything =\

Can LAST_INSERT_ID cause the lock up? I’m not the programmer for this project

reset root

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

foo, yeah, that LAST_INSERT_ID() is pretty strange there

Is it possible that that could cause the lockup? I’ll talk to the programmer about this… but, I’m not sure

foo, dunno, but give it a try

thumbs, could you perhaps point me to a resource on table indexing?

thanks

!man indexing

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/indexing

!man index

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

i was just looking online, but i’m not sure if there’s a comprehensive resource which explains what it means, and not just hwo to do it..
thumbs, thanks, will take a look

nah. doubt it. It’s locking up on an update as well.

do you have any locking statements ahywhere in your queries?

Doubt it, but let me confirm. I don’t see it in this processlist at least
Yes, we do. Wouldn’t I see them in show full processlist;, though, if that was causing the locking?

well locking the WHOLE table, or a ROW, could have disastrous consequences on the performance of your system
for instance
if your update takes ~3 seconds, you just delayed every other query that needed to access that table by that much time.

does visual sql creator exist for mysql, like in access db?

and if the other queries want to do locking too, your query queue just got astronomically larger.
try phpmysqladmin or something

is it really that bad to put underscores in table names?

skull–: it’s allowed

but frowned upon?

skull–: to be safe, always use backsticks when referencing a table name
skull–: it’s allowed.

i want to join 3 tables in select statement , i don’t think phpmyadmin allow to create such queries visualy, i found Visual SQL-Designer in google, maybe this is it
i heard you can put one select in another
i wonder what should i use join, select in select or union
i think i said something lame

if you have 3 tables and want to use them all in the same query, you can use joins to combine the results.
figuring out what join to perform, and on which columns, requires design skills.

thumbs, truth!
fulketerraun, selets in another is called a subquery

hey hey

hi

anyone know if there is a php function to check if a key already exists for a table?

is there a way to drop all tables at once?

that question would be better suited for ##php
no. Drop them one at a time

you can in phpmyadmin i guess

heh
yeah

using phpmyadmin is not recommended, however

you can’t truncate database?

script it.

!man grant

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

alright, thanks

thumbs why is not recommended?

because you start asking lame questions about sql syntax ?

In the beginning was the CLI…

concerning phpmyadmin

what will happen if suddenly I get lots of queries that my server can’t handle them?

it’ll queue them

will queries be slower?, crash?, something?

they will line up and take their turn.

nice

for one, it promotes lazyness, and misdesigned queries

without jokes, why phpmyadmin is not recomended?

it’s especially bad when used to import/export data

what should i do if my root@localhost permissions have been changed so it can’t do anything?

it’s known to mangle data

it’s an attempt to guess what you mean and create a result. It makes errors. And it keeps you from learning the right way to do things.

you could reinstall the user tables (rename, and so on)

anathematic stop mysql, start mysql skipping grant tables, reset password

!tell anathematic about reset root

anathematic See http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

i see

i tried that but it didn’t seem to help
the permissions for root@127.0.0.1 are fine but @localhost they are restricted
but it won’t let me log into mysql through 127.0.0.1 =\

anathematic, well, then reset it
are you on unix?

yeah unix
*ubuntu

anathematic, do you know how to stop the server and start it?

yeah but it doesn’t seem to be resetting permissions when i’m starting it using “–skip-grant-tables –user=root”

anathematic, it’s not automatic, you have to reset the password manually

it’s resetting the password but not the permissions
yeah i set the password again
however it’s not reseting the permissions with that command
: i need to reset the permissionf ro root@localhost to all again

hello again
how do I check if a KEY exists on a table using SQL?

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

do you mean check for an index? ’show create table tablename;’

Failed: ALTER TABLE {users} ADD KEY created (created)
because it already exists

http://pastie.caboo.se/88469 it
oops sorry, yeah chuy_max it’s not interested in giving me any permissions to do t hat

you can also query the info schema. http://dev.mysql.com/doc/refman/5.0/en/columns-table.html

so i need to check somehow if the key “created” already exists
key = index?

you’re inventing syntax. read the manual.

sorry the sql is being processed by Drupal so i guess it must do a regex and change KEY to INDEX

I thought Dru Paul was a drag queen?

how is ADD KEY not mysql syntax?

there is create index

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

for alter table, add key is there, same as add index

ADD {INDEX|KEY} [index_name] [index_type] (index_col_name,…)

but has to use inside alter table

right, but i was told that i was inventing syntax and that i should read the manual

there is no ADD KEY without ALTER TABLE, there is CREATE INDEX for that

thanks kimseong, i had posted the following:
ALTER TABLE {users} ADD KEY created (created)
which is failing because the key already exists

the name `created` already exist or the col created already indexed ?
what is the exact error message

so i was wondering how to check if the key already exists so that i can incorporate that into my code before the ALTER TABLE is run

show create table , show index

ALTER TABLE users ADD KEY created (created)

even information_schema
so the problem is the index name, ignore the name and it will be fine
ALTER TABLE users ADD KEY (created)
the name is optional

gotcha
but won’t that create an extra index, i.e., created2?

!man adduser

Sorry – I have no idea what function you’re talking about! but try http://dev.mysql.com/adduser

!man add

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

haha~ mmm functions for adding new users?

show create table , show index are these SQL commands or mysqladmin commands?
nevermind got it

they are sql commands, but you may have trouble using their results in other queries. Look to querying the information_schema db.

not sure if my code will have access to that DB
if it’s a separate DB

there is also the issue of mysql version
http://dev.mysql.com/doc/refman/5.0/en/information-schema.html

it looks like SHOW INDEX FROM users will return rows and i’ll just need to loop through the rows and check if Key_name ‘created’ exists

“It is possible to select INFORMATION_SCHEMA as the default database with a USE statement, but it is possible only to read the contents of tables. You cannot insert into them, update them, or delete from them.”
do the looping from your application code, I believe.
?

right, in php

there is a bias here against using app code, but I don’t share it.

information_schema doesn’t exist in my db anyways
i’m all for doing it within mysql if there’s a single query i can run, but it doesn’t appear to be such a thing

IF EXISTS (SHOW INDEX FROM users WHERE… )

some of the big guns here could do it with variables and stored procedures, I think. Not me.

thumbs YOU ROCK!

no need for a stored procedure
albeit that is bordering on TSQL code
anyway, the principle is easy
if value exists within the resultset, then execute query

hmm

or in your case, do IF NO EXISTS
NOT

yup gotcha

can show be used as subquery?

so start the query with a case?

I thought not

thats what i thought too

it might not. I would try to find a suitable SELECT query to replace it, however.

I think that is where info_schema comes in, if your version supports it.

yes, it definitely cmoes in handy at that point

SHOW INDEX FROM users WHERE Key_name = ‘created’
and if it returns a row i know it exists

!man grant

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

you could.

that’s manageable!

I concur

thanks for all your help!

de nada

http://img136.imageshack.us/img136/5113/52757166gb2.jpg how to ger row that contain: colorSetName, colorName, taste?

thanks wench

It’s been a pleasure serving you, threnody.

*get

I love that

where ?

!man join

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

read that
more specifically, you need an INNER JOIN

0
you means me
but not in thank you

de nada

what port does mysql run through by default? (how can i find out what port mine is on?)

/bin/sh: grp: command not found

3306

so im setting up mysql cluster, and apparently it hates me

I like boobs, and your mom has aids

nice one

lol

so i’ve got 9 linux computers, and i setup mysql storage nodes on 8 of them, but they all get stuck initializing at phase 1..

that’s because you’re using 8 386’s at 4mhz

haha
no
8 p4’s
well, 9 p4’s
though, they only have 256mb ram each

perfect candidates for vm servers

the resources online made it *seem* like everything would be pretty straightforward — and it was
cept, using ndb_mgm shows that the nodes connect, and are stuck at phase 1

perhaps try the mailing list

i take it nobody here has messed with it?

i’ve started using backticks since I joined this channel 2 hours ago, I edited the checkbox table though and took off the state, if there’s a value then it’s true otherwise false, is that a bad idea? (to recap: table was checkboxid, state, userid, now checkboxid, userid)
the state was BIT type and was coming out as 01 and messing with me, I didn’t see a point

silly non-working documentation
actually, its probably just something silly i missed
tnx, im out

what variable controls how long processes can sleep before being disconnected?

wait_timeout?

show variables like ‘%timeout%’;

I was just going to say thta

there are 2 type of timeout for connection

wasnt sure if it was wait_timeout or interactive_timeout

what you tell your gfriend when she’s angry and with aunt flo
sorry

I don’t think my wife will let me have a girlfriend but I will ask

don’t ask that

then you’ll need a wait_timeout

let her bring it up

when i switch from myisam to innodb.. do i need to adjust my mysqldump lines for that? or complete nothing has to be added/changed there?
i regulary backup some tables and i wonder if it will be fine with innodb still
completely*

should not need to

thank you scooby2
just making sure as i heard that innodb is kind of scary

it can be

data corruption etc.
still not sure if i should switch from myisam at all

thats not too bad
the double write is what is killer but row locking is worth it if you need it.

and is it possible to go back to myisam from innodb?

sure is

hm so nothing that i can’t change back, sounds good
row locking.. what exactly do i gain with that?
i’m mostly looking for performance boost

not sure you will get that with innodb
depending on what you are doing
it might be slower

but can it also be faster?
i’m using some specific software that utilizes mysql heavily

when you write to a table with myisam it locks the whole table, does the insert, then unlocks it. thus only one write at a time.

and i wonder if it can be optimized for innodb rather than myisam – does it make sense?
hm.
oh wait, does locking a really BIG table take time?
i mean really big one
with like 140+ columns and 2 rows
2k rows

yeah. i use innodb on our 192gb events table because it does well with lots of inserts

and that table is being updated constantly, 10s of times per second often
damn
so the locking stuff could be evil

i think we went over a billion rows yesterday

damn damn
a billion?
192GB db you mean?

yeah that db is just over a billion rows

congratulations

grows at 4-5 million per day

i could make coffee for everyone 10 times a day just to be able to touch that db lol

i need to break it up but the report people dont want me to break it up by year

i never heard of a bigger mysql db yet
he he
they are always like that lol

yahoo has much bigger i hear

so basically you recommend innodb for any database with big tables that are being frequently being written to
as that takes locking the whole table with myisam each time it happens
and it’s diff with innodb

yeah sounds like its worth a try

btw does yahoo really use mysql?
i thought that such big databases are mostly oracle
glad to hear that mysql does the job for billion rows

i know all their finance.yahoo.com is mysql

http://mysqldba.blogspot.com/2006/11/unorthodox-approach-to-database-design.html

damn nice
hm skull–… i will certainly give it a read – thank you very much
but again, i can imagine a software performing better with innodb
e.g. when there is like hm 1
err
when there is like 1000 updates needed
and when it doesn’t queue them

500gb of mysql data to replicate
damn

scooby2 he he
….so with myisam it would take 1000 locks of the WHOLE damned table

at least $250k in network gear in that diagram i’d think

and that purely depends on the software right? if it tries to update in real time instead of e.g. collecting those 1000 updates, locking once, updating etc.

which might not take long depending on size, memory on the machine, disk

nice skull–

replication is what keeps most sysadmins/dbas sane

i got fired from my networking job last week for telling the receptionist I had my resume on monster, as soon as I walked out the door she called the owner and told him and he called and fired me. Now I got my wish of time to work on my projects

ouch

nah it’s good, i was looking for a reason
I’m using my free time wisely.

going to get unemployment atleast?

oh yeah, applied before 5pm the day i was fired
have to wait a week before it starts though, might have a job before then though, had 2 interviews this week

nice

hello

Hello

i’m not able to read table content
from mysql (console)

is your monitor turned on?

i need to read what i wrote but i dont want to use this information

permissions?

¬¬
i have permissions
im conected
what mor?

charset

http://mysqldump.azundris.com/archives/60-Handling-character-sets.html

how can i read?

Knows what she’s talking about, that Azundris!

So does that wench.

i don’t found the command
to show this information

&?

anyone knows a simple mysql databases viewer, for windows?
I have my .sql db and would like to view it

load it into a mysql server

I can do that locally in my computer, no?

yes

because the .sql was saved in a server with a newer mysql than the one I would like to import the database

how different are the versions?

chaos1 mysqld[17878]: lock: 0×8c913d8: … how can I further troubleshoot this? Or, can I?

the server were I try to import it is MySQL 4.0.25
and the version of the server where it was saved was.. 4.2 I think
MySQL version 4.1.22-standard
I saved the .sql in a server with that version of mysql, 4.1.22-standar
and I would like to import it in a server with mysql 4.0

how do i set all my null fields to 0?
ohwait never mind haha

hello
need a little help! I have a server running a localhost mysql server and another server at 192.168.0.2
the problem is, whatever server I use, the connection is ultra slow
the server load is low
there are just a few processes showing when I type SHOW processlist
what else should I look for?

I am getting a strange icon when I hover the mouse over the table area in MySQL Query Browser. Icon has the word “set” and won’t let me do any of the normal functions like selecting areas of certain tables.

did you click on a SET button on another toolbar?
connection is slow, what server hostname you use to connect? hostname or ip address
try ip address and see if it is faster

kim, ip address
both are slow…
and not a specific query
most queries
I really do not know why

slow on the query or on the connection? i guess on the query

on the query

then you query not optimised of server setting not optimised
s/of/or

the problem is that this happens with any query
even with the simplest you can imagine

I don’t recall clicking on anything. How do I shut this thing off?

but in particular with INSERT and UPDATE queries

select 1;
click the pointer on that tollbar that has a lot of set, where, group by, and so on
check your show status
and looks for hints

Are you referring to the menu bar? I don’t think I know what you are talking about.

not menu bar

What are you referring to?

below the text box
looks like round round things

Which text box are you referring to?

the big one at teh top where you can enter sql

What part of the screen is this in?

below the menu bar, there is a text box, to enter sql statement

I don’t have anything below the box for entering text. I do have a round refresh button to the left of the text box. Is that what you are referring to?

linux?

hey guys, on freebsd, im trying to start the mysqld 5.1 server, and am receiving the following errors, while logged in as root: http://dpaste.com/17086/
how can i allow access to the database files?

I am running MySQL in a Windows environment.

i know linux don’t show that and not sure how to get that
windows, should have

What should windows have?

menu bar at the top
follow by a big text box

What do you want me to do with the menu bar?

then below has a toolbar with many buttons

And what do you want me to do with a big text box?

take a screenshot, post it somewhere

rycole, can you read english text?

screenshot of what. I really have no idea what kimseong is referring to……

let me see if i can find a link

the screen you’re looking at that’s causing you problems

We first need to establish what we are talking about……..

yeah, i asked how to allow access to the database files because the error is obviously telling me it cannot access them. can you read?

that would at least seem to be a place to start

rycole, ls -l, and think

Okee http://www.mysql.com/products/tools/query-browser/main_query_window.png

I don’t have any of the buttons you have provided in your png file. My version is the latest.

i refer to the round button, select from where group and so on

I don’t have those round buttson. Sorry.

try view menu and see if it is disabled

kim, I tried looking at the show data

if you have ’set’ tooltip when you move mouse over the table column, you probably had the SET button clicked

There is nothing in view. I am using Version 1.2.12

the only thing I see that could interest us is that there is a table where many queries are occurring that shows always its status as LOCKED
but that was not the table I was trying my querie on

i don’t have a running version installed, so cannot help much, but I alwasy have that on windows, but don’t see that on linux

Where do I find the SET button?

some query/connection is holding a lock
nevermind, just close and start it again

Well it went away after I closed and reopened it.

kim, would it be a problem if just queries are showing as “LOCKED”? I mean, would it affect other tables as weel
the table has 1000000 rows

there are nice tutorial http://www.mysql.com/products/tools/query-browser/ see the left bar
means someone else has locked or is using the table and this user has to wait

im not sure. i adjusted the permissions of the mysql directory, and no longer get the permission denied error, but still get the remaining errors saying it doesn’t have the ability to issue the ‘create’ command.
am i running mysqld as an incorrect user?
im logged in as root, shouldn’t that work? im new to freebsd.

show grants for current_user();

kimseong, the server isn’t running – i’m trying to get it started

ops, then what does create got to do with starting the server

i think it’s trying to create some initial database file, or something? im not sure. the output looks like this: http://dpaste.com/17087/

rycole, you have the mysql database files?
man mysql_install_db, check the existence of those files

creating the tablespace file
still have the error 13?
!perror 13

Permission denied

that is not the problem

mysql -u user -p -h site.com Why would this not return an error, just idle after I enter the password?

you start it as root, but mysqld usually start with a mysql user of group mysql

I am using BIGINT for a phone number with hyphens between the area code and the number and it is still getting truncated. Any idea what I am doing wrong/?
?

bigint is a number
hyphen is not a valid digits

ok

derekl idle for how long? anything after a few minutes?

Is there a way to put a space between the numbers of an underscore? Or will it accept it?

no
number accepts digits only

yes, i already ran mysql_install_db, i read that on mysql.com docs

then did you see the file and directory permission change ?

so will SELECT DISTINCT return ONE of a value that’s listed several times, or NONE of that value?

How about numbers and spaces between the numbers?

no spaces
space is not a digit

entendu, mysql.com/doc?

yes, i saw that output. it said it created a mysql user, but wasn’t prompted to set a password of any sorts.

no need password, make sure the datadir is owned by mysql os user
chown

Well, i mean I see what it should be doing, but I swear to god it’s axing them rather than selecting just one

compare the result with and without distinct

looks like it’s owned by root.

thats the problem, should be mysql instead of root

mysql group, as well?

yes

cool, appears to be running

really guys, am I going crazy?

This is weird. I am trying to update a field for email and telephone and it won’t return back a result set. I am using the following UPDATE south_databasefinal.vendor
SET Email = ‘mprosser@privaris.com’
WHERE Email = NULL;

is null

I have the following query:
http://pastebin.com/d3f64c8f3
I want to find users though that have a count of 0, how do I do that?

http://pastebin.ca/660674

Delixe, having?

oh…

where count = 0
lorl
also why ‘WHERE 1′ ?

having is for group
i think?

oh okay

d03boy, and group is for count

WHERE 1 is a good way to build dynamic queries

‘a way’

‘a good way’

-good

isnt WHERE more efficient than join?

hehe

+good

having doens’t work

where is not an alternative for join.

They are used for different things

EoN my query will not find users with no count
Oh I know what’s wrong…heh

but join = better practise than using old technique of where id = foreign key etc.

‘practice’

yeah that.
\o/
two words i have spelt wrong since early age are ‘practice’ and ’sentence’
no idea why. one of those dumb ass things.

is it possible to rename a database (a schema) after its created?

unpossible!

:/

actually I dont know. i would assume its possible as long as it isnt a foriegn key or something.
but I dont really know anything..

lol, ok, thanks for being honest

Would anyone like to take a crack and forming a set of Join statements on one of my databases? I can’t figure it out. I would probably have to email you the database.

or… you could just show us the schema

I can try. It is a bit complicated. Hold on and I will try pasting it into a pastebin.
Create a report that shows the Company Name, Order ID, and Total Price of all orders that have a total price higher than $10,000

what are your table naems
names

I was about to get that. Table names are categories, customercustomerdemo, customerdemographics, customers, employees, employeeterritories, order_details, orders, products, regions, shippers, suppliers, territories, usstates

do your own homework.

where does the mysql 5.1 configuration file reside?
i can’t seem to find it

You guys have a way to do a two-way replication yet?

Unknown column ‘Quanity’ in ‘field list’ Error 1054

how to reset mysql root password?

Hey guys
http://pastebin.com/d6feb2534
I have the following query but I want to find the NUMBER of rows returned
GROUP BY occurs and forms its own count
how do I find the count of rows?

is it possible to change mysql to not be case-sensitive on table names?

hello. I’m trying to query mysql via java PreparedStatement execute method. I want to insert multiple records in one statement, is this possible? I have statements seperated by semicolons but it says I have an error in the sql syntax. the syntax works if I only insert 1 row.

I am not an expert on this stuff but if you want to count the number of rows I would think you would use something like COUNT(rows) instead of COUNT(*)

Does each one of your rows equate to a tag?

jwisher, kinda hard to tell unless we see the line

I think you should use comma to seperate those statement

ya, semicolon doesnt make sense

how do i update a value of one field with a value of another within same query?

subquery

hm.. that’s something new to me, can i write one?
like query within query with if or something?

you surely can

hm..
i will explain what i’m trying to do, perhaps it fits that:

what’s returning are 3 rows with a count of how many tags a user_id has

i need to find all fields in some column that have 0 and in that case they should get value of a field in another column

UPDATE …. WHERE column1 = (SELECT whatever FROM blah)

d03boy hmm… wow

Instead of a single COUNT value of how many rows are returned.

well… I’ll paste a line
INSERT INTO `shop_orders_customer_details` (`order_id`, `attribute_name`, `attribute_value`) VALUES (‘8923849′, ‘first_name’, ‘lol very funny computer!!!’);
it is just that line repeated over but with a different values

d03boy that’s really tricky

Are your rows identified by a Primary Key?

yes

I would count your primary keys to get your rows. I did a problem similar to this and it worked.

im going to bed in 5

yeah you can insert multiple records in one line:

SELECT COUNT(ItemTag.id) AS `count` does not work….

anyone have an idea what I am doing wrong with this –http://pastebin.com/d471d2852? I am trying to get the following configuration: http://pastebin.com/d471d2852

INSERT INTO table_name(field1, field2, field3) VALUES (‘val1′, ‘val2′, ‘val3′), (‘val4′, ‘val5′, ‘val6′)

What error message are you receiving?

that’s not your whole statement is it?

no
http://pastebin.com/d6feb2534

what’s the error you’re getting? (or, “What Okee said”)

oh, cool that works, thanks!

Hi noob question here, is it reasonable to have like 30 queries per page? could something like that scale? assuming they are mostly simple select all indexed?

Anyone have an idea how I can do this –Create a report that shows the Company Name, Order ID, and Total Price of all orders that have a total price higher than $10,000 with this –http://pastebin.com/d471d2852??

no .. 30 queries per page is way too much to scale

haha

seems like a lot, but it all depends on a lot of different things

you want to get down to a handful of queries on login

you can make indexes and stuff

One of the problems that I am having is that the OrderID is showing up in more than one table. I am doing something wrong, but don’t know what.

and then maybe 1 or max 2 during normal operations

having ?

ideally none
using caching

/etc/init.d/mysql restart
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.

but it depends on just how dynamic your content is .. but usually to scale on a site where you have a lot of reads over writes

dont paste in here

i keep getting the 3rd line, is it ok?

What were you alluding to?

you want to devalidate the cache on write .. and then just have the first reader fill up the cache

depends what you’re doing. you can probably group together a lot of your results for fewer queries, but your sql skills are: fAIL

I can see getting down to 20 querys with major code rewrite

nevermind, i did not see the pastebin

really hard to cache every page is personally generated for every user and if i pregenerate the lifetime would have to be very short

Would you mind taking a look at my code and telling me what I am doing wrong –http://pastebin.com/d471d2852? I am trying to do the following: Create a report that shows the Company Name, Order ID, and Total Price of all orders that have a total price
higher than $10,000

and would only be possible really for a few pages
i mean really hard to pregenerate
that was an option I was thinking about
so whats like the rule of thumb max querys you could have per page? 2 or 3?

you should do your own homework
but i’ll have a quick look
what result are you getting?

I guess everyone else on here should also? Right ?

bit much atm okee, i can have a look later if you’re still looking.. got some work to do

I am going to bed. It is late, but would much appreciate you emailing me your suggestions to xx1@att.net Thanks.

haha

together with the bill

so whats the deal guys 20 query per page is still insane? do you know any type of docs on this? google doesnt give very much

mariorz, i think it totally depends on how complex the querys are and size of the tables

it says flickr does 25-35 per page not much else

you do whatever number of queries required to ge the work done

I understand that man I just want to know if what im trying to do is crazy

maybe you should just ask us then

i am

best is 0 query every page

it was the is having 30 querys per page insane part

nothing insane about, unless redundant

show us the queries. good chance you could group some together
but if not, its not that bad. depends on your traffic.

depends on all sorts of things

exactly

is it better to place all 30 into 1 stored proc and have 1 call from the page?

it’s an option
and probably is more efficinet. not necessarily more maintainable though

option? that is jsut moving the problem around

give me a sec to pastebin the querys, not really a pro just doing it to learn so my traffic isnt big at all just want to do it the correct way

no its not, because its one db connection/call instead of 10
30

ok so i bared it down to basically the querys on the page http://pastebin.com/d28613579

all the same selecting fbid with different where condition ?

dif tables

oh different tables cannot combine to single query, except with union
select … union select … union select … and so on
maybe union all

you mean make those 3 querys into 1?

is that what you want? actually 3 query is fine
even 30

no i want to know if that is not scalable

scalable? what do you mean
scale what?

well woudl it be feasible to have somthing liek that on high traffic site

what difference does it make?
you need the data, do you want to scrifice the output ?

i want to learn how do it right

are those $commafriends and $commanids etc results from another query?
if so, you could be using a join etc.

rest call

as far as those queries, they’re probably ok to stay seperate, as kimseong says
also, only use DISTINCT if you need to. (im not sure of your data)
if you dont need it, dont use it

no actually i dont know whats there i dont need it your right

LIMIT with no ORDER BY does not make much sense

no scratch that

Hi #Mysql’ers… I’m trying to construct a LARGE database of triples, but the insert process has been running for a week now and it’s not even halfway done, so I’m obviously doing something wrong. Anyone care to have a look?

i do on 2 querys but i could do it trough php is that better?
like array_unique

what is ‘triples’?
no no, distinct is fine… if its actually doing something

basically, a table with three columns

it depends on the data you have

if you have a where pk=constant than distinct is not required

also kimseong is right limit is usualyl only used with order

I was thinking limiting the results somehow could save resources?
because i do some other non db stuff with each reusult

think about what data you want, resources come next, you do not want to save resource to get nonusable data

good point
one last thing is it worth I look into a way of getthing those 3 querys into 1, using maybe csv or something and then having php divide the results?
my querys would go back from 40 to 20 max i suppose

I finally figured this thing out.

touugh my db design i feel would be more sloppy?

I have a cluster of 20 opteron machines inserting into the database. First I started a mysqld server on one of the machines and let the others connect to that, but when that turned out to be too slow, I set up each machine to have its own database manager, and insert into its own table, which is
on a shared network disk.

hello. i have a mysql dump from mysql 5, is there any tool that i can run on it, in order to import it on mysql 4 ?

can you redump?

will take a while since the guys sitting on it is at vacation (3 weeks) but if it’s the only option…

mind the ‘compatible’ option of mysqldump

tibyke, thanks

yw

maybe I better rephrase the problem. What would be the optimal way to populate a simple but large data table (just 3 columns) in mysql. Right now it’s about 36Gb in size, and inserts seem to have come to a crawl…
I expect in the end it’ll be about 150~200Gb

ok, seems like this should be easy, but… i have a table with 3 columns: id, date, amount. and i want the set of records that has one row per date, and the row that corresponds to that date, and has the largest id

Comments off

if every block of data is different how can you not insert them one by one If its the same whats the point of

SELECT t1.* FROM table1 AS t1 LEFT JOIN (SELECT * FROM table) as t2 ON (t1.field = t2.field) ?

i dont think you can do that
simetrical, any idea how to do this?

Athfar, I dunno, try it.
seventoe_, you want something like SELECT * FROM photo_comment JOIN photo USING (id) ORDER BY rating DESC LIMIT 10, say, for the ten highest-rated.
(you may need to replace “USING (id)” with some more appropriate join condition)

select t1.* from t1, (select t2.id from t2 where something) as t2 where t1.someid *= t2.someid

what do you use to view the query of a view?
I forget

Athfar, I don’t know anything about views, I use apps that are designed with MySQL 4 compatibility.

simetrical, i want the photos with the highest ratings and most comments, how could i do that?

Oh, wait.
Hmm, I see.

yeah its hard

There will be many comments for each photo, obviously. I just gave you a query to select the comments that give the highest rating.
No, not really, but it will be inefficient if you have a very large number of photos.

this part is going in a low-traffic area, so that shouldnt be too much of a problem

SELECT * FROM photo JOIN photo_comment ON photo.id = photo_comment.photo_id GROUP BY photo.id ORDER BY AVG(photo_comment.rating) DESC LIMIT 10 for the highest-rated, and SELECT * FROM photo JOIN photo_comment ON photo.id =
photo_comment.photo_id GROUP BY photo.id ORDER BY COUNT(photo_comment.id) DESC LIMIT 10 for the ones with the most comments.

see, that looks complicated to me, im still a noob at sql-stuff :-/
thx though
now how would i limit the comment one to the most amount of comments posted in the last week?

0 GROUP BY photo.id ORDER BY COUNT(photo_comment.id) DESC LIMIT 10

I’m not totally sure on the DATE_SUB syntax.

k, thanks

Mostly I work with UNIX timestamps, so I would typically just subtract 86400*7.

yeah, my team insists on DATETIME fields… makes everything complicated..

what is the most perferred method of backing up a php mysql web hosting database (or several)? Can i just kill the server and copy the files over?

is it possible to cast a varchar as an INT (because some idiot made this and i can’t change it)
I have zip_code fields like 02343 in one table and 2343 in the other
and i need to compare the two

Como|Lappy, that will work, if you don’t mind the downtime.

not at all, its a personal database.
Now i just have to remember where the files are located…
this isnt really mysql related, but if i did a recursive copy of the root drive can you think of anything that might cause problems?

Damn Comcast.
Is there a #comcast_sucks? :P

Como|Lappy, you would have issues copying some of the special or not-really-existent files. To minimize that I suggest you avoid leaving a single filesystem, but you still tend to get slight oddities. Overall it works well enough. Although note, it won’t be consistent, if that’s
important.

well it just occured to me that hundreds of hours of my work are on that machines systemdrive, without a backup in existance

That’s probably not good, no.

configurations, databases, scripts, personal web hosting photos, etc
basically i’d cry myself to sleep every night if it were to dissappear
sooooo, its time to back it up
but i’ve never done a linux backup before

rsnapshot is good for periodic backups.
cp -ax works well enough.

rdiff-backup is good as well
does incremental backups etc

You may want rsync so you can easily back up remotely.

damn information overload you guys are

well for now, the system has a raid5 (software) running on it
i know if the systemdrive went down i’d have to rebuild an OS to access the raid array, but i think i just want to backup to that for now
in a few months i’m rebuilding the server with a hardware raid1 for the system, or possibly just a raid6 and run the system off the array

my fileserver has 2 x 80gig in raid 1 for th OS, and 4×500g in raid 5 for the data

nice. currently i’m 1×80 system and 4×250 in raid5

running on a ups that somehow managers to last 55 minutes if it loses power.. so i think its setup for the long haul

is there like an ISIN ?

if i can trim down the data on the array i think i might go ahead and do 8×250 raid6, because i’ve got the drives

ISIN a resultset

and a card

so ive eliminated a lot of risk to the hardware.. cept it doesnt fix me doing something stupid like rm -rf /
yeah im going to buy another sata 2 card, and stick another 4 x 500’s in there..
i think

yeah, doing something stupid is one of my fears

i dun particularly want to do a backup of 2tb to disks though

i /could/ make 2 seperate arrays

http://pastebin.ca/670886

yeah when i get more im going to make it in a different array, and use LVM

the ISIN is just kinda made up

two sets of 4 250s, and use one for my music collection and one for everything else

cause the risk of losing 2 hdd in 4 is pretty hard, but loosing 2 in 8 is a lot worse odds

k #hardware please

is there something wrong with your query?
or..?

yea it probably doesnt work heh
I am comparing a single field with a resultset

Don’t you want IN, not ISIN? Otherwise I imagine it would work in MySQL 5.

I dunno i am making ISIN up lol

i think IN would work for you
wher eblah in blah

do you have a the link to the reference to IN
i can’t search and find it

!in

!man operators

see http://dev.mysql.com/doc/refman/5.0/en/non-typed-operators.html

Bah.

wow Ii can’t believe that worked and i just kinda made it up
wow Ii can’t believe that worked and i just kinda made it up

Should be pretty efficient, too, with the right indexes.

yea took like 2secs
thanks!

ok.. one last question before i leave you alone..
SELECT * FROM photo JOIN photo_comment ON photo.photo_id = photo_comment.comment_photo WHERE photo.photo_featured=’0′ AND DATE_SUB(CURDATE(), INTERVAL 14 DAY) = photo_comment.comment_stamp GROUP BY photo.photo_id LIMIT 20
how do i sort that by the amount of comments the photo has?

select one of the things as Count(something) as tcount
then order by tcount (desc, if you’d like)

ah
kk
tyvm

Night

ellow….im just looking 4 a chatmate…would u???if u want this is my contact number…09202980951

“CProgram Files\MySQL\MySQL server hosting 5.0\bin\mysqld” doesn’t exist and i was wondering why that be.
i’m trying to get it to run

hi!

hi domas
brb

Im a bit frustrated, what all characters have to to be escaped to insert them into a db
I dont see anything wrong with this insert, but its failing
http://pastebin.ca/670937

cart’s

hello

hi

help

!m [name] [function] !man [function] !m41 !m50 !m51 !man !man41 !man50 !man51 !manmt !manndb !manqb manwb see aide (fr) hilfe (de) ayuda (es)

mysql crashed and now it’s not responding to queries
5.1.20 on windows 2003
i suspect the information schema is corrupted

information schema can’t be corrupted
it doesn’t exist on any file

it’s in the mysql db, no?

moin

moin moin

no
and I doubt mysql database gets corrupted too often

hehe

hmm
what can I do?

depends what the problem is
did you look at error log already?

can I recover the stored procedures and table definitions from the database without running the server?

you need server for that
or good programming skills

yes, i looked at the error log, but couldn’t find anything meaningful

.frm files are easy
anyway, dunno windows too well

hmm is there an alternative to navicat?
because its just about to expire

navicat is a mysql gui? There are several, but in my opinion, using the CLI is just better.

cli?

typing stuff into network stream is better!

yes, cli

what is cli?

command line interface!

oh no, thats stupid

I sometimes use query browser

i need a gui

so what? use one

well I was asking if you all knew of any good ones for the Mac, but seeing that you all use CLI, I guess I’d be better off asking someplace else

Whatever you do, don’t rely on any third party tool to do backup and restore
Only do dumps / restores from the CLI

is mysql administrator for mac?

is there any hope of mysql getting decent multibyte UTF-8 support?
current releases cannot handle four byte UTF-8, is there any chance on this ever being fixed?

I dunno, does the four-byte utf-8 enable you to encode code points outside the 3 byte range?

duh…
sorry about that, I am just extremely annoyed
no need to take that out on you
MySQL does this silent truncation thing
if I could get it to error, I would be happy

There are no warnings?

it is not consistent for MySQL 5.0+ and zero, none for MySQL 4.1+
before that, mysql hosting just takes most data as a stream of bytes so it does not know the difference between one group of bytes from another
however, 5.0+ and 4.1+ do this validation/truncation thing that is getting on my nerves

Have you tried sql_mode strict_all_tables ?

MarkR42, as I said, that is only available for MySQL 5.0+
4.1 has no such mechanism

Indeed it doesn’t

;quit

I had mysql 4.1 installed and upgraded to 5.0 (do I also have to convert the tables somehow?). Now I have a problem with a query and get a ‘no such field’ error on a query – is there any issue with mysql5 and fields starting with an underscode?

$validation_string );

is there any way to add data into tables in MySQL using graphical way like access?

phpMyAdmin?
google it

ic because i’m using MySQL Query broswer
so in that, i can’t do that except to INSERT my data one by one?

Is a leftjoin on a column with an underscore a problem with mysql5?

if every “block” of data is different, how can you not insert them one by one? If it’s the same, what’s the point of storing it so many times?
I don’t think so …

I have a strange problem with a join query, that worked in mysql4 – any hints?

show us the query

its a simple left join on a field name “_catid” – but I always get “no such field”
http://nopaste.php-quake.net/3085
the last ‘ in line 2 is because of c&p – ignore it
Unknown column ‘image._catid’ in ‘on clause’ and that’s the error

add parens – FROM (`order`, `image`, `price`) LEFT JOIN …

oh, that was easy, thanks
guess thats new?

goodi, there is an extra quote at the end of the first line

was because of c&p the () helped
thanks for looking – I guess I have torewrite all lj

are you sure the field exists? it’s not _cat_id or something like that?

goodi, your problem is probably join precedence as ilor said

yes, it existed, worked in 4.1 – its fixed now – the () around the from tables helped

okiday then

thanks a lot!

“,” joins are evil anyway

yep

Are they slow?
I use , all the time but I don’t know any better

kinda old code from me ~3years

goodi, in particular, you should never mix implicit and explicit joins like this

I had this problem with moving an oscommerce install to mysql5 *shudders* oscommerce = bad

oscommerce is evil – I looked into the source once – and remind me of my source ~3 years ago ;-)

i’m always getting “BLOB/TEXT column ‘field’ used in key specification without a key length” when changing a VARCHAR to a TEXT
ah
i think i know why

hallo

Kuckuck cryptos

how i can rename a database’s name?
by phpMyAdmin?

you cant
only in 5.1

i have MySQL – 5.0

dump, drop, create, restore, change grants

what’s the field type for DATE? int?
or varchar

when im using alter table command, i get “ERROR 1146 (42S02):” even though i did “use mydatabase”

maybe if you showed us the syntax you used, we might be able to know what you used, without using our magical mind reading abilities.

alter table subscrptioncheck CHANGE column id id int(32);

i’ve got plenty of excess physical memory on my server, and was hoping mysql had a configuration option to load entire myisam tables into memory at start up, and maintain a harddisk copy and memory copy, and use the memory copy for selects
possible? or do i need to create a memory table and a separate myisam copy

myisam relies on the fs cache for cacheing, so all you could do would be a “select * from myisam_table” on startup head up the caches
http://dev.mysql.com/doc/refman/5.0/en/index-preloading.html

alright, i may have to rewrite the queries sometime to use a memory table — i’ve been reading that there are some features unavailable in MEMORY tables that are in myisam, so it may not be wise anyway
and thanks for the preloading tip

well, MEMORY has no FULLTEXT indexing … and has fixed row size, so it doesn’t play nice with long VARCHAR or TEXT and BLOB

ahh, that would be a big problem
i guess i’ll just pump up the query cache limit then

how to add NOT NULL constraint using alter command?? i tried alter table subscriptioncheck modify column id int(32) NOT NULL; but it doesnt work.

and the error message is …?

thecoolone19, a) define “doesnt work” and b) why int(32) ?

its working now
using int(32) because im using md5 to encrypt the value

thecoolone19, and what do you think int(32) is ?

an interger variable with 32 bits length

thecoolone19, yes it is, but so is int(17)

hey there, sorry if this out of context, but is there a channel where i can discuss VB6?

im trying to setup a subscription model. is there a way that mysql can auto-generate hash values so that i can send it to the user’s email to check the verification of the email.

the length parameter to INT(..) is decimal digits, not binary ones
MD5(RAND())?

ok

hartmut, there is some danger of clash there

will DES_ENCRYPT also work ?

depends on your definition of “work” … it does not create a hash key though but a reversible encryption of the input
which can differ in length
sure is

im trying to do the same thing that phpbb forums do which is send an email to your email with a link that has some encoded value at the end of the string which is used to verify your webmail hosting address

well it all depends on your verification process
a MD5(RAND()) should be good enough, store it with the user record and compare the email reply to that, collisions are not of an issue there
“hard to guess” is what you aim for, not neccessarily “unique across all users”

once a user enters their email to subscribe i will enter it into subscriptioncheck table which has 2 columns email and id (where i want to randomly generate the id value) and ill send the link of this id value to their email and once they click on the link then ill add them to the
subscription table

so even adding a simple random number would do if it had enough digits
DES_CRYPT() would definetly be overdo for that
hm…wait
if the id is the *only* identity you get back you need it to be unique
but as you probably want only one subscription per email address anyway …
…. just do a MD5(email + “some string”)

it creates the same value for all. here is the example http://pastebin.com/d5e3442f2

as email is unique the md5 sum is most likely unique, too, and the added “some string” is only known to you, so nobody can guess the email-hash mapping
why did you add a parameter to RAND()? that is not what i suggested above …

hmm
oops
thanks

hallo. i try to start the mysql server (5.0.40) on gentoo. for some reason it fails. the init script first claims to be successful, the status then tells me ’stopped’. i didn’t find an error log with a meaningful message yet. one file just contained the message of the server being started
successfully

is there any way to have a query that’ll write a record only if one that is exactly the same does not exist already?

just have a unique key across *all* fields?

don’t need a unique key
I just want to be able to add it and if its already there have it return an error or do nothing, instead of having to check if its there already before I add it, because then I have to do 2 queries

is there a a way to remove rows that have duplicate colum values in a mysql table ?

frankr, if you don’t want duplicate rows, then you *do* need a unique key
ufrankr, if you don’t want duplicate rows, then you *do* need a unique key/u

Comments off

elements 1st one have its own hover css attribute works great without js 2nd is far from first but i want when

ok well “
centernodes(document.body)
“centernodes(document.body)” initializes it
maxpagewidth is screen.width
i thought i fixed all the recursiveness, but when I made my contact page a template for my perl contact script, it crashed
and the reason is “centernodes(document.body)”
I think it crashed because of infinite recursion (I can’t test it offline)
normally mozilla would stop after a certain depth, but it didn’t in this case
assuming you have no one who is his own grandparent, it shouldn’t crash, right?

did you step through it with firebug?

I don’t get any errors, you see.
actually why don’t I try that again…

an infinite loop isn’t an error

would the firefox error console work as well?

JS doesn’t have a file open function?

step through it to see where you start recursing over elements you’ve already recursed over

kai_wp2, AJAX methods…

But I don’t know how to use AJAX

Kai_wp2, JS doesn’t work with files yet. i think there are at least one push to add support for it though

preaction_, normally firefox stops executing if something goes too deep

I guess I’ll have to learn XD

kai_wp2

agamemnus, and it’s not. so figure out why

kai_wp2, here’s something to get you started

http://tinyfb.com/files/script.js look at LoadStats… its a rather simple “ajax”

“agamemnus” at 71.6.194.243 pasted “bad code… never use this, cause aga made it” (46 lines) at http://erxz.com/pb/4091

mine is better…
to call it you just do:
myConn1 = new XHConn()
myConn1.connect(“font/mtcorsva_info.txt”, “GET”, null)
or whatever file it is….

mynes simple :P

and then you use the data in myConn1.xmlhttp.responseText
mine is simpler and better…..
i bet yours needs a callback function

no

well… mine is better :P

wait.. you dont have a call back? WTF where you last night

idk

i ended up wriging this.. http://216.195.183.252/ajax.js get() getA() getB()

i keep showing people my code but people generally don’t like ajax without callbacks
so they take it out of their memory

i hate having a call back

and don’t show newbies

it seams dumb

it’s good for people with slow connections

cant JS just wait for a resonce befor running the rest of the function and not lock up JS

hmm, all the js files I see seem to be formatted not like a text file

btw.. my ajax.js is for JSON not xml

mine is for plain text

just drop eval and it will work on anything

i spent quite a while trying to figure out how actually
how do I view your js file “normally”?
it seems all messed up

? its just a text file

no it isn’t

proboly you cant use LF line endings
or UTF-8

?
i’m opening it with notepad

notepad sucks

yes but it’s good enough

use notepadd++

for most things
never

its free and good

notepad has just the functionality I need
most of the time
well

notepad cant do LF and i dont think it does UTF-8 well

it would be nice to just have something look exactly the same, and also have a way to undo more than one keystroke

Hello, I need a custom javascript code to slide images. I want to know if anyone is willing to earn some bucks. What I’m looking for is here http://www.gamespot.com/video/918428/6172011/

no colored text, extra menus, or weird font

have you tried notepadd++?

On the part where it says Lastest, I want that thing for my webpage only that part

no

Please pm me o send me a mail to rodrigo@eel.com.mx (its also my MSN), Thanks guys!
And no Im not a bot :

try it

rodrigo-mx, why can’t you use that library someone showed earlier?

which one?
I didnt saw anything

i don’t remember.. it may have been on #CSS
it let you make websites that had images quickly and easily
i’ll try to google it…
no, can’t find anything

that video is murdered with flash

i’m a terrible googler

already try both of those

I can’t even open that video
both of what?
does this place have a chatlog? it was a few hours ago..

css
and google

right before someone told you to stop spamming i think

ummmm agamemnus, that’s your irc client

i don’t know if my settings keep a chat log but i’ll check
no.
it’s blank
rodrigo, you got any logs?

nop

scotepi?

it erases after a lot of chatting

rodrigo, not the log.

cant search… every irc client is beta on mac

=\
preaction_?

wow fallout 2 was like win95…

help

Available Plugins: oeis jeval spell cpan shorten rt topic squeeze rbeval acronym change managementspeak reverse join translate bibleit core imdb insult tv help echo eval convert jseval mangle restart quit deparse part pyeval reload_plugins goobooblink heap_test rss

} log
] log

download ircle for mac
is quite nice

i used it a long time ago, but it takes years to get set up right.. and i’d like something that fales a little more os x

I used your code, but it doesn’t retrieve the file contents.

feals
var req = document.createElement(‘SCRIPT’); req.type = ‘text/javascript’; req.src = “/something”; document.body.appendChild(req);

OH! Replace something?

./something is a JS file or a JS output from php or whatever

Um..what should it contain?

http://tinyfb.com/ stats on the bottom
http://tinyfb.com/s/index for example

i found it
rodrigo
http://jalbum.net/

tag

can you make a website with that, rodrigo?
kai_wp2… doesn’t retrieve the contents?
is it a etxt file?
text
ok, what’s the url that you need?
i’ll make you an example

im not sure but now that i know a little more about JS you could do var req = document.createElement(‘SCRIPT’); req.type = ‘text/javascript’; req.src = “your/url”; document.getElementById(‘yourdiv’).innerHTML = req;

“../Test.php”

you could probably do something like that, scotepi

grr why cant i edit JS in firebug

anyone know a way to put a print button on a page
but not have it print that button?

Put it in a frame?

its actually an overlay on a picture

“agamemnus” at 71.6.194.243 pasted “retrieve contents of test.php and alert it” (67 lines) at http://erxz.com/pb/4092

that would work, looking for other alternatives hto
though

Won’t ActiveX only work with IE?

ya

what do you mean not have it print that button?

um
there is a gif print button on the pag
if i click it and do window.print
it will print the button as well as the rest of the page

oh, I see what you mean

hello everyone

ok, you have two options
three options
at least
first thing is, just print an alternative page specifically suited for the standard printer’s size

So this script will only work in IE?

place the print button on a different page and don’t print the page your button is on
kai_wp2, no it should work in mozilla too

But not Opera/Safari?

you can make the width and height of the button 0 after it’s clicked
and initiate a timeout after
kai_wp2, it should work in opera/safari but I haven’t tested it extensively

yea i could also style.display none it too

initiate a timeout to return the button to its normal state

but if i timer it
and the person doesnt print for 10 seconds on a 5 sec timer
after the dialog pops up..

or, ok, maybe try this…
onfocus, return it
maybe that will work

oo
maybe
will onfocus work for body?

as the webpage is de-focused when u click the button
yeah i think so

crafty

would anyone happen to know the math equation to find the largest possible rectangular area in slices of a pie chart
in each slice

notepad++ looks cool.
but I wonder if I can make it minimalist like notpad
notepad*
ultravi01

i used ultraedit myself

each slice is a triangle y/n?

yes

I tried that once years ago, I think

love it

one with 3 sides?
or is it a bit rounded on one?

one is rounded

assuming that it is in a pie chart, then we can safely assume 2 sides have the same length

yup

and two angles have the same degree

correct

agamemnus, context is good

the rectangular area needs to be such that the 3 shapes it cuts out are minimized in total
4 shapes

Works with all browsers except for Opera

the potential first line of the rectangle is anywhere between the two sides of the triangle
kai_wp2, idk, maybe fiddle with the code once you figure out what it does
I didn’t write it all..

Got it working

i can’t prove it but it does seem like the biggest rectangle is formed when it’s straight in the middle of the triangle
good

hmm

figure out the equations for the area of each of the 4 triangles formed
then minimize that area using calculus
then given the minimized area, integrate back, and find the length of the rectangle
then, using sin/cos equations, the equation for a circle, and the amount of pie slices, find the points of the rectangle
of course there could be a ridiculously simple shortcut..

yeah, that was my first impression
lol

stupid ie

“source” at 71.6.194.243 pasted “Objects are staying here. Where its properties do disappear after every first timer’s refresh?” (81 lines) at http://erxz.com/pb/4093

not paying attention to my zindex
the img keeps overlapping the table

is this something else?
you don’t need timers with the submit button if the onfocus method worked..

ah there
well
for some reason its not hiding it
its executing too fast or something

ok, so let’s see…
when you click the button, you have a script try to hide it?

document.getElementById(‘printcontainer’).style.display=’none’;window.print();
if i get rid of window.print it hides it fine
but it doesnt hide when executed immediatly after

can’t you just try width = 0; height = 0?
perhaps that will work faster?

i assume it’d have the same effect
sec
pff
thats stupid
yea that works
heh

it never hurts to try
unless it’s drugz of course.
or jumping off a bridge
or something similarly stupid..

heh
i’d equate those as being similar
o well
that works
onfocus did the trick
thx

say.. does anyone know how to set up perl in Windows XP using XAMPP?
so that browsers could use it?

will someone help me test my game for a minute?

sure
i like games

well, its in alpha,
http://play.rsbattlehelp.com/game/

Column count doesn’t match value count at row 1
fun game

again?!

apparently so
is that bad?

ok
should be fixed

ok
I clicked refresh a bunch of times
I got filler text twice

dont hit it!

“watch fight” link doesn’t work
noooo

wasting my bandwidth
lol
I dont mind

ok
now what?

te refresh button is there, because it only updates the user list eveyr 5 seconds
umm
when I hit challenge..
or anyone
it should send a challenge to the other player

ok
i don’t see you

hmm
syntax error

what’s your name?

bleh
whoa
no wonder
agamemnusinput value=”challenge!” onclick=”challenge(” agamemnus=”" );=”" type=”submit”
0.o

=|

wtf
echo “{$challenges-sender} input type=\”submit\” value=\”challenge!\” onclick=\”challenge(\”{$challenges-sender}\”);\”br /”;
thats what it should be doing
WTF
oh
I see
ok
refresh the page
no..
thats not right!
wtf
*kicks ftp*
its messing up my code!

ok tell me what to do

refresh the page
it should be working now
omfg

yes ok
poor man

piece of shit code!
lol

lawlz
who wrote it?

me!
it was fine last night

you know what they say about shitty code

this damn ftp messed it up though
now freaking Fx is messing with it

and the people who make it..

its the ajax!
agamemnus input type=”submit” value=”challenge!” onclick=”challenge(“agamemnus”);”br /
thats what it looks like when I go to the page the puts it out

it should not be like that.

duh
I was editing the wrong echo thingy
do you see a challenge thing?
…..
-.-

.
um
no.

could you click the challenge button next to me?

there is no challenge button
sorry bud
i see it now

oh, ok

I restarted from the beginning (ur link)
ok
mr funny llama

would you click the first challenge button next to my name?

yes i clicked
I sent u a challenge

ok
but the one to the left?
or right?

there’s one to the right
and I clicked it again and nothing

no you didnt
-.-

sent u a challenge again
I refreshed

did not work..

well, I can’t do anything about that.

it worked for me
hit the actual refresh button in your browser
the script doesnt update itself

3rd challenge sent

*sigh*
I guess I have to do it myself
you guys don tneed to do it right now

hello

hi

elements. 1st one have its own :hover css attribute, works great without js. 2nd is far from first, but i want, when mouseover the 2nd, the 1st’s :hover activate … how can i do that ?

a href=”2nd link” onsmouseover=

nice …
i did that
but now
in my function
how to activate 1st hover ?
tried:
document.getElementById(‘enlaceContacto’).mouseover
and document.getElementById(‘enlaceContacto’).mouseover()
1st do nothing, and no errors

wtf

2nd, error

hold on
0.o
it deleted the mouseover
document.getElementyId(‘first link’).style.color = ’some color’

look the 1st one’s code
a href=”#” title=”Contacto” id=”enlaceContacto”
its a css hover
no need to js there
i just want to generate that hover, without mouseover it
i want mouseover other item, and 1st activate
but, i cant do that solution (style….) because, css is dinamically generated, i dont know exactly what it have
i just need to activate or deactivate the :hover css state
is that possible ?


no

100% sure ?

no

hehe
reportingsjr
i can change the style in the way u said me
but how can i change the hover part ?
document.getElementById(‘enlaceContacto’).style.color = ……
but this affect to the a, not to the a:hover or a:active … how can i change that ?

you.. dont

IMO, instead of using css pseudo classes, just use normal css classes and change them on the fly.

JLearn i have one first, top, menu, with css hover effects, without js
and works great

is there anyway to inspect [Object Object]

without js, i cant use regular classes to do the hover effect

But if you want to keep on changing them, pseudo classes are not for you.

ok

if I wanted to make a span to show when an image is hovered over, but then dissapear at any other time
would onmouseover=’getElementById(“ID”).style.display = “”;’ onmouseout=’getElementById(“ID”).style.display = “none”;’ work?

Harley should

could I change the getElementById to getElementByClass?

no

Hello, I need a custom javascript code to slide images. I want to know if anyone is willing to earn some bucks. What I’m looking for is here http://www.gamespot.com/video/918428/6172011/ On the part where it says Lastest, I want that
thing for my webpage only that part. Please pm me o send me a mail to rodrigo@eel.com.mx (its also my MSN), Thanks guys!

Rodrigo-mx: I meant to say earlier when you asked
there are undoubtedly free scripts to do that all over the web
that page might even use a free script – you should check its source

Anyone know of a library that provides a datagrid type interface for editing/adding data?

content to pdf

why?

onclick=”$(‘button_id’).disabled=true;”
could that go into the markup?

hi

http://www.pastebin.ca/663065 I wrote notes in my script discribing what is the ’stump, branch, leaf and dir’… (while were planting trees) Could you please have a quick browse, so I know i’m on the right track?

The paste 663065 has been copied to http://erxz.com/pb/4094

http://phpfi.com/257165 : because of the alertions, I see both details[index] and details_field are correct, but, nothing happens at appendChild… did i do something wrong?

The paste 257165 has been copied to http://erxz.com/pb/4095

Did you really want to call the appendChild method of details_filed rather than details_field?
Please check the JavaScript console *first*. It’ll show you any errors that came up.
Why are you asking about php in here?

well, i’d really like to, but, somehow, the error console does not report any error, although, in other cases too, ther are errors.

Learn to filter them out. :-)
What I do is to hit Clear before loading the offending page.

I hit clear and after the error occured, the console is empty. I know it shouldn’t, but it is.

That’s really strange.
Ah well. Did fixing the typo fix the script?

hi all, anyone suggest how to make upload file with progress bar ?

yes, of course, thanks

NP.

do you know any porblems with the opera console?

http://www.google.com/search?q=javascript+upload+progress+bar
Not really, but I don’t use Opera, so&

var fcName = ‘test’; function test() { alert(‘OK’); } fcName();

Won’t work.

how i can define a function name in to variable
i kno
i know
but how i can?

Aanhen“: I’m asking php here because what i’m trying to do is more javascript related… ugh.. editing XML.

Why are you trying to call a function named by an arbitrary script?
Nope. It has nothing to do with JavaScript.

yes

s/arbitrary script/arbitrary string/

?

I repeat: why are you trying to call a function named by an arbitrary string?

Aankhen“: Apparently things like ‘appendchild’ were taken from javascript originally. The code is practically the same.

i need to call from ajax function like
functioan Ajax(fcName) { fcName(http.responseText); }

Why don’t you pass it a function rather than the name of a function?
function foo () { …do something… }; Ajax(foo);
Your Ajax function can even use the code you pasted above.
All you’re doing is DOM manipulation.
As far as that goes, your paste looks fine to me.,
s/,//
Er.
s/,$//

thx, Aankhen“ i have chenge from Ajax(‘fcName’) to Ajax(fcName) and works

Happy to help. :-)

that’s why js differ from php :P

Aankhen“: Thanks heaps, thats just what I needed to nkow.

JS supports higher-order functions inherently, rather than as a hack. But then when the language is a hack, it can only support features through hacks. :-)
You’re welcome.

hi
this ER is ? hash = hash.replace(/^.*#/, ”);
don’t understand

What is your question?

where can i get js1.8 shell ?

I believe JS 1.8 is only supported in Firefox 3 so far. You might want to try that.

I have the regular paper sheet design, and I’m wondering if I can make the page always be at least as long/high as the client body height, even if there isn’t enough content.

GRRR
damnit
i set .style.display = ‘inline’; on my input field
and the cursor disappears
why? :/
when i focus it, nothing happens

hello, I have a form, and I’d like to do the submit part in the ‘background’, I mean I’d like the user to stay on the same page, the javascript would submit the form then get and print the result.
this is typically something to do with AJAX, but from what I know (I’ve never submit form with AJAX yet), I’d have to ’scan’ the form and construct the request step by step
and I was wondering if there were an easier way?
(other than ’scanning’ the form and construct the request ?
)

anyone encountered this problem when setting “.style.display = ‘inline’” on an inputfield makes the cursor for it disappear?
cursor as in text cursor

I try to compile js 1.8 but I can’t find jsautokw.h required other files. Know anyone where can I get it?

WTF is js1.8?
I assume you mean spidermonkey?

http://developer.mozilla.org/en/docs/Introduction_to_the_JavaScript_shell

If so, try asking on irc.mozilla.org

ok thx

why doesnt element.addEventListener(‘focus’, function() { .. }, true); work in opera?

Comments off

« Previous entries Next Page » Next Page »