SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: newbie problem
-
Jun 9, 2001, 15:06 #1
- Join Date
- May 2001
- Location
- Los Angeles, California
- Posts
- 86
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
newbie problem
i have just started using PHP and MySQL. I just wrote this script a little while ago but whenever i run it, i get a parse error on line 27. here is the code:
PHP Code:<html>
<head>
<title>Links</title>
</head>
<body>
<?php
// Connect to the database server
$dbcnx = @mysql_connect("localhost", "username", "password");
if (!$dbcnx) {
echo( "<P>Unable to connect to the database server.</P>" );
exit();
}
// Select the database
if (! @mysql_select_db("database") ) {
echo( "<P>Unable to locate the database</P> );
exit();
}
?>
<P> Links: </P>
<BLOCKQUOTE>
<?php
// Request the text of all the links
$result = mysql_query("SELECT Name, URL, Info from links");
while ($links = mysql_fetch_array($result)) {
$name = $links["Name"];
$url = $links["URL"];
$info = $links["Info"];
// Display links
echo( "<a href='$url'>$name</a> : $info <br>");
}
?>
</blockquote>
</body>
</html>www.iyeinteractive.com - Website Design and Programming
www.totalnonsense.net - my site, Under Construction
-
Jun 9, 2001, 15:17 #2
- Join Date
- Nov 2000
- Location
- Hong Kong
- Posts
- 1,508
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You are missing a " at:
echo( "<P>Unable to locate the database</P> );
so....
echo( "<P>Unable to locate the database</P>");
-
Jun 9, 2001, 15:23 #3
- Join Date
- May 2001
- Location
- Los Angeles, California
- Posts
- 86
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ohhhhhh yes i did, thank you
www.iyeinteractive.com - Website Design and Programming
www.totalnonsense.net - my site, Under Construction
Bookmarks