我正在使用此代码作为选项标签的帖子文本:
$("#major_names").change(function () {
$.post('find_lesson.php', { dars:$("#major_names option:selected").text() },
function(data){
if (data.success)
$("div").append(data.doroos);
else
alert('mm');
},'json');
return false;
});
Run Code Online (Sandbox Code Playgroud)
现在在find_lesson文件中我使用此代码从数据库中获取任何记录
<?php
$lessonName=$_POST['lesson '];
$query= mysql_query("SELECT * FROM at_*** WHERE title = '{$lessonName}'");
$result= mysql_fetch_array($query);
$sql= mysql_query("SELECT * FROM *** JOIN at_lessons ON . . .");
while($result=mysql_fetch_assoc($sql))
{
$data ['doroos']= $result['title'];
}
$data['success']=true;
echo json_encode($data);
?>
Run Code Online (Sandbox Code Playgroud)
mysql命令是正确的但是在发送数组后我得到了1条记录.请帮我
在我的应用程序中我onSaveInstanceState在每个活动和文件中很多,现在在阅读此链接后创建Parcelable类我不能使用它并保存到这个类中
默认onSaveInstanceState是:
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
savedInstanceState.putBoolean("IsShowingExitDialogs", mIsShowingExitDialogs);
savedInstanceState.getInt("LastMenuItemSelected", mLastMenuItemSelected);
}
Run Code Online (Sandbox Code Playgroud)
现在我不能使用下面这行保存IsShowingExitDialogs或LastMenuItemSelectedParcable类:
savedInstanceState.putParcelable("IsShowingExitDialogs", mIsShowingExitDialogs);
savedInstanceState.putParcelable("IsShowingExitDialogs", mLastMenuItemSelected);
Run Code Online (Sandbox Code Playgroud) 以下代码是我的第一个Expressrestfull应用程序.运行server.js后http://localhost:3020/helloworld,我想在FireFox上输入url 后得到Hello, World!消息,但我收到此消息:
Cannot GET /helloworld
Run Code Online (Sandbox Code Playgroud)
码:
var express = require('express');
var router = express.Router();
var app = express();
var server = require('http').createServer(app);
var port = process.env.PORT || 3020;
/* GET home page. */
router.get('/helloworld', function(req, res) {
res.render('helloworld', { title: 'Hello, World!' });
});
server.listen(port, function () {
console.log('Server listening at port %d', port);
});
Run Code Online (Sandbox Code Playgroud) 我是 Kotiln 的新手,这段代码是我在 Android 上使用的简单类。在这个类中,我想制作简单的侦听器来检测对类内项目的点击,例如活动、片段或适配器。我的问题是我可以为circularProgressView小部件定义这个监听器。
class DownloadProgressView : RelativeLayout {
var progressListener: ((downloading: Boolean) -> Unit)? = null
private var downloading = false
constructor(context: Context?) : super(context) {
init()
}
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
init()
}
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init()
}
private fun init() {
LayoutInflater.from(context).inflate(R.layout.download_progress_layout, this)
circularProgressView.setOnClickListener {
downloading = !downloading
setProgressViews(downloading)
progressListener?.invoke(downloading)
//if listener!=null then onItemClicked.onClick();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我怎么知道用户是否点击了circularProgressView内部活动?
我正在尝试实现这个接口并在 Kotlin …
我在Stackheight的小部件中有一个容器100.0。它使用Positioned小部件定位在中心,如下所示
Container(
width:100.0,
height:100.0,
child: Stack(
fit: StackFit.expand,
children: <Widget>[
Positioned(
top: 40.0,
child: Container(
width: 20.0,
height: 20.0,
color: Colors.red,
),
)
],
)
)
Run Code Online (Sandbox Code Playgroud)
我想以这样的方式为红色容器设置动画,当点击它时它会到达父容器的底部,当再次点击时会弹回到顶部然后回到中心。
我尝试使用,Curves.elasticOut但这对我来说还不够弹跳。我如何实现这种效果
在容器中,你认为我有AppBar()一个女巫,我想要另一个隐形容器,就像这个屏幕截图一样:
因为另外两个容器是不可见的,我想通过从上到下或从下到上滑动来显示它们,以更改可见或不可见的可见性
从上到下滑动显示或从顶部滑动隐藏
从下到上滑动显示或从下滑动到隐藏
有没有库可以实现这个滑动动画?
在这个Chewie库配置中,我如何隐藏控制器中的 和 部件fullScreen?mutetime
VideoPlayerController _videoPlayerController;
ChewieController _chewieController;
_videoPlayerController= VideoPlayerController.network(videoUrl);
_chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
aspectRatio: 1,
autoInitialize: true,
autoPlay:true,
looping: looping,
errorBuilder: (context, errorMessage) {
return Center(
child: Text('ERROR');
});
Run Code Online (Sandbox Code Playgroud) 在定义此 api 路由后,我尝试使用简单的 laravel api 来获取和发送请求api.php:
Route::prefix('Api/v1')->group(function () {
Route::any('login', 'Api\v1\AuthController@login');
Route::any('register', 'Api\v1\AuthController@register');
});
Run Code Online (Sandbox Code Playgroud)
并在目录中创建 AuthController app/http/controller/Api/v1:
class AuthController extends Controller
{
public function login()
{
dd(request()->all());
}
public function register()
{
dd(request()->all());
}
}
Run Code Online (Sandbox Code Playgroud)
我404在此链接上收到错误:
http://127.0.0.1:8000/Api/v1/login
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
在我的register表单中,我有一个username表单输入字段,我只想用以下规则验证它:
'required|regex:/^[a-zA-Z]+$/u|min:5|max:15|unique:users'
Run Code Online (Sandbox Code Playgroud)
我想得到验证错误并用另一种方式发送它来查看,而不是像实现那样使用bags视图中的消息Laravel。例如:
'required|regex:/^[a-zA-Z]+$/u|min:5|max:15|unique:users'
Run Code Online (Sandbox Code Playgroud)
成分:
<input type="text" class="form-control"
name="username"
wire:model="username"
value="{{old('username')}}">
Run Code Online (Sandbox Code Playgroud)
在这Component我怎样才能得到验证错误?
在 Laravel 迁移中,我有这一行:
$table->tinyInteger('action_type')->index();
Run Code Online (Sandbox Code Playgroud)
当我尝试使用以下代码将数据保存在表中时:
ActionsLog::create([
'account_id' => auth()->user()->id,
'action_type' => 1, //like
'log', $ex->getMessage()
]);
Run Code Online (Sandbox Code Playgroud)
laravel 无法返回该名称所在的第三列,action_type我收到此错误:
Column not found: 1054 Unknown column '1' in 'field list' (SQL: insert into `actions_logs` (`account_id`, `action_type`, `1`, `updated_at`, `created_at`) values (2, 1, SQLSTATE[42S22]: Column not found: 1054 Unknown column '1' in 'field list' (SQL: insert into `actions_logs` (`account_id`, `action_type`, `1`, `updated_at`, `created_at`) values (2, 1, Use of undefined constant ture - assumed 'ture' (this will throw an Error in a …Run Code Online (Sandbox Code Playgroud) 在我的mysql数据库中,我有instagram_actions_histories带有两个重要列的表as action_type和action_name,现在我想使用count和case语句获取ids列的计数,例如:
等于和等于“喜欢” id时所有s的计数action_type1action_name
select `account_id`,
count(case when action_type = 1 and action_name='like' then id else 0 END) as `like`,
count(case when action_type = 1 and action_name='superLike' then id else 0 END) as `superLike`,
count(case when action_type = 2 then id else 0 END) as `follow`,
from `instagram_actions_histories`
where `instagram_actions_histories`.`account_id` in (1)
group by `account_id`
Run Code Online (Sandbox Code Playgroud)
不幸的是我得到错误的结果,因为所有输出都是相同的,例如:
account_id like superLike follow
1 1282 1282 1282
Run Code Online (Sandbox Code Playgroud)
正确的结果应该是:
account_id like superLike follow …Run Code Online (Sandbox Code Playgroud) flutter ×3
laravel ×3
android ×2
php ×2
java ×1
javascript ×1
jquery ×1
json ×1
kotlin ×1
laravel-5.6 ×1
mysql ×1
node.js ×1
parcel ×1
parcelable ×1
sql ×1