#mysql
15 November 2007
Total 10 pages. You are browsing page 5/10.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
04:02 <****> yeah. locking in takes more effort than developing new shiny things
04:19 <****> how do i show the results on a page of 'SHOW DATABASES'?
04:19 <****> in php
04:20 <****> or is that for php room?
04:20 <****> same as your SELECT
04:20 <****> check php manual for examples
04:20 <****> $row['database'] ?
04:22 <****> go check it out from the manual
04:23 <****> ugh
04:23 <****> i am having issues running mysqldump from cron
04:24 <****> i can run it from the command line with no problems at all
04:24 <****> but when i run it from cron i get the following error:
04:24 <****> brandon: use print_r() on the mysql_fetch_assoc()
04:25 <****> mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
04:25 <****> Wrong password
04:26 <****> that's what i suspected as well... but the password is correct
04:26 <****> or wrong user..
04:26 <****> the funny thing is that i do a "crontab -l" and copy/paste the command and it runs just fine
04:26 <****> are you specifying the user with -u ?
04:26 <****> yup
04:26 <****> i'll paste the command here if you'd like
04:27 <****> /data/db/mysql_backup/mysql.backup
04:27 <****> oh wait
04:27 <****> you're missing a space?
04:27 * wrench- rubs eyes
04:27 <****> yeah :)
04:28 <****> that missing space is right where the console window wraps
04:28 <****> heh
04:28 <****> and i was copy/pasting one line at a time too
04:28 <****> doh!
04:28 * wrench- makes mental note :)
04:31 <****> deadroot i have
04:31 <****>" }
04:32 <****> deadroot what do i put for the $row['database']
04:32 <****> deadroot i know that tobe the name of row header on table
04:35 <****> brandon: have you tried doing $row[0] instead of $row['database'] ?
04:36 <****> ToeBee omg it that easy that rocks
04:36 <****> ToeBee can i order them?
04:37 <****> hmm not sure
04:37 <****> it okay i worked around it
04:38 <****> i googled and belive you cant
04:38 <****> it looks like it returns them ordered alphabetically...
04:39 <****> the columns of the result should be in a fixed order, cannot be alphabetical
04:40 <****> huh? I'm talking about the database names
04:40 <****> oh the rows
04:40 <****> brandon: $r = mysql_query("show databases"); while ($r2 = mysql_fetch_assoc($r)) {print_r($r);}
04:40 <****> err... typo. {print_r($r2);}
04:42 <****> brandon: from the results, it's $row["Database"] and not $row['database']
04:43 <****> i used $row[0] and worked
04:43 <****> s/$row["Database"]/$row['Database']/
04:43 <****> that's because you're using fetch_array, which includes numbered indexes
04:44 <****> i personally prefer fetch_assoc than _array or _row because i prefer to work with names. more rereadable
04:48 <****> sv2_: uuugh, yeah, of course, good idea :p
04:50 <****> Hi. Quick question for someone that has the time. I have a friend that got rid of his account with a small shared hosting company, and the backup of his SQL database with them was sent to him in a
04:50 <****> *.tar extension. How do I import this into MySQL?
04:50 <****> Can someone explain to me what is a primary and unique field?
04:51 <****> ZeroPing: untar it and check if it contains valid SQL statement. if it does, then you could use the command line client's "source"
04:51 <****> any reason why this dosent work?
04:51 <****> http://paste.ubuntu-nl.org/44580/
04:51 <****> i guess there i reason but anyone can tell me?
04:51 <****> deadroot: The .tar just contains files in relation to his forum that he had setup with the previous hosting company. I don't know how to check and see if it contains a valid statement.
04:52 <****> teachme: i'm no expert. the primary and unique keys are only different in their names, with the word primary marking it as the primary key to be used when JOINing different tables
04:53 <****> ZeroPing: if they're small (< 10 megabytes), try opening them with your text editor (eg: notepad)
04:53 <****> I think i understand
04:53 <****> so any key that is not marked as primary can't be used to join different tables?
04:53 <****> they can, but it is dangerous if you forget what they represent
04:54 <****> so any key that is not primary is considered unique
04:54 <****> ?
04:55 <****> no. columns marked as primary key or unique key can only contain unique values. plain indexes can contain copies of existing values
04:55 <****> ah ok
04:56 <****> so in a way primary and unique keys will only have hard coded values?
04:56 <****> i prefer that they uniquely identify a record
04:56 <****> ok
04:57 <****> if i am looking for the value '123' in a unique keyed column, i am guaranteed either no match or a single match
04:57 <****> doing the same for a normal indexed column can result in 0 or more matches
04:58 <****> hi, is there a special data type for storing latitude longitude information?
05:01 <****> MrKeuner: Check out MySQL Spacial Extentions.
05:01 <****> Spatial, that is.
05:02 <****> MrKeuner: http://dev.mysql.com/tech-resources/articles/4.1/gis-with-mysql.html
05:02 <****> I suppose it is also in 5.0?
05:03 <****> spatial is geometry type, depends what you need the latitude longtitude for
05:06 <****> MrKeuner: Yes. It's in 5.0, but began life somewhere around 4.1.
05:07 <****> deadroot: I made my friend go into his phpmyadmin and do a SQL backup, so now I have a 118KB .sql file instead. Can I just make a new user and database in MySQL and load the backup file? I don't want it to replace all my other users and databases.
05:09 <****> geometry is not a type anymore right? it is a class?
05:09 <****> ZeroPing: yes you can. and since it's only 118 KB, you could manually check the entries to make sure that there won't be any problem
05:09 <****> before importing the .sql file
05:11 <****> hi,
05:12 <****> I have text feild and it keep adding \\\\\\\\\\\\\\\ before any ' " used in the text, any advice?
05:13 <****> Open Backup file? I don't have to do anything else?
05:13 <****> I just want to make sure it doesn't overwrite any of my other databases or users.
05:14 <****> Alloos1: MySQL doesn't do that. Are you using PHP?
05:15 <****> yes
05:15 <****> chadmaynard: yes
05:15 <****> Alloos1: go talk to those guys.
05:15 <****> it is some option in php.ini iirc
05:15 <****> ok, sorry man thought its sql thing
05:15 <****> :)
05:15 <****> not a problem
05:15 <****> I like to blame php too.
05:16 <****> heh
Total 10 pages. You are browsing page 5/10.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
