Jump to content


Photo

DB ERRORZ


  • Please log in to reply
11 replies to this topic

#1 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 24 June 2006 - 11:40 PM

[img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /]

Parse error: syntax error, unexpected $end in /home/scheols/public_html/ibbdb.php on line 45

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);
?>

what am i doing wrong can you fix this so it works?


another one

same error

<?
$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.");
?>

maybe im not finished plz someone help me fix em

Dont Piss me Off today

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 June 2006 - 11:44 PM

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.
Legend has it that reading the manual never killed anyone.
My site

#3 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 24 June 2006 - 11:48 PM

um the last link ................................................................
Dont Piss me Off today

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 June 2006 - 11:56 PM

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.
Legend has it that reading the manual never killed anyone.
My site

#5 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 01:04 AM

<?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);
}
?>

Now the codes functioning but i get this new error and im using the right database.

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

line 23

$link=mysql_connect($idbservername,$idbusername,$idbpassword);

anyideas?
Dont Piss me Off today

#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 June 2006 - 01:11 AM

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.

#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 25 June 2006 - 01:13 AM

telling you have no password set ok.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#8 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 01:19 AM

what u mean redarrow?
Dont Piss me Off today

#9 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 25 June 2006 - 01:48 AM

[!--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]
Legend has it that reading the manual never killed anyone.
My site

#10 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 01:49 AM

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
Dont Piss me Off today

#11 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 25 June 2006 - 02:13 AM

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.


Legend has it that reading the manual never killed anyone.
My site

#12 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 25 June 2006 - 02:15 AM

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


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]
Dont Piss me Off today




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users