开发者

A problem with SQL query in PHP [closed]

开发者 https://www.devze.com 2023-03-18 00:11 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

I have a table (T1) with some fields F1,F2 (Columns) with some values in it.

What i tried

$sql=ALTER TABLE T1 AUTO_INCREMENT = 5977284313124, ADD F1 BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT

$sql2 ='UPDATE T1 SET F2 = CONCAT_WS('/','10.5072',F1)';

or concat('10.5072',F1)

The output what i want is should be in the format of 10.5072/F1 (F1 are the values auto incremented from 5977284313124)

Note:'/'

'/' is not an division symbol its just a dummy variable the output should something like this 10.5072/5977284313124 but should not be divided.

Can u help me in writ开发者_StackOverflow中文版ing the code for the above


The problem is not the SQL, it's the use of single quotes around the query and within the query. Look at how SO is highlighting it.

The line assigning to $sql2 should be:

$sql2 = "UPDATE T1 SET F2 = CONCAT_WS('/','10.5072',F1)";
0

精彩评论

暂无评论...
验证码 换一张
取 消