现有sql语句如下:
insert into test(A,B)values('$A','$B')
update test set A='$A' where B='$B'
因为多语言的问题,现在需要将sql语句替换成如下:
insert into test(A,B)values(N'$A',N'$B')
update test set A=N'$A' where B=N'$B'
请问用文本编辑器(phpDesigner 8,Notepad++,EditPlus)里的正则替换能够实现批量替换吗?
因为文件实在是太多了,真心改不起
求大神帮忙
回复讨论(解决方案)
你改下字段类型不就行了吗?
NVARCHAR 改为 VARCHAR
php 的正则替换
$txt = preg_replace("/'\$\w/", 'N$0', $txt);
现有sql语句如下:
insert into test(A,B)values('$A','$B')
update test set A='$A' where B='$B'
因为多语言的问题,现在需要将sql语句替换成如下:
insert into test(A,B)values(N'$A',N'$B')
update test set A=N'$A' where B=N'$B'
请问用文本编辑器(phpDesigner 8,Notepad++,EditPlus)里的正则替换能够实现批量替换吗?
因为文件实在是太多了,真心改不起
求大神帮忙
嗯,之前本来是varchar的,但是后来因为德语的关系,如果是varchar的话,数据库内存储就会变成?了,所以才修改了数据库类型为nvarchar,但是这样的话sql里就必须得加N才能没问题,所以才想找某种方式批量正则替换一下代码
你改下字段类型不就行了吗?
NVARCHAR 改为 VARCHAR
php 的正则替换
$txt = preg_replace("/'\$\w/", 'N$0', $txt);
嗯,之前本来是varchar的,但是后来因为德语的关系,如果是varchar的话,数据库内存储就会变成?了,所以才修改了数据库类型为nvarchar,但是这样的话sql里就必须得加N才能没问题,所以才想找某种方式批量正则替换一下代码
自己解决了,结贴了

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Alipay PHP...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.