scheols Posted June 24, 2006 Share Posted June 24, 2006 [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /] [code]Parse error: syntax error, unexpected $end in /home/scheols/public_html/ibbdb.php on line 45[/code]code[code]<?php/*-------------------------------------------------------------------------------------------------------------------*///DataBase is based on the InfernoBulletinBoard By Demonic//Some of the files are copy Written And will be Added to Main CopyRight Page//Thanks to All that Help[ed] On this project/*-------------------------------------------------------------------------------------------------------------------*//*-------------------------------------------------------------------------------------------------------------------*///DONT EDIT BELOW OR YOU'LL MESS YOUR BOARD UP/*-------------------------------------------------------------------------------------------------------------------*/$idbservername='localhost';$idbusername=$_POST[$idbusername];$idbpassword=$_POST[$idbpassword];$idbname=$_POST[$idbname];/*-------------------------------------------------------------------------------------------------------------------*//*DONT EDIT BELOW OR YOULL MESS YOUR BOARD UP*//*-------------------------------------------------------------------------------------------------------------------*/global $link;$link=mysql_connect($idbservername,$idbusername,$idbpassword);if(!$link) { die("Sorry We Could not Connect to MySQL Database");}$idbs = mysql_select_db("$idbname",$link);if(!$idbs){echo "Could not select the database table please try again later";exit;/*Create your table members*/echo "<p>Creating table: \'members\'....</p>";$sql = 'CREATE TABLE `buser` (' . ' `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . ' `uname` VARCHAR(24) NOT NULL, ' . ' `password` VARCHAR(24) NOT NULL,' . ' UNIQUE (`uname`, `password`)' . ' )' . ' ENGINE = myisam;';mysql_query($sql, $link);?>[/code]what am i doing wrong can you fix this so it works?another onesame error[code]<?$username = $_POST[$idbusername];$password =$_POST[$idbpassword];$db = $_POST[$idbname];$query = "$db";$host = "localhost";$connection = mysql_connect($host,$username,$password) or die("Couldn't connect to server.");$db = mysql_select_db($database,$connection) or die("Couldn't connect to database."); $result = mysql_query($query) or die("Couldn't execute query.");?>[/code]maybe im not finished plz someone help me fix em Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/ Share on other sites More sharing options...
AndyB Posted June 24, 2006 Share Posted June 24, 2006 if(!$idbs){ is an unclosed loop.If you have an error with a line number, it would be nice if you told us what line it corresponded to in any code you post. Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49210 Share on other sites More sharing options...
scheols Posted June 24, 2006 Author Share Posted June 24, 2006 um the last link ................................................................ Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49213 Share on other sites More sharing options...
AndyB Posted June 24, 2006 Share Posted June 24, 2006 The suggestion I gave you should solve the problem with the first script you posted .. you have an unclosed brace.I don't know what you want with the second script part. Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49215 Share on other sites More sharing options...
scheols Posted June 25, 2006 Author Share Posted June 25, 2006 [code]<?php/*-------------------------------------------------------------------------------------------------------------------*///DataBase is based on the InfernoBulletinBoard By Demonic//Some of the files are copy Written And will be Added to Main CopyRight Page//Thanks to All that Help[ed] On this project/*-------------------------------------------------------------------------------------------------------------------*//*-------------------------------------------------------------------------------------------------------------------*///DONT EDIT BELOW OR YOU'LL MESS YOUR BOARD UP/*-------------------------------------------------------------------------------------------------------------------*/$idbservername='localhost';$idbusername=$_POST["$idbusername"];$idbpassword=$_POST["$idbpassword"];$idbname=$_POST["$idbname"];/*-------------------------------------------------------------------------------------------------------------------*//*DONT EDIT BELOW OR YOULL MESS YOUR BOARD UP*//*-------------------------------------------------------------------------------------------------------------------*/global $link;$link=mysql_connect($idbservername,$idbusername,$idbpassword);if(!$link) { die("Sorry We Could not Connect to MySQL Database");}$idbs = mysql_select_db("$idbname",$link);if(!$idbs){echo "Could not select the database table please try again later";exit;/*Create your table members*/echo "<p>Creating table: \'members\'....</p>";$sql = 'CREATE TABLE `buser` (' . ' `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . ' `uname` VARCHAR(24) NOT NULL, ' . ' `password` VARCHAR(24) NOT NULL,' . ' UNIQUE (`uname`, `password`)' . ' )' . ' ENGINE = myisam;';mysql_query($sql, $link);}?>[/code]Now the codes functioning but i get this new error and im using the right database.[code]Warning: mysql_connect(): Access denied for user 'scheols'@'localhost' (using password: NO) in /home/scheols/public_html/ibbdb.php on line 23Sorry We Could not Connect to MySQL Database[/code]line 23[code]$link=mysql_connect($idbservername,$idbusername,$idbpassword);[/code]anyideas? Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49225 Share on other sites More sharing options...
trq Posted June 25, 2006 Share Posted June 25, 2006 Parse errors are simple typo's, not something anyone shgould be asking for regular help with. Get yourself a good code highlighting editor and learn to debug. Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49226 Share on other sites More sharing options...
redarrow Posted June 25, 2006 Share Posted June 25, 2006 telling you have no password set ok. Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49227 Share on other sites More sharing options...
scheols Posted June 25, 2006 Author Share Posted June 25, 2006 what u mean redarrow? Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49231 Share on other sites More sharing options...
AndyB Posted June 25, 2006 Share Posted June 25, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]what u mean redarrow?[/quote]Just what he said - here's the error message from your code:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--](using password: NO)[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49233 Share on other sites More sharing options...
scheols Posted June 25, 2006 Author Share Posted June 25, 2006 well the form should get the password :( how can i fix this? because i tried a shitload of timezI got the password part t say Yes But it still says:Warning: mysql_connect(): Access denied for user 'scheols'@'localhost' (using password: YES) in /home/scheols/public_html/ibbdb.php on line 23Sorry We Could not Connect to MySQL Database Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49235 Share on other sites More sharing options...
AndyB Posted June 25, 2006 Share Posted June 25, 2006 if access is denied it means that at least one of the parameters you pass is wrong or the database access is not assigned to you.Passing database access parameters through a web form is a very dangerous method. If you're the ONLY person who accesses the form, why not put the database access parameters (host, username, userpassword) in the script instead of using a form? Then you'll know they're right and don't have any leading or trailing blanks, etc. Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49239 Share on other sites More sharing options...
scheols Posted June 25, 2006 Author Share Posted June 25, 2006 [quote]Warning: mysql_connect(): Access denied for user 'scheols'@'localhost' (using password: YES) in /home/scheols/public_html/ibbdb.php on line 23Sorry We Could not Connect to MySQL Database[/quote]yeah my second attempt when i added the pass in the code :D but it has that error will this go away if i intered everything threw in the DB file?Thanks I got it to work and every this : [a href=\"http://infernobb.a-host.info/ibbdb.php\" target=\"_blank\"]http://infernobb.a-host.info/ibbdb.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/12833-db-errorz/#findComment-49240 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.