可以说字段名称为bla
,值为123
当我这样做时:
mysqli_query($con, "UPDATE table SET bla = REPLACE (bla, 123, 777)");
123
变为777
并且它很好
但是当我这样做时:
mysqli_query($con, "UPDATE table SET bla = REPLACE (bla, 1, 777)");
我不希望123
成为77723
但是留下123
我该怎么做?
答案 0 :(得分:4)
为什么在没有int main(int argc, char *argv[]) {
char *hexstring = "08fc0021";
unsigned long hexnumber = 0u;
unsigned short a = 0u;
unsigned short b = 0u;
/* Use sscanf() to convert the string to integer */
sscanf(hexstring, "%x", &hexnumber);
/* Use bitwise and to filter out the two higher bytes *
* and shift it 16 bits right */
a = ((hexnumber & 0xFFFF0000u) >> 16u);
/* Use bitwise AND to filter out the two lower bytes */
b = (hexnumber & 0x0000FFFFu);
printf("0x%X 0x%X\n",a,b);
return 0;
}
子句的情况下使用REPLACE
?出了什么问题:
WHERE