帮助显示MySQL查询结果 [英] Help with displaying MySQL query results

查看:87
本文介绍了帮助显示MySQL查询结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是PHP的新手,并试图整理一个简单的脚本,用于检索个人记录的MySQL数据。


MySQL表我正在使用的包括:


0:id

1:名称

2:位置(与...相关的整数一个单独的位置表)。

3:详细信息


我希望脚本列出结果,例如,名称有一个

位置4.


每个结果都应该显示在它自己的段落中。


每个结果应该在一个链接打开一个新页面(details.php?)

将检索该名称的详细信息。


理想情况下,但不是本质上,新页面应该包含一个回到

之前结果的链接。


我已经设法凑齐了一些显示初始结果的东西

但是,尽管谷歌拖网,但还是没有成功地完成其余的工作。

(这很难看并且不安全所以最好从头开始。)


任何指针都感激不尽。


LH


-

没有sig遗憾。

I''m very new to PHP and attempting to put together a simple script for
retrieving MySQL data of personal records.

The MySQL table I''m using consists of:

0: id
1: name
2: location (an integer relating to a separate table of locations).
3: details

I want the script to list results where, for example, name has a
location of 4.

Each result should be displayed in it''s own paragraph.

Each result should be within a link to open a new page (details.php ?)
that will retrieve the details for that name.

Ideally, but not essentially, the new page should contain a link back to
the previous results.

I''ve managed to cobble together something displays the initial results
but, despite trawling Google, haven''t managed to suss out the rest.
(It''s ugly and insecure so probably best to start from scratch.)

Any pointers gratefully received.

LH

--
No sig regrets.

推荐答案

Lloyd Harold写道:
Lloyd Harold wrote:

我是PHP的新手,并试图整理一个简单的脚本,用于检索个人记录的MySQL数据。


我正在使用的MySQL表包括:


0:id

1:name

2:location (与单独的位置表相关的整数)。

3:详细信息


我希望脚本列出结果,例如,name有一个

位置4.
I''m very new to PHP and attempting to put together a simple script for
retrieving MySQL data of personal records.

The MySQL table I''m using consists of:

0: id
1: name
2: location (an integer relating to a separate table of locations).
3: details

I want the script to list results where, for example, name has a
location of 4.


query =" select * from mytable where location ='''4''" ;;
query="select * from mytable where location =''4''";


result = mysql_query(
result=mysql_query(


这篇关于帮助显示MySQL查询结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆