|
Posted by Marc on 10/13/98 11:27
plato wrote:
> <?PHP
>
> //alter you variables here
> $host = "localhost";
> $username="";
> $password="";
> $database="paul";
>
> // create link to database
> $link = mysql_connect($host, $username, $password)
> or die("Cannot connect to database");
>
> mysql_select_db($database)
> or die("Cannot select database");
>
> //now we make the query which will ask the database for the course
> information
> //change the my_table to your course table name
>
> $query = "SELECT course,places FROM courses";
> $result = mysql_query($query)
> or die("Query cannot be executed");
>
> //now we are going to print the information to your screen
> while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
> printf ("course: %s places: %s<br>", $row['course'],
> $row['places']);
> }
> ?>
>
> Still getting this error:
>
> Parse error: syntax error, unexpected T_VARIABLE in c:\wamp\www\Untitled.php
> on line 20
>
> but I can't see anything wrong with that line??
Which line is line 20? Be sure to check the line before it too,
although I can't see any errors with this script either...
Marc
Navigation:
[Reply to this message]
|