首页 \ 问答 \ php中的mysql多语句(Mysql multi statement in php)

php中的mysql多语句(Mysql multi statement in php)

我不是很擅长说英语,所以我支持谷歌的翻译,谢谢。

会发生什么事情,我正在使用谷歌地图api,我有一些商店的数据库,数据库是这些的方向,用javascript获取商店和用户的位置之间的距离,我想要的主题按接近程度排序,我所做的是第一页计算所有离开,然后重定向以下格式"pagina.php?data=(ID, DISTANCE),(ID, DISTANCE), ..... "

然后得到参数

<?php $data = $ _GET['data'] ?>   // and example of "data" -> "(1,1582),(2,3568)," end with comma

我正在尝试使用这个命令“”在phpMYAdmin中工作“”

CREATE TEMPORARY TABLE distancias_temporales (id int(50) NOT NULL, distancia DECIMAL(12,2) NOT NULL DEFAULT 0.00);

INSERT INTO distancias_temporales (id, distancia) VALUES (1, 14.25), (2, 13.34);

SELECT * FROM talleres,distancias_temporales WHERE distancias_temporales.id = talleres.ID ORDER BY distancia ASC;

当然要做动态变化值:

$ data = "(-1, -1)";
if (isset ($ _GET ['data'])) {
$ data = $ _GET ['data']. "(-1, -1)";
}

在第二行:

 "INSERT INTO d (id, distancia) VALUES ".$data.";";

但是mysql根据他告诉我的页面发送了我的错误,代码按我的意愿发送

但是当我试图放在页面上时它不起作用......

任何人都可以帮助我,我认为这个问题将是多重查询


I'm not very good at speaking English so I'm supporting the translator of google, thanks.

What happens is that I'm working with google maps api and I have a database with some shops, the database is the direction of these, that with a javascript get the distance between the store and the location of user, the topic I want to sort by proximity, what I did was a first page which calculates all away and then redirects the following format "pagina.php?data=(ID, DISTANCE),(ID, DISTANCE), ..... "

then get the parameter

<?php $data = $ _GET['data'] ?>   // and example of "data" -> "(1,1582),(2,3568)," end with comma

And I'm trying to use this command "" THAT WORKS IN phpMYAdmin ""

CREATE TEMPORARY TABLE distancias_temporales (id int(50) NOT NULL, distancia DECIMAL(12,2) NOT NULL DEFAULT 0.00);

INSERT INTO distancias_temporales (id, distancia) VALUES (1, 14.25), (2, 13.34);

SELECT * FROM talleres,distancias_temporales WHERE distancias_temporales.id = talleres.ID ORDER BY distancia ASC;

Of course to do dynamic change values​​:

$ data = "(-1, -1)";
if (isset ($ _GET ['data'])) {
$ data = $ _GET ['data']. "(-1, -1)";
}

and in the second line:

 "INSERT INTO d (id, distancia) VALUES ".$data.";";

but mysql send my an error according to what he tells me the page, the code is sent as I want

But it does not work when I try to put on the page ...

anyone can help me, the problem I think would be the multi query


原文:https://stackoverflow.com/questions/17416856
更新时间:2022-02-01 12:02

最满意答案

你做错了一件事就是你在之前的元素完成之前就开始了新的动画。

那是因为您正在使用计时插件并以固定间隔触发新动画。 最好使用.animation()方法的回调参数,并在上一个完成后启动一个新动画。

http://jsfiddle.net/gaby/qaGyS/2/的演示


另一件事是,你在很长一段时间内(对于那个距离)动画很小的距离。 例如,你在一秒钟内制作10个像素的动画..这很慢,你可以看到各个动作..

http://jsfiddle.net/gaby/qaGyS/1/上使用更快的动画


One thing you are doing wrong, is that you are firing new animations before the previous ones have finished for an element..

That is because you are using the timing plugin and firing the new animation on fixed intervals. Better to use the callback argument of the .animation() method and start a new animation after the previous has completed..

demo at http://jsfiddle.net/gaby/qaGyS/2/


Another thing, is that you are animating a very small distance over a long time (for that distance). For example you animating 10 pixels over a second .. this is slow and you can see the individual movements..

with faster animations at http://jsfiddle.net/gaby/qaGyS/1/

相关问答

更多
  • 您可以使用回调使一个接一个的动画发生。 此外,我将一些动画从幻灯片更改为淡入淡出以使其看起来更平滑。 拥有太多幻灯片往往会使网页看起来很笨拙。 // jQuery Shortcuts const search_bar = $('#search_bar'); const search_button = $('#search_button'); const search_query = $('[name=search_ ...
  • 屏幕保护程序没有太多特殊之处。 我假设你已经开始使用Core Animation Programming Guide ? 通过乐器运行它会给你很多关于你花费太多时间的信息。 你用来做淡入的代码会很有用。 对于你所描述的,你甚至不需要CABasicAnimation; 你可以设置图层的动画属性,默认为动画。 确保你已经阅读过隐式动画 。 该页面的其余部分可能也有用。 CoreAnimation中的大部分工作都已经完成。 我一般都知道它在做什么,而大部分问题都来自于猜测它试图告诉它太多。 There isn't ...
  • 我会建议使用CSS阴影,而不是JS 。 过去我已经处理了这个确切的问题,并且我已经完全停止使用JS进行投影。 我从来没有见过JS阴影的动画看起来像纯CSS一样流畅。 另外,使用太多的JS来改变页面元素可能会导致性能问题。 I would suggest using CSS for your drop shadows, and not JS. I have dealt with this exact problem in the past and I have completely stopped using ...
  • 拖动元素时,它会更改左侧和顶部位置。 当你删除它时,你改变它在DOM中的位置,但是你永远不会指定一个新的顶部和左边,所以它在拖动它时仍然保持一个。 动画就在那里,因为你有一个恢复为真的,它会放回原始位置并为其设置动画。 简单的解决方案是将恢复设置为“无效”(因此只有在没有掉线的情况下)并在交换功能中设置左侧和顶部。 喜欢这个 revert: 'invalid' ... b.style.left = ''; b.style.top = ''; https://jsfiddle.net/huw2Lkgb/1/ ...
  • 问题是CSS被应用于jQuery正在执行的ID。 因此,每次有任何jQ操作时,都会重新加载样式。 通过应用CSS所采用的类,两者保持分离,因此立即应用了样式。 ie
      jQ作用于#magazines而CSS也代表#magazines导致加载延迟。
        jQ作用于#magazines ,CSS作用于.mag-list是.mag-list的方法。 The problem was the CSS was a ...
  • 由于您没有使用转换,这听起来更像是性能问题。 在Chris Coyier 的动画故事中提到过 使用translate()移动元素比使用top / right / bottom / left具有更好的性能已成为常见的通用建议。 [...]保罗与Chrome团队的另一位Paul保罗·刘易斯谈过,他同意“使用translate()进行设计动作更聪明”。 但接着说,这比帧速率更多。 使用translate(),您将获得子像素动画,这是像素之间的一种模糊,通常会导致更平滑的动画 您还可以阅读这篇关于CSS Trans ...
  • 你做错了一件事就是你在之前的元素完成之前就开始了新的动画。 那是因为您正在使用计时插件并以固定间隔触发新动画。 最好使用.animation()方法的回调参数,并在上一个完成后启动一个新动画。 http://jsfiddle.net/gaby/qaGyS/2/的演示 另一件事是,你在很长一段时间内(对于那个距离)动画很小的距离。 例如,你在一秒钟内制作10个像素的动画..这很慢,你可以看到各个动作.. 在http://jsfiddle.net/gaby/qaGyS/1/上使用更快的动画 One thing ...
  • 您想使用CSS3转换和转换。 You want to use CSS3 Transforms and transitions.
  • 所以我添加了一个Hack来使这个工作在Tab4上。 在应用旋转功能结束时,我添加了以下代码。 // hack for the Tab 4 new CountDownTimer(mFlipAnimationTime * 2, 33) { @Override public void onTick(long millisUntilFinished) { mFlipView.refreshDrawableState(); ...
  • 所需更改: 我在#cocket.inside css中更改了你的css中的几行,因为它应该是250px而不是260px。 我改变的另一件事是我在'toggleO'div上包含了一个包装div,以防止边框对动画的影响。 从现在开始,动画将应用于包装器,而不是包含边框的toggleO。 第三个也是最重要的变化包括“溢出:隐藏;” 在#container css中。 这将消除在应用上述步骤后留下的小冲击。 这是一个修改过的jsfiddle: https ://jsfiddle.net/o0LcoLg1/8/ 和代 ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)