在php中使用mysql [英] Using mysql in php
问题描述
我的桌子设置如下
字段类型
名称varchar(50)
设置varchar(50)
userid int(11)
值文本
现在我试图从数据库中获取name = name的用户ID并且在字段设置字段中设置=月值= 6并且设置=天和值= 7
有各种各样的数据名称2被称为日和月,基本上我试图从数据库中获取用户ID数据当天=今天和月=本月我尝试了这个和其他一些方法,但他们不工作:(
My table is set up like this
Field Type
name varchar(50)
setting varchar(50)
userid int(11)
value text
Now im trying to get the userid from the database where the name = name and setting = month the value = 6 and the setting = day and the value = 7
in the field "setting" there are various data name 2 of them are called day and month and basically im trying to get the userid number from the database where day = today and month = this month ive tried this and a few other ways but they dont work :(
推荐答案
欢迎来到字节。
你得到了吗?任何错误?
tablename应该是
Welcome to Bytes.
Do you get any errors?
tablename should be
tablename,我想。修复它,看看它是如何工作的。
tablename, I imagine. Fix that and see how it works.
@TheServant
嗯,这就是上面的代码类型的工作,但只有当有多个符合搜索时它才会选择一个。
@TheServant
Well thats just it the above code sort of works but it only picks one when there are more than one that meet the the search.
这篇关于在php中使用mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!