回答
$ USER_ID = mysql_real_escape_string($ _ GET [ '身份证']); (“SELECT DISTINCT username,email FROM users WHERE userid ='”$ user_id“'”);}};}}
所以我有点需要得到一个用户名,从我的数据库电子邮件我只有一个用户ID ...所以我有一个数据库像所以Userid用户名电子邮件密码1 Ryan [email protected] **** – Ryan 2011-05-16 03:53:28
哦,也即将使用此代码0倒票接受 \t $ user_id = mysql_real_escape_string($ _ GET ['id']); mysql_query(“SELECT DISTINCT username,email FROM users WHERE userid ='”$ user_id“'”); 以及如何获取用户名和电子邮件值,如果数据库查询 – Ryan 2011-05-16 04:05:27
好吧,我刚刚在我的网站上试过,它已经出来了资源ID#7和资源ID#7,它不会显示名称或电子邮件?我有用户这个代码.... $ user_id = $ _GET ['id']; $ fullname = mysql_query(“SELECT DISTINCT'username' FROM'users' where'userid' ='$ user_id'”); $ email = mysql_query(“SELECT DISTINCT'Email' FROM'users' WHERE'userid' ='$ user_id'”); – Ryan 2011-05-16 05:08:40
回复您的具体问题,你可能需要类似:
$id = (int) $id;
mysql_query("select users.* from users where users.userid = $id;");
有一个PHP的教程在这里:
http://php.net/manual/en/tutorial.php
一个MySQL的教程在这里:
http://dev.mysql.com/doc/refman/5.6/en/tutorial.html
而一个更好的PostgreSQL的教程在这里:
+ 1为postgres教程 – colinmarc 2011-05-15 07:46:06
- 1. PHP和Mysql数据库
- 2. MySQL数据库和PHP
- 3. PHP/MYSQL使用数据库和PHP
- 4. 访问MySQL数据库和PHP和Android
- 5. PHP,MySQL,数据库
- 6. 数据库生成器php和mysql
- 7. PHP和Mysql数据库更新问题
- 8. 数据库创建使用PHP和MySQL
- 9. 使用MySQL数据库和PHP搜索
- 10. PHP和MySQL在数据库中存储
- 11. PHP和MySQL:数据库内不打印
- 12. PHP,MySQL内存数据库和memcached
- 13. php和mySQL数据库并发更新
- 14. MySQL数据库组合和PHP选择
- 15. PHP和MySQL:优化数据库
- 16. 使用PHP和MySQL重置数据库
- 17. 不插入数据库。 PHP和mysql
- 18. 轨道上的MySQL数据库和PHP
- 19. PHP和MySQL“数据库连接”
- 20. PHP和MySQL查询数据库
- 21. MySQL和PHP - 从数据库中获得
- 22. PHP和MySQL不更新数据库
- 23. MySQL和PHP数据库错误
- 24. PHP和MySQL从数据库中选择
- 25. MONTH的Mysql和php数据库分离
- 26. 用android连接php和mysql数据库
- 27. Android和PHP连接到MySQL数据库
- 28. 插入到MySQL数据库和PHP
- 29. 更新MySQL数据库和PHP
- 30. php和mysql数据库拉错误
我想我不确定你到底在问什么。你能详细说明吗? – 2011-05-15 06:57:10
请给我们表的定义,并解释你真的需要 – Marco 2011-05-15 07:01:12