|
Posted by plato on 10/13/68 11:27
"Marc" <mbradshaw@beasolutions.com> wrote in message
news:1127385870.9943.1@lotis.uk.clara.net...
> 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
Thanks Marc I'm only a beginner here... the line before it seems to find the
database OK... I even created a new table with another name.... buggered if
I know....
plato
Navigation:
[Reply to this message]
|