使用while循环将mysql数据显示为html链接 [英] Display mysql data as html link using while loop

查看:81
本文介绍了使用while循环将mysql数据显示为html链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用while循环整齐地显示来自MySQL数据库的产品数据。

显然这不会起作用:



Hi, I want to display product data from MySQL data base neatly using a while loop.
Obviously this wont work:

<?php
$Area = $_POST['Area'];
$connect = mysql_connect("localhost", "root") or die (mysql_error());
mysql_select_db($vendor, $connect);

$sql = "SELECT * FROM products WHERE Area ='$Area'";
$result = mysql_query($sql, $connect);
while ($row = mysql_fetch_array($result)) {
?><a href='product.php'><?
echo   "" . $row['Title'] . '<br>' ;
echo   "" .$row['Price'] . '<br>' ;
?></a><?

}
?>





有人能给我一个解决方案吗?可以是任何编码语言,只要它有效!

非常感谢!



Can anyone give me a solution? Can be any coding language as long as it works!
Thanks a lot!

推荐答案

区域 =
Area =


_POST [' Area'];
_POST['Area'];


connect = mysql_connect( localhost root die(mysql_error());
mysql_select_db(
connect = mysql_connect("localhost", "root") or die (mysql_error()); mysql_select_db(


这篇关于使用while循环将mysql数据显示为html链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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