Please stop me from tearing my hair out.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Right. I'm getting this error from the following code : *Parse error*:
syntax error, unexpected '}' in *C:\wamp\www\achillesweb2\install.php* on
line *39
*and I can figure there's probably a bunch of others. If anyone wouldn't
mind giving this a read over that'd be really helpful. Feel free to chip in
with any glaring obvious suggestions and points of interest you'd like to
raise, I probably need the help. Thanks in advance.*
*
-------------------------------
Install.php
-------------------------------
1  <?php
2  /*
3  Here lies a comment block that's private
4  Here lies a comment block that's private
5  Here lies a comment block that's private
6  */
7
8  require("config.php");
9
10 //Mysqlconnect functions
11
12 function ach_mysqlCon( $init=true )
13 {
14    static $con = null;
15
16    if( $init && $con === null )
17    {
18       $con =
19           mysql_connect
20           (
21               $GLOBALS['mysql_host'],
22               $GLOBALS['mysql_user'],
23               $GLOBALS['mysql_pass']
24           );
25
26       if( !$con )
27       {
28           die( 'Could not connect: '.mysql_error() );
29       }
30   }
31 }
32 echo "<br> ach_myqslcon function defined";
33
34 function ach_mysqlCloseCon()
35 {
36    if($con = ach_mysqlCon(false))
37    {
38        mysql_close( $con )
39   }
40 }
41 echo "<br> ach_myqslCloseCon function defined";
42
43 function ach_select_db()
44 {
45        $db_select = mysql_select_db
46         (
47         $GLOBALS['mysql_db'], $con
48         );
49
50         if (!$db_select)
51         {
52         mysql_query("CREATE DATABASE".$GLOBALS['mysql_db'],$con)
53          }
54 }
55 echo "<br> ach_select_db function defined";
56
57
58 function ach_select_table($col,$table)
59 {
60     mysql_query("SELECT".$col."FROM".$table)
61
62     if(!mysql_query("SELECT".$col."FROM".$table))
63     {
64         die( 'Could not connect: '.mysql_error() );
65     }
66 }
67 echo "<br> ach_select_table function defined";
68 ?>
______________________________________

and for your curiosity
----------------------
config.php
---------------------
<?php
/* CONFIG.PHP
Global configuration file
TS Achilles Website
Created by Byron Glover */

// Mysql variables
$GLOBALS['mysql_host'] = "localhost";
$GLOBALS['mysql_user'] = "ach@localhost";
$GLOBALS['mysql_pass'] = "";
$GLOBALS['mysql_db'] = "ach_db";

?>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux