You are here: Parse error: parse error, unexpected T_VAR « All PHP « IT news, forums, messages
Parse error: parse error, unexpected T_VAR

Posted by carlton on 10/26/05 00:18

The following code extract generates ab unexpected T_VAR error at line
63. Note the line numbers have been added.
I am running PHP 4.3.8, apache 2 on Linux mandrake 1.1 official
52 /
53 // connect to the mysql server
54 //
55 $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
56 if (!$link) {
57 die('Could not connect: ' . mysql_error());
58 }
59 print("<h2> connected to server - <I>so far so good<\I><\h2>\n\n"
60 //
61 // Create the database
62 //
63 $sql = "CREATE DATABASE $database";
64 //var $sql = "CREATE DATABASE pxpdb";
65 if (mysql_query($sql, $link)) {
66 echo "Database $database created successfully\n";
67 } else {
68 echo 'Error creating database: $database' . mysql_error() . "\n";
69 }
this section of code gives the following error

Parse error: parse error, unexpected T_VAR in
var/www/html/gopc/TopLevelStuffandAdmin.php on line 63

I am a php newbie, but the code fragment looks correct.

 

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

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