You are here: Re: Basic PHP question... « All PHP « IT news, forums, messages
Re: Basic PHP question...

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация