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

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]


Удаленная работа для программистов  •  Как заработать на 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

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