Jump to content

DB ERRORZ


scheols

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
Link to comment
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?
Link to comment
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]
Link to comment
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
Link to comment
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.

Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.