Increase for 1 using REPLACE function

2011-03-18 Thread Afan Pasalic
I have to increase 'no_of_visits' for 1. Using UPDATE function is easy: update visits set no_of_visits=no_of_visits+1 where visitor_id=123 but, how it should be (if possible at all) if I want to use REPLACE function? I tried something similar replace into visitors values ($visitor_id, (no_o

Re: [PHP] multiple choice dropdown box puzzle

2009-02-23 Thread Afan Pasalic
PJ wrote: I think this is a tough one... and way above my head: PLEASE READ ALL OF THE ABOVE TO UNDERSTAND WHAT I AM TRYING TO DO. Having a bit of a rough time figuring out how to formulate php-mysql to insert data into fields using a multiple dropdown box in a form. to post I am using the fo

Re: CONCAT doesn't work with NULL?

2008-05-21 Thread Afan Pasalic
" AND pm.pm_id=o.payment_method AND f.form_id=".$form_id." AND r.reg_id=o.registered_id AND a.reg_id=r.reg_id AND a.address_type='Business' in this case I have to create string REGISTERED_BY by php. reason I did it as example 1 is because I read in few books and onli

reorder records in database

2008-05-15 Thread afan pasalic
hi, I have a table with tasks. column "status" could be 1 (means "todo") and 0 (meas "done"). also,have column "order_no" to sort tasks by priorities. once in a while order_no is not "in order", e.g 1, 2, 3, 5, 6, 8, 11, 12, 13, 19, 20,... (some numbers are missing). is there built in function to

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
/5.0/en/string-functions.html#function_concat-ws --- CONCAT() returns NULL if any argument is NULL. CONCAT_WS() does not skip empty strings. However, it does skip any NULL values after the separator argument --- Ewen On Wed, May 14, 2008 at 5:53 PM, Afan Pasalic <[EMAIL PROTECTED]> wrote: h

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
addresses a WHERE r.reg_id=121 Randall Price Secure Enterprise Technology Initiatives Microsoft Implementation Group Virginia Tech Information Technology 1700 Pratt Drive Blacksburg, VA 24060 -Original Message- From: Afan Pasalic [mailto:[EMAIL PROTECTED] Sent: Wednesday,

Re: CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
does skip any NULL values after the separator argument --- Ewen On Wed, May 14, 2008 at 5:53 PM, Afan Pasalic <[EMAIL PROTECTED]> wrote: hi, I have query SELECT CONCAT(r.first_name, ' ', r.last_name, '\n', r.organization, '\n', r.title, '\n',

CONCAT doesn't work with NULL?

2008-05-14 Thread Afan Pasalic
hi, I have query SELECT CONCAT(r.first_name, ' ', r.last_name, '\n', r.organization, '\n', r.title, '\n', a.address1, '\n', a.city, ', ', a.state, ' ', a.zip, '\n', r.email) FROM registrants r, addresses a WHERE r.reg_id=121 if any of columns has value (e.g. title) NULL, I'll get as result 0

Re: I need to add to content somehow

2008-01-03 Thread afan pasalic
Matthew Stuart wrote: > I have a DB that has a field in it that currently just holds single or > double numbers - these numbers are basically a reference to a category > in which the particular record should be displayed. However I have now > been asked if I can make it so that a particular record

Re: I need to add to content somehow

2008-01-03 Thread afan pasalic
Matthew Stuart wrote: > I have a DB that has a field in it that currently just holds single or > double numbers - these numbers are basically a reference to a category > in which the particular record should be displayed. However I have now > been asked if I can make it so that a particular record

Re: Update but insert if not exist

2007-12-16 Thread Afan Pasalic
try REPLACE http://dev.mysql.com/doc/refman/5.1/en/replace.html -afan Steffan A. Cline wrote: I am trying to think of a trick way to handle something. I have been successful in using the multiple inserts in one row by using the ,(xx,xx,xx),(xx,xx,xx),(xx,xx,xx) in a values block. BUT Is it poss

Re: something like ENUM - but it's not ENUM

2007-12-06 Thread Afan Pasalic
yes. just found it. it's funny, I was looking for it last half hour and the second after I sent the email - I found it. :) yes, yes... I know. RTFM :D thanks. -afan sol beach wrote: SET Column type? On Dec 6, 2007 2:01 PM, Afan Pasalic <[EMAIL PROTECTED]> wrote: hi, I wond

something like ENUM - but it's not ENUM

2007-12-06 Thread Afan Pasalic
hi, I wonder if mysql has something like ENUM() but instead ONLY ONE it could be selected ANY COMBINATION of these offered solutioins? If column is ENUM('a','b','c','d') I can select 'a' or 'b' or 'c' or 'd'. Clear. Tough, I need SOMETHING('a','b','c','d') that I can select 'a' and 'b', or 'b',

Re: MySQL Browser - limit 1000 by default?

2007-12-02 Thread Afan Pasalic
ords under Tools-> Preferences and changing the "Max Rows For Generated Queries" to whatever you want, set to zero removes the limit entirely. On Sat, 2007-12-01 at 15:17 -0600, Afan Pasalic wrote: Hi, on Linux version of MySQL Browser (v 1.2.4 beta), when double-click on any table, default q

MySQL Browser - limit 1000 by default?

2007-12-01 Thread Afan Pasalic
Hi, on Linux version of MySQL Browser (v 1.2.4 beta), when double-click on any table, default query is SELECT * FROM LIMIT 0,1000 On Win version (v 1.2.9 rc), there is no LIMIT part - what caused me to pull so many times tens, even hundreds thousands of records. I was looking for in setting f

Re: need query: records inserted on Monday?

2007-11-20 Thread Afan Pasalic
ven date between 8 AM and 4 PM */ SELECT COUNT(*) FROM table t WHERE t.created_at >= "2007-11-20 8:00" AND t.created_at <= "2007-11-20 16:00"; MySQL's docs on date and time functions are here: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html HTH, D

need query: records inserted on Monday?

2007-11-20 Thread Afan Pasalic
Hi, I have to build a report - when (date and/or time) the records are inserted. E.g., number of records inserted on Monday - doesn't matter what month. Or, number of records inserted on specific date between 8am and 4pm. Thanks for any help. -afan -- MySQL General Mailing List For list arc

Re: how ti put several records of one mysql table in one row of html table?

2007-10-16 Thread afan pasalic
Yup! That's THE ONE! Thanks Rajesh. -afan Rajesh Mehrotra wrote: > Hi, > > I think "GROUP_CONCAT" will do it. > > -Raj. > > > > -Original Message- > From: afan pasalic [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 16, 2007 11:49

how ti put several records of one mysql table in one row of html table?

2007-10-16 Thread afan pasalic
hi, I have "standard" organizations table with org_id, name, address, city,... columns. CREATE TABLE `organization` ( `organization_id` int(8) unsigned NOT NULL default '0', `address_id` int(8) unsigned default NULL, `full_name` varchar(255) default NULL, `phone` varchar(255) NOT NULL def

Re: do I need two tables or one will do just fine?

2007-10-08 Thread afan pasalic
On table it is! :-D Thanks to all of you who helped me with my "problem". -afan John Meyer wrote: > Afan Pasalic wrote: >> hi, >> I have a employees table (first name, last_name, address, city, >> state, zip, phone,...). >> though, I got a requested to a

do I need two tables or one will do just fine?

2007-10-05 Thread Afan Pasalic
hi, I have a employees table (first name, last_name, address, city, state, zip, phone,...). though, I got a requested to add additional info about people, like phone_extension, zip+4, nick, DOB... that will not be used very often. what would be better solution: a) add these columns to employees

changes in tables (developemnt -> production)

2007-09-06 Thread Afan Pasalic
hi, on production server, while developing, I did some changes on some tables (I added few new columns on several tables). now, after the new web app is finished and tested, I have to upgrade (php) the app on production server. what steps do you recommend to do the tables update on the product

Re: indexing order column

2007-05-04 Thread Afan Pasalic
Baron Schwartz wrote: Hi, Afan Pasalic wrote: Baron Schwartz wrote: Hi Afan, Afan Pasalic wrote: hi, if I have column order_id(int(4)) null do I have to index it too. I'm going to use it ONLY for sorting records. It depends a lot on how much data is in the table, etc etc. An

Re: indexing order column

2007-05-04 Thread Afan Pasalic
Baron Schwartz wrote: Hi Afan, Afan Pasalic wrote: hi, if I have column order_id(int(4)) null do I have to index it too. I'm going to use it ONLY for sorting records. It depends a lot on how much data is in the table, etc etc. An index will make sorting more efficient in the ge

indexing order column

2007-05-04 Thread Afan Pasalic
hi, if I have column order_id(int(4)) null do I have to index it too. I'm going to use it ONLY for sorting records. thanks. -afan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

MySQL Workbench

2007-05-01 Thread Afan Pasalic
Hi, I'm looking for database modeling tool form MySQL. Anybody used the MySQL Workbench? I know the Workbench is in Alpha production, though some "hints"? How about DB Designer? Thanks for any respond. -afan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To u

Re: INSERT using SELECT results

2007-02-18 Thread Afan Pasalic
INSERT INTO ztipos (type) VALUES (SELECT DISTINCT type FROM locais) ? -afan Miguel Vaz wrote: Hi, I have a table LOCAIS with: idtypedesc 1t1blah blah 2t1uihuih 3t2pokpokp I want to list only the distinct types and create a table

help to build a query for simple bulletin board

2007-01-26 Thread Afan Pasalic
hi, I'm trying to build a simple bulletin board, just topics and posts. created following tables: CREATE TABLE `topics` ( `topic_id` int(8) NOT NULL auto_increment, `author_id` int(8) unsigned NOT NULL, `topic_title` varchar(255) collate utf8_unicode_ci default NULL, `topic_date_entered` date

[SOLVED] Re: #1191 - Can't find FULLTEXT index matching the column list

2006-05-12 Thread Afan Pasalic
Hi Sheeri No, I wanted to search through both columns in the same time (and it will be always at the same time) - the problem was I didn't know that I have to have one multi-column index. :) But, it's fixed (after really helpful comments on this mailing list) and works perfect :) Thanks to

Re: selecting all records inserted last 1 minutes?

2006-04-27 Thread Afan Pasalic
No, not exactly. More as "there is a solution"... What would be the best way to do? -afan Paul DuBois wrote: At 20:52 +0200 4/27/06, [EMAIL PROTECTED] wrote: Hi, I was trying to list all registeed users they are "online" last 15 minutes. I can do it by using timestamp: = '$start_time' ?>