vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   possible to run an update query like this? (https://vborg.vbsupport.ru/showthread.php?t=83455)

AN-net 06-20-2005 11:25 PM

possible to run an update query like this?
 
[sql]
UPDATE tablex SET field1=addslahes(field1);[/sql]

Andreas 06-20-2005 11:28 PM

[sql]UPDATE tablex SET field1 = QUOTE(field1)[/sql]

AN-net 06-20-2005 11:38 PM

would i be able to use addslashes inside of QUOTE() or does QUOTE() do that?

also how would i use htmlspecialchars_uni on it?

Andreas 06-20-2005 11:41 PM

addslashes() is a PHP function, QUOTE() a mySQL function.

htmlspecialchars_uni() is a vBulletin function.

AN-net 06-21-2005 12:14 AM

is there anyway i can use htmlspecialchars_uni() like that or would i have to call everything from table and then run an individual query for each?

Paul M 06-21-2005 12:24 AM

Quote:

Originally Posted by AN-net
is there anyway i can use htmlspecialchars_uni() like that

No, mysql will simply reject it as unknown. You would have to pull the records into an array, and then loop round them, converting the field in each row and updating the row back to the db.

AN-net 06-21-2005 01:09 AM

uh...ty all

Marco van Herwaarden 06-21-2005 07:01 AM

Maybe you can make it work using REPLACE().

But what are you trying to do? It makes no sense to me at all, if data is already succesfully inserted into the database, why do you want to run addslashes on it?


All times are GMT. The time now is 01:00 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02616 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete