我有一个用php设计的网站,有mysqli(mysql改进)扩展.phpinfo()页面显示了这个:
./configure --disable-fileinfo --disable-phar --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes - -enable-mbstring --enable-pdo = shared --enable-soap --enable-sockets --enable-wddx --enable-zend-multibyte --enable-zip --prefix =/usr --with-bz2 - -with-curl =/opt/curlssl/--with-curlwrappers --with-freetype-dir =/usr --with-gd --with-imap =/opt/php_with_imap_client/--with-imap-ssl =/usr --with-jpeg-dir =/usr --with-kerberos --with-libdir = lib64 --with-libexpat-dir =/usr --with-libxml-dir =/opt/xml2 --with-libxml -dir =/opt/xml2/--with-mcrypt =/opt/libmcrypt/--with-mysql =/usr --with-mysql-sock =/var/lib/mysql/mysql.sock --with-mysqli =/usr/bin/mysql_config --with-openssl =/usr --with-openssl-dir =/usr --with-pcre-regex =/opt/pcre --with-pdo-mysql = shared --with- pdo-sqlite = shared --with-pic --with-png-dir =/usr --with-pspell --with-sqlite = shared --with-tidy =/opt/tidy/--with-xmlrpc - with-xpm-dir =/usr --with-xsl =/opt/xslt/--with-zlib --with-zlib-dir =/USR …
我有一个现有的mysql表,其id列定义为primary,并且auto-increment设置为true.现在,我想知道我是否可以将自动增量设置为从预定义值开始,例如5678,而不是从1开始.
我还想知道我是否可以设置自动递增的步骤,比如每个新记录插入增加15(而不是默认增量值1).
注意 - 我使用phpmyadmin来玩数据库,我有很多表但只有一个数据库.
谢谢.
是否有某种方法来拉出你的mysql数据库的架构?
我在这些数据库中有很多db和table,我在本地机器上使用phpmyadmin和WAMP.
我需要提取模式,或至少数据库名称,表名,列及其属性(例如INT(2)),并将其导出为csv/excel /最终可以在excel中编辑的任何格式.
我用:
服务器:
Apache/2.2.21 (Win64) PHP/5.3.8
MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
PHP extension: mysqli Documentation
MySQL的:
Server: localhost (localhost via TCP/IP)
Server version: 5.5.16-log
Protocol version: 10
User: root@localhost
MySQL charset: UTF-8 Unicode (utf8)
谢谢!
关于mySQL的问题.
我有一个表格,如下所示:
BasePrice, Discount, NetPrice
Run Code Online (Sandbox Code Playgroud)
现在假设净价的计算如下:
NetPrice = BasePrice - Discount
Run Code Online (Sandbox Code Playgroud)
现在,我不介意在我自己的列中输入BasePrice和Discount值,手动使用phpMyadmin(即直接后端更新).由于该NetPrice值涉及如上所示的计算,因此我不想更新表中每行的列值,而是希望数据库自动为我更新它(not that I am weak at math :)).
有没有让数据库NetPrice自动更新列值?我知道我可以使用php获取其他两个列值,计算然后NetPrice再次使用PHP代码更新值,但更喜欢db自己做它而没有任何php /服务器端脚本.
我使用mySQL和phpMyadmin作为dev.
谢谢.
我正在设计一个网页表单,其中包含几个文本框和textarea字段,并注意到这些字段存在某些对齐问题.
代码如下 -
<textarea rows="4" cols="30" name="details"></textarea>
<input type="text" name="username" size="30"></input>
Run Code Online (Sandbox Code Playgroud)
虽然两个字段的col宽度都设置为30,但我看到textarea宽度超出了文本框的宽度.我使用overflow:隐藏使用css作为textarea字段,然后尝试使用cols属性设置为25,26等来调整大小,但仍然看到对齐不完美(虽然非常接近).
问题 - 是否有更好的方法将表格中的所有字段对齐,使标准宽度为30cols?
我必须在图像属性中找到并替换"b"with ."g"src
最初的SRC会是这样的"someName-b.png",使用JavaScript,我不得不更换"b"用"g".但问题是"someName"长度可能不同.所以基本上我想要做的是从src属性字符串的末尾找到第5个字符,然后将第5个字符替换为"g".
JavaScript中是否有一个函数允许我x从字符串的末尾找到第th个字符?