0

I know this is pretty dumb question but I just wanted to ask because I am not sure if I can figure it out by myself. :(

So here is the deal. I have a mysql database called "appinfo" there there is a table called "appdis"

Now in that table there is three columns. Fist one is ID, second one is name and last one is a long description. Now how can I show only that long description on my webpages and nothing else?

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by stupidenator
0

Here's an example of how to use php to query a mysql database:

<html>
<head>
</head>
<body>
<?php

$dbhost = "localhost"; // may be something else
$dbuser = "user"; // enter your db username
$dbpass = "pass"; // enter your db password
$db = "appinfo";

    $con = mysql_connect($dbhost, $dbuser, $dbpass)
        or die("The site database appears to be down.");

    if ($db!="" and !mysql_select_db($db))
        die("The site database is unavailable");
mysql_select_db($db, $con);
$sql = "SELECT description FROM appdis";

$result = mysql_query($sql);

while($row=mysql_fetch_array($result))
{ ?>
    <p><?php echo $row['description']; ?></p>
<?php }
?>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.