Jump to content

Archived

This topic is now archived and is closed to further replies.

scheols

DB ERRORZ

Recommended Posts

[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 one

same 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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
um the last link ................................................................

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[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 23
Sorry We Could not Connect to MySQL Database
[/code]

line 23

[code]
$link=mysql_connect($idbservername,$idbusername,$idbpassword);
[/code]

anyideas?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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]

Share this post


Link to post
Share on other sites
well the form should get the password :( how can i fix this? because i tried a shitload of timez


I 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 23
Sorry We Could not Connect to MySQL Database

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote]
Warning: mysql_connect(): Access denied for user 'scheols'@'localhost' (using password: YES) in /home/scheols/public_html/ibbdb.php on line 23
Sorry 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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.