| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12
Comments:
<0> i can't schedule a job for it <1> MasterLexx: Just let it grow and prune/clean the data periodically. <0> okay <0> but i can use auto_increment safly to set an index for ech row, right <1> Your requirement is a bit too vague. <1> Sure. That's what it's for. But don't use that index in your program. It's just an identifier. <0> why not using it? i can use it for searching for this row to get it right? <1> Sure. It's for identification. <2> what would i do if i wanted to selected all columns from a mysql table but select one of them as unixtimestamp <2> like can i do SELECT UNIX_TIMESTAMP(time), * from Table <1> Jezek: Roughly, yes. <2> ok cool <2> so technically does it select it twice? <3> You don't want to use * anyways <3> SELECT UNIX_TIMESTAMP(time) AS my_timestamp, col1, col2, ... FROM table <2> oh so i have to type in all the column names
<2> ok <4> anyone see anythign wrong with this query string $query="SELECT * from reviews WHERE id='".$_GET['review']."';"; <2> welll im selecting all the columns anyway.. <3> Jezek: I don't know if you have to, but it's better/faster that you do. <1> Jezek: No. You don't have to. But you probably should be specific. <2> ok <4> the only reason i ask is if i then do a $result=mysql_query($query); it gives me an error of parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING i <3> daum: PHP errors belong in ##php <4> kuja, but i'm thinking it is my query sring kuja <2> daum <4> since the $query doesn't give me an error. <3> That error is a PHP error. <2> ill send you pm <4> Jezek, ok thanks sir. <1> daum: Check from the php side first. Make sure the expansion is correct. If you think the expansion looks correct, post that (with no php) to the pastebin (or if it's small) to the channel. <0> what's the difference with setting a column as primary key and as index ? <5> primary keys are unique <5> primary keys are also not null <0> preimary key that auto increments is not unique? or do you mean that index key is never re used? <5> a primary key is defined as "the first not null unique key" <0> okay, i am too new <5> :) <4> is there a way to do a select statement where you only grab the first 20 say? <6> daum: I think you are after the LIMIT or TOP clause for SQL. I can't quite recall which one. <5> limit <6> firewire: Thanks. <4> thanks sir! <4> "SELECT * from main ORDER BY alctodollar LIMIT 20"; <4> right? <7> folks how do I create an username and p***word and grant dba to it <8> chmod775: to create users you INSERT them into the users table in the mysql database. You may also need to select which hosts to allow etc. <8> chmod775: but there's a good write up of this in the manual <7> I am totally new <7> to MYSQL all I want is to create an user, grant dba privi, create a database and export files <8> chmod775: do you know how to start the mysql client? <7> when I type mysql it goes in the mysql prompt <7> I want to export drupal files, have u heard of drupal? <8> ok, then you have a mysql user called root that's created by default. Currently that user has no p***word I would suspect <7> yes <7> right <8> I haven't heard of drupal - or at least it doesn't ring a bell right now <9> i ran this command in mysql <9> ALTER TABLE `forum` ADD `gallery` TINYINT( 4 ) NOT NULL <9> how do i remove it ? <9> or redo it <7> ok fine, how do I create an user and database and grant priviledges <7> ? <7> dba I mean <9> chmod775, in mysql ? <7> yes dude I am totally new to it <9> easy <9> im eating noodles <9> create database xxx; <7> help me pzl I am actually trying to export drupal tables <9> that will create a database <7> ok cool done <7> now username and p***word and grant dba to it <9> grant all on xxx.* to username@localhost identified by 'p***word'; <9> NOTE! <9> you should change them to whatever you like on 'all' and * and localhost part <9> all means that user has all permittion in that database xxx
<7> u mean xxx is the database here <9> yea <7> mysql> grant all on ashish to ashish@localhost identified by 'p***word'; <7> ERROR 1046: No Database Selected <7> mysql> grant all on drupaldb to ashish@localhost identified by 'p***word'; <7> ERROR 1046: No Database Selected <7> mysql> <9> geez <2> how do i average values from a row <9> you needed to do 'use database' before ran this <7> k <9> here database is whatever that database you just created <9> create database xxx; <2> like if i have a column with rating in it. i wnat to find the average of the valuse in that column <9> use xxx; <7> mysql> grant all on ashish to ashish@localhost identified by 'p***word'; <7> Query OK, 0 rows affected (0.08 sec) <9> then run grant again <7> cool done <9> ok <7> now how do I login using my username <2> ah nvm <9> mysql -u username -p; <2> good ol avg() <7> col mysql -u ashish -p <7> ? <8> jezek: not sure if there's an average function but sum() divided by count() should do it <2> i just found an average function o.O <7> Now I need to export some file into the mysql database? <8> Right on <9> chmod775, haha -_- <9> chmod775, i dont know that <7> I have a file called backup.sql how do I export them into that <2> you mean import.. <2> ? <8> load data infile I belive is what he needs <7> yes <2> errr <2> Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause <2> what does that mean <2> $query_review_display = sprintf("SELECT user_id, review, movie_id, review_id, rating, avg(rating) AS avg_rating FROM reviews WHERE movie_id = %s", $colname_review_display); <8> could also look into mysqlimport <7> ok <2> ah nvm <8> sorry i can't be more specific, chmod775 I usually use phpmyqdmin - tho really I should just learn to do it by hand <7> yes I know but how do I configure this can u plz help me <7> ? <8> chmod775: I'd be guessing but <7> huh? <8> chmod775: I'd suspect from the mysql command line something like LOAD DATA INFILE 'myfile.sql' <7> ok fine <7> mysql -u username -p databasename < database/database.mysql <7> i guess it should be this <7> ? <8> hmm.. that might work too <8> I just try things and eventually they work <8> chmod775: are you in the mysql client atm? <7> u mean the rpompt <7> ? <7> prompt sql prompt? <8> if so type: LOAD DATA INFILE 'database/database.mysql' <8> yes <8> semicolon at the end of course <8> if so type: LOAD DATA INFILE 'database/database.mysql'; <7> k <8> did that work? <7> yes <8> wheee <2> i dont get what i should put for group by. i want to find the average of the rating column <2> so far i have $query_review_display = sprintf("SELECT user_id, review, movie_id, review_id, rating, AVG(rating) AS avg_rating FROM reviews WHERE movie_id = %s GROUP BY ", $colname_review_display); <2> but i dont know what to put for GROUP BY <8> Jezek: try a few things and see what happens =) <2> lol ok <8> Since it's just a select the likelyhood of breaking anything is minimal
Return to
#mysql or Go to some related
logs:
error activating xkb debian osdev rtc nforbes #sql themeitem fixed #fedora #web #ubuntu #lisp #ubuntu
|
|