|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Please stop me from tearing my hair out.
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 $GLBALS['mysql_host'], 22 $GLBALS['mysql_user'], 23 $GLBALS['mysql_pass'] 24 ); 25 26 if( !$con ) 27 { 28 die( 'Could not connect: '.mysql_error() ); 29 } 30 } 31 } 32 echo "<brach_myqslcon function defined"; 33 34 function ach_mysqlCloseCon() 35 { 36 if($con = ach_mysqlCon(false)) 37 { 38 mysql_close( $con ) 39 } 40 } 41 echo "<brach_myqslCloseCon function defined"; 42 43 function ach_select_db() 44 { 45 $db_select = mysql_select_db 46 ( 47 $GLBALS['mysql_db'], $con 48 ); 49 50 if (!$db_select) 51 { 52 mysql_query("CREATE DATABASE".$GLBALS['mysql_db'],$con) 53 } 54 } 55 echo "<brach_select_db function defined"; 56 57 58 function ach_select_table($col,$table) 59 { 60 mysql_query("SELECT".$col."FRM".$table) 61 62 if(!mysql_query("SELECT".$col."FRM".$table)) 63 { 64 die( 'Could not connect: '.mysql_error() ); 65 } 66 } 67 echo "<brach_select_table function defined"; 68 ?> and for your curiosity config.php <?php /* CNFIG.PHP Global configuration file TS Achilles Website Created by Byron Glover */ // Mysql variables $GLBALS['mysql_host'] = "localhost"; $GLBALS['mysql_user'] = "ach@localhost"; $GLBALS['mysql_pass'] = ""; $GLBALS['mysql_db'] = "ach_db"; ?> |
![]() |
| Viewing: Web Development Archives > Mailing Lists > PHP > Please stop me from tearing my hair out. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|