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
quot; can't be part of the mysql statement, it should be "outside"
the statement
FOR ( $ii = 0 ; $ii < count($categoriesIN) ; $ii++ )
{
$sql4 = "INSERT INTO temp (example) $categoriesIN[$ii]" ;
$result4 = mysql_query(
"
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
mbers are missing).
is there built in function to "reset" order_no or I have to create php
script for it?
thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
actually, this will not work for me (or I got it wrong :D) because I
need to have street, state and zip in one line and with separator
defined on the beginning it will put everything in separate lines.
:D
ewen fortune wrote:
Hi Afan,
You can use concat_ws
http://dev.mysql.com/doc/refman
First, I want to thank to everybody on such afast respond. Thank you.
Second,
what would be difference between concat_ws and the Randalll's solution
(bellow)?
-afan
Price, Randall wrote:
Could you use something like this (untried):
SELECT
CONCAT(COALESCE(r.first
Thanks Ewen,
that's what I was looking for!
:D
-afan
ewen fortune wrote:
Hi Afan,
You can use concat_ws
http://dev.mysql.com/doc/refman/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
.reg_id=121
if any of columns has value (e.g. title) NULL, I'll get as result 0 records.
If query doesn't have concat() - it works fine.
Why is that?
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
actually, forgot to answer on your question:
if your table name is your_table and column with categories is named
categories:
UPDATE your_table SET categories=CONCAT('/', categories, '
u still want to do it your way, I'll suggest to use comma instead /
1,33,9 (even it really doesn't change a lot) and don't put / at the
front and at the end: 1/33/9
explode('/', '/1/33/9/'); will create 5 elements of the array
explode('/', '1/33/9
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
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
.
Tough, I need SOMETHING('a','b','c','d') that I can select 'a' and 'b',
or 'b', 'c' and 'd', or all of them (but must at least one)? Does exists
something like this in mysql?
thanks,
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
hi barry,
this is on Linux version of MySQL Query Browser. I need the same on Win
version. But, there is no such a solution (Tool > Option > ...).
:(
-afan
barry wrote:
I'm assuming you're talking about the Mysql Query Browser?
You can change the number of rec
for this feature, but wasn't able to find.
is there way to set the limit value on default select query, on win version?
thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Yup! That's it!
Thanks Dan.
;)
The link is really helpful. I was looking for it on mysql but was able
to find. Looks like I didn't try hard. :)
-afan
Dan Buettner wrote:
Afan, you'll need to have a date and time column in the database storing a
"created at" value,
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
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
0 |
http://www.abcinc.com | 2005-04-01 | 2006-01-01 |Smal Member|
+-++-++++----+-+-+
thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
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
cause I'll never have more than 200K records (right
now I have about 50K records). and "normalization" will not improve a lot?
any suggestions?
thanks.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
production
database?
1. backup
2. ???
3. ???
...
thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
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
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
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]
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.mys
uot;);
or
have a query for each record:
mysql_query("update suppliers set rating='R' where supp_id=1");
mysql_query("update suppliers set rating='A' where supp_id=2");
mysql_query("update suppliers set rating='A' where supp_id=3");
mysql_
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
y default 4
and I have to change to 3.
:)
Thanks.
-afan
> Don't forget that LIKE "%cap%" will find "captain", "recapture", and
> anything else that has the substring "cap" in it. Your Boolean match
> against
> "+cap" will only fin
, prod_name, prod_no
from products
where MATCH (prod_name) AGAINST ('+cap' in boolean mode)
I don't get any record as result.
What I'm doing wrong?
Thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
'.$result2['post_date'].''; # shortened version
}
}
and, of course, it's wrong.
want to have on topics listing: topic's title | author's name | no. of
replies | last post date | last post autor's name.
Thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Thanks Johnatan.
After I put tables in brackets - everything worked fine!
;)
And thank to everybody else.
-afan
> View the documentation here:
> http://dev.mysql.com/doc/refman/5.0/en/join.html
>
> You could write your statement as
>
> SELECT
> Field1, field2
> [EMAIL PROTECTED] wrote:
>> FROM ".$tn.", bill_info as b
>> LEFT JOIN shipp_info as sh ON (b.bill_id=sh.bill_id
>
> That would be the usage of multiple from's combined with a left join.
> Unfortunately with mysql 5 you can't do this. You're going to have to
> do bill_info as a left/right/inner j
NOT NULL default '',
`ship_address_2` varchar(50) default NULL,
`ship_city` varchar(50) NOT NULL default '',
`ship_state` char(2) NOT NULL default '',
`ship_zip` int(5) unsigned NOT NULL default '0',
`ship_phone` varchar(20) default NULL,
`ship_e
oducts_index2` (`prod_start_date`,`prod_end_date`),
KEY `on_sale` (`on_sale`),
FULLTEXT KEY `prod_search` (`prod_name`,`prod_description`),
FULLTEXT KEY `prod_no_2` (`prod_no`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6151 ;
And, after I deleted prod_no_2 key (it doesn't mak
igned NOT NULL auto_increment,
>> >> `prod_no` varchar(50) NOT NULL default '',
>> >> `prod_name` varchar(255) NOT NULL default '',
>> >> `prod_description` text,
>> >> `prod_colors` text,
>> >> `prod_includes` text,
>&g
t NULL,
>> `prod_status` enum('hidden','live','new') NOT NULL default 'new',
>> `prod_supplier` varchar(45) default NULL,
>> `prod_start_date` date default '0000-00-00',
>> `prod_end_date` date default '000
x27;No',
PRIMARY KEY (`prod_id`),
UNIQUE KEY `prod_no` (`prod_no`),
KEY `products_index1` (`prod_status`),
KEY `products_index2` (`prod_start_date`,`prod_end_date`),
KEY `on_sale` (`on_sale`),
FULLTEXT KEY `prod_search` (`prod_name`,`prod_description`),
FULLTEXT KEY `prod_no_2`
LL,
stock ENUM('1','0'),
etc.
) ENGINE=MyISAM;
thanks for any though.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
e are really simple, "standard" if I can say so.
Thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
here is not their cust_id in 'orders'.
>>
>> couls somebody help me?
>>
>> thanks.
>>
>> -afan
>
> I think the most explicit way is with a sub select:
>
> select cust_id from customers where
> cust_id not in
> (select cust_id from
hi to all,
I have table customers (PK cust_id)
I have table orders (PK order_id, FK cust_id)
I need query that will selecct all customers from 'customers' they don't
have any order, there is not their cust_id in 'orders'.
couls somebody help me?
thanks.
-afan
--
M
want to rewrite all my sql statement
>>>
>>> Thanks.
>>>
>>> Jason
>>>
>>>
>
> --
> Anders Lundgren
> Master Software Engineer
> Viba IT Handelsbolag
> Web: http://www.vibait.se
>
>
> [EMAIL PROTECTED] wrote:
>> hi,
>> currently using mysql 4.0.18. want to move to 5.0 (latest stable version
>> for commercil use). is there anytihng I have to be considered DB will
>> not
>> work?
>>
>> thanks.
>>
>> -afan
>>
>>
>>
>>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
hi,
currently using mysql 4.0.18. want to move to 5.0 (latest stable version
for commercil use). is there anytihng I have to be considered DB will not
work?
thanks.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com
I can connect using Putty to the server using port 22.
When I try to connect to the server using port 3306 and got "Connection
timed out"?
Does it mean the port 3306 is blocked?
-afan
> U can chk firewall by doing a telnet to the remote host on 3306 (
> default ) port .
>
&g
ssage
2003. Since I didn't get error "Access denied for [EMAIL PROTECTED]",
I think, even I have correct user/pass, someting else will stop me
(firewall, 3306 is blocked,...), right?
How can I check this?
Thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
nd there skip-networking is already commented. and there is
no line with bind-address?
Found this too:
"To restrict the access to port 3306 you may use in /etc/hosts.deny:
mysql: ALL
and in /etc/hosts.allow:
mysql: IP_ADDRESS_ALLOWED_1 IP_ADDRESS_ALLOWED_2"
is this enough?
thanks fo
> Why do you want to use a switch in this particular instance. You're
> comparing apples and oranges (in this case, col_1 and col_2). You use
> swithc to evaluate one variable against a number of choice, not multiple
> variables against variable choices.
>
I'm not comparing apples and oranges -
thanks for your response.
I'm already working on the php "part" but just wondered how "bad" is to
have backslash in front of quotes.
thanks.
-afan
> [EMAIL PROTECTED] wrote:
>> hi to all.
>>
>> battling this problem on several forums and mailing
hi to all.
battling this problem on several forums and mailing lists, I got confused:
when store string that contains quotations (ie afan's "php" shop) in mysql
does it have to be stored with backslashes (afan\'s \"php\" shop) or just
the way it is? my login's t
Thanks to everybody!
-afan
sheeri kritzer wrote:
See response below:
On 5/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
It looks like today is my day! :)
I FULLTEXT indexed my table "products":
CREATE TABLE `products` (
`prod_id` int(8) unsigned NOT NULL auto_increme
Yup. The problem solved!
Thanks John!
;)
-afan
> [EMAIL PROTECTED] wrote:
>> Ok. Got it.
>> And, since the able is already created and with tons of products inside,
>> how can I change the FULTEXT index?
>> I'm using phpMyAdmin.
>
> Just create a new in
Dude! You just confused me with YOUR QUESTION under MY SUBJECT LINE
:) :) :)
You have to change a Subject and send it again. Or we will not know to
whom is sent.
:)
-afan
> Hello all,
>
> I just inherited an application that has 2 tables under consideration,
> "events"
Ok. Got it.
And, since the able is already created and with tons of products inside,
how can I change the FULTEXT index?
I'm using phpMyAdmin.
Thanks
> [EMAIL PROTECTED] wrote:
>> Hi to all!
>>
>> I have "products" table:
>>
>> CREATE TABLE `products` (
>> `prod_id` int(8) unsigned NOT NULL a
FROM products
WHERE match (prod_name) against ('+red +shirt');
I'll get some results.
But, when I tried this:
SELECT * FROM products
WHERE match (prod_name, prod_description) against ('+red +shirt');
I got this error message:
#1191 - Can't find FULLT
ch (prod_name) against ('+red +shirt');
I'll get some results.
But, when I tried this:
SELECT * FROM products
WHERE match (prod_name, prod_description) against ('+red +shirt');
I got this error message:
#1191 - Can't find FULLTEXT index matching the
Thanks Daniel!
-afan
> On 5/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> found this:
>> /etc/rc.d/init.d/mysqld restart
>> /etc/rc.d/init.d/httpd2 restart
>>
>> I think it should work?
>>
>
> Yeah, different systems, different lo
found this:
/etc/rc.d/init.d/mysqld restart
/etc/rc.d/init.d/httpd2 restart
I think it should work?
-afan
> On 5/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> hi again,
>> I have to restart as soon as possible mysql and apache on our web server
>>
hi again,
I have to restart as soon as possible mysql and apache on our web server
(mandrake cooker 10) - since our admin is "out of office" for today.
if someone can ive me some instructions, please?
1. what I have to restart first apaceh or mysql - or desn't matter?
2. I have sudo access (if I
hi again,
I have to restart as soon as possible mysql and apache on our web server
(mandrake cooker 10) - since our admin is "out of office" for today.
if someone can ive me some instructions, please?
1. what I have to restart first apaceh or mysql - or desn't matter?
2. I have sudo access (if I
Yup! Got it..
Thanks guys, to all of you, for REALLY fast help!
:)
-afan
> Yeah, pretty much, but I would keep cust_id around and start over with a
> true autoincrement from 1.
>
> On 5/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> and this would be,
d replace the cust_id
>> in
>> every other table where cust_id is foreign key?
>> 3. something else?
>>
>> Thanks for any help!
>>
>> -afan
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsu
Cxx with INT numbers and replace the cust_id in
every other table where cust_id is foreign key?
3. something else?
Thanks for any help!
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Nothing' wrong- I just didn't know :)
Yup! It works just fine!
Thanks Paul for your help!
-afan
> At 22:29 -0500 4/27/06, Afan Pasalic wrote:
>>No, not exactly. More as "there is a solution"...
>>What would be the best way to do?
>>
>>-afan
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 timest
Hi,
I was trying to list all registeed users they are "online" last 15 minutes.
I can do it by using timestamp:
= '$start_time'
?>
But, I know there is something like:
SELECT * FROM members WHERE last_access BETWEEN(CURTIME(), INTERVAL 15 MIN)
?!?
Thanks for any h
at's a problem?
Note: OSCOM is database for osCommerce based store and orders_pay_methods
is it's table.
Thanks for any help
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
how to do this?
Thanks for any help
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
I ca try that one too.
Since, I'm bad with reg expressions, what would be solution for something
like "match searched word and it's plural - if one word entred, or match
all words - if more words entered"?
thanks
-afan
> Why not try regex?
>
> http://dev.mysql.com/
anybody solved this problem?
is there any other solution to suggest?
Thanks for any help.
-afan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Accidentally I deleted a whole content of the table. Since it happened
while I was in a testing area (I didn’t do a back up) – no
harm done.
But, I would like to know is there any chance to recover lost data?
Something like Trash can and you can put it back?
-afan
--
MySQL General Mailing List
71 matches
Mail list logo