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

Posted by Sander on 10/13/40 11:27

> <?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??
>
>



Hi,

You need to look at this part:
> //now we make the query which will ask the database for the course
> information
> //change the my_table to your course table name


and make it look like this:

> //now we make the query which will ask the database for the course
> information
> //change the my_table to your course table name

For everyline of comments their need to be a \\

Sander Swuste

 

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

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