-3

我被困在试图使下面的代码工作它似乎我的语法中的某些东西没有正确声明我试图更改变量的名称但仍然不起作用,我的数据库中有一个名为包的表,关于错误可能是什么的任何想法?请 :( :

  <?PHP

    include('connection.php');
    include('validation.php');
    include('header.php');

    $PID = $_GET['PID'];
    $q_getpackage = "SELECT * FROM packages WHERE PID=$PID";
    $r_getpackage = mysql_query($q_getpackage,$connection);



    ?>


<!DOCTYPE HTML>
<html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="styles.css" type="text/css" rel="stylesheet"/>
    <link href='http://fonts.googleapis.com/css?family=Courgette' rel='stylesheet'     type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Numans' rel='stylesheet'  type='text/css'>

    <title>Products Information</title>
</head>
<body>



      <div class="packages_wraper"><!--Packages Wraper-->       

      <div class="package_name"><?php echo mysql_result($r_getpackage,0,'name');?></h3>
        <div class="details"><?php echo mysql_result($r_getpackage,0,'details');?</div>
    <div><?php echo mysql_result($r_getpackage,0,'guide');?> </div>
    <div><?php echo mysql_result($r_getpackage,0,'review');?> </div>
        <div class="pic"><img src="<?php echo mysql_result($r_getpackage,0,'pic_url');?>"/></div>

        </div><!--END Packages Wraper--> 

     </div>
</body>
</html>

我有一个错误说:

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/tk1/domains/valbet.tk/public_html/product_info.php on line 33
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/tk1/domains/valbet.tk/public_html/product_info.php on line 34
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/tk1/domains/valbet.tk/public_html/product_info.php on line 35
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/tk1/domains/valbet.tk/public_html/product_info.php on line 36
4

1 回答 1

-1

SQL 语句未正确执行。运行echo mysql_error()mysql_query()看看为什么不,检查输出,并修复它告诉你的任何内容。

(另外,将有关输入验证/准备好的语句/mysqli 的标准警告作为给定的)

于 2012-10-14T14:07:26.787 回答