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
最满意答案
你做错了一件事就是你在之前的元素完成之前就开始了新的动画。
那是因为您正在使用计时插件并以固定间隔触发新动画。 最好使用
.animation()
方法的回调参数,并在上一个完成后启动一个新动画。http://jsfiddle.net/gaby/qaGyS/2/的演示
另一件事是,你在很长一段时间内(对于那个距离)动画很小的距离。 例如,你在一秒钟内制作10个像素的动画..这很慢,你可以看到各个动作..
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 ...
-
jQuery动画(jQuery animation)[2023-05-01]
我会建议使用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/ ...
-
jQuery Quicksand:在JS加载导致生涩行为后应用CSS(jQuery Quicksand: CSS applied after JS load causes jerky behaviour)[2022-10-22]
问题是CSS被应用于jQuery正在执行的ID。 因此,每次有任何jQ操作时,都会重新加载样式。 通过应用CSS所采用的类,两者保持分离,因此立即应用了样式。 ie- jQ作用于#magazines而CSS也代表#magazines导致加载延迟。
- jQ作用于#magazines ,CSS作用于.mag-list是.mag-list的方法。 The problem was the CSS was a ...
-
为什么我的简单CSS过渡动画在智能手机上生涩?(Why is my simple CSS transition animation jerky on smartphones?)[2022-10-06]
由于您没有使用转换,这听起来更像是性能问题。 在Chris Coyier 的动画故事中提到过 使用translate()移动元素比使用top / right / bottom / left具有更好的性能已成为常见的通用建议。 [...]保罗与Chrome团队的另一位Paul保罗·刘易斯谈过,他同意“使用translate()进行设计动作更聪明”。 但接着说,这比帧速率更多。 使用translate(),您将获得子像素动画,这是像素之间的一种模糊,通常会导致更平滑的动画 您还可以阅读这篇关于CSS Trans ... -
Jquery - 生涩的动画(Jquery - Jerky animation)[2023-06-20]
你做错了一件事就是你在之前的元素完成之前就开始了新的动画。 那是因为您正在使用计时插件并以固定间隔触发新动画。 最好使用.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(); ...
-
jQuery幻灯片效果很酷(jQuery Slide Effect is Jerky)[2023-12-26]
所需更改: 我在#cocket.inside css中更改了你的css中的几行,因为它应该是250px而不是260px。 我改变的另一件事是我在'toggleO'div上包含了一个包装div,以防止边框对动画的影响。 从现在开始,动画将应用于包装器,而不是包含边框的toggleO。 第三个也是最重要的变化包括“溢出:隐藏;” 在#container css中。 这将消除在应用上述步骤后留下的小冲击。 这是一个修改过的jsfiddle: https ://jsfiddle.net/o0LcoLg1/8/ 和代 ...