我的桌子像以下一样,用此来挽救上载的形象。 客户希望图像成为<代码>{id}.{jp>gif}。
create table imgae(
id int autoincrement,
image text
)
怎么能够只添加一个缩略语的新记录。
我的桌子像以下一样,用此来挽救上载的形象。 客户希望图像成为<代码>{id}.{jp>gif}。
create table imgae(
id int autoincrement,
image text
)
怎么能够只添加一个缩略语的新记录。
你不能用在MySQL的单篇发言来做。 如果MySQL支持Oracle式序列,你就可以在一份声明中这样做。 但是,由于汽车的增量赢得一只 give,直到<>>><>>>之后。 添加的字句实际上需要插入字句,然后才能查阅。 在我SQL最接近的是:
insert into imgae (image) values (null);
update imgae set image=concat(last_insert_id(), .jpg ) where id=last_insert_id();
BTW:我看见您的表格,可能称为imgae
。 页: 1 而且,当我试图管理<代码>create table statement时,该表即告失败。 我不得不作两番改动,以便让我能够证实我的回答。 它希望:
create table imgae(id int auto_increment primary key, image text);
INSERT INTO “imgae” VALUES(“image”) (CONCAT(LAST(“id”) + 1, /*code for fetching the extension/)
INSERT INTO imgae (image) VALUES (CONCAT(LAST_INSERT_ID() + 1, ".jpg"));
但是,这实际上并没有打上图像。 你们必须保证,在这样做之后,你会利用我sql_inser_id()获得这一价值。
在ID已经放在另一栏时,将id放在一栏似乎多余。 为什么不保持id,而只是担心档案延期的存放? (假定{id}.{jpg >>>>
均为该栏中的内容,并作为<>text的代码表示严重错误。 然后对他们进行盘问,并编组id和分机,以取得结果。
......或我失踪
I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...
<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...
我把我的用心从使用QQL转向MySQL。 它与凯科特合作,现在不工作,因为我已经改变,使用MySQL。 这里的错误信息是:
We have a restaurant table that has lat-long data for each row. We need to write a query that performs a search to find all restaurants within the provided radius e.g. 1 mile, 5 miles etc. We have ...
Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...
Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...
What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...
My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...