PHP
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists PHP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 19th, 2008, 06:11 AM
Byron
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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";

?>

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists PHP > Please stop me from tearing my hair out.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT