登录 | 注册 | FAQ
Anonymous

Lesson 20 - Having issues

+ 发表回复

2 篇帖子 分页: 1 / 1


Lesson 20 - Having issues

JusticeEmpire » 周日 7月 06, 2014 10:26 am

Hi All,

I've been using this site to try and code a project that I have been thinking about for sometime, but I am now stuck. I am trying to get a list of information (Distributors in this case) that have links to a detailed information page etc. I've been following Lesson 20, and couldn't get my list until I spotted the $strNavn error. So I have that working, and I get my information page linked etc, but I just get a blank page when I'm on it, it doesn't want to pull any data. I just get my page title, and then my link to return to the list.

Any ideas? Code below:

// Get data from the database depending on the value of the id in the URL
$strSQL = "SELECT * FROM 'distributor_list' WHERE iddistributor_list = " . $_GET["id"];
$rs = mysql_query($strSQL);

// Loop the recordset $rs
while($row = mysql_fetch_array($rs)) {

// Write the data of the person
echo "<dt>ID:</dt><dd>" . $row["iddistributor_list"] . "</dd>";
echo "<dt>Name:</dt><dd>" . $row["distributor_name"] . "</dd>";


}

// Close the database connection
mysql_close();
?>

</dl>
<p><a href="distributors.php">Return to the list</a></p>
头像

JusticeEmpire

  • 帖子: 2
  • 注册: 周日 7月 06, 2014 10:15 am

Re: Lesson 20 - Having issues

JusticeEmpire » 周日 7月 06, 2014 12:40 pm

Hiya,

Thanks for the response.

I do have all the database info, I just simply omitted it from the paste, as I know that is working fine from other pages
头像

JusticeEmpire

  • 帖子: 2
  • 注册: 周日 7月 06, 2014 10:15 am


+ 发表回复

分页: 1 / 1