问题在哪里短语 [英] problem with where phrase

查看:86
本文介绍了问题在哪里短语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我的问题是php
不好用 我写了一个代码来做到这一点
1-从链接中获取$ _GET ["id]的值
2-将具有相同ID的放入数据库中
这是代码

hi all
my problem is abroblem with php
i wrote a code to do this
1-take the value of $_GET["id] from the link
2- bring the the that had the same id in the database
here is the code

<html>
<meta charset="utf-8">
</html>
include ('config.php');
$id=$_get["id"];
if (!$result) {
    die('Query failed: ' . mysql_error());
}
$sql = ('SELECT id as id, filename, link 
        FROM   link
        WHERE  id =$id');
$result = mysql_query ($sql);
if (!$result) {
    echo "Could not successfully run query ($sql) from DB: " . mysql_error();
    exit;
}

if (mysql_num_rows($result) == 0) {
    echo "No rows found, nothing to print so am exiting";
    exit;
}

// While a row of data exists, put that row in $row as an associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
//       then create $userid, $fullname, and $userstatus
while ($row = mysql_fetch_assoc($result)) {
    echo $row["id"];
    echo $row["filename"];
    echo $row["link"];
}

mysql_free_result($result);

?> 


我的问题是,第12行中的$ id没有给出值,因为它是用字符串
写的 我该怎么办


my problem is that $id in the line 12 doesn''t give value because it is wrote in string
what can i do

推荐答案

_GET ["id]从链接
2-将具有相同ID的放入数据库中
这是代码
_GET["id] from the link
2- bring the the that had the same id in the database
here is the code
<html>
<meta charset="utf-8">
</html>
include ('config.php');


id =


_get ["id"]; 如果(!
_get["id"]; if (!


这篇关于问题在哪里短语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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