Cannot connect to database

This is a discussion on "Cannot connect to database" within the Databases section. This forum, and the thread "Cannot connect to database are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Closed Thread
 
LinkBack Thread Tools
  #1  
Old Oct 9th, 2003, 15:03
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Drop the frameset first...
Oh and the page transitions...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Oct 9th, 2003, 15:29
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
There is a lot of info there that needs some serious layout adjustment. It seems a bit all over the place. Tidy it up and apply some styles.

Kill the frames and kill the flash buttons.

u2o
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Oct 9th, 2003, 21:58
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I agree with everyone here. This site is difficult to browse. I don't even know where to start.

Your friend needs to think and pretend he is the visitor. Where do you go if you have a specific problem? It might be apparent to him, but he designed the site! I've never seen this site before and I don't know where to go or what to do. You have to lead visitors by the hand.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Oct 9th, 2003, 22:02
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Here is a site, posted recently in another thread, that has a great deal of information and presents it well:

http://www.myie2.com/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Oct 14th, 2003, 17:11
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
its quite cluttered yes and if i were you, i'll do away the frames.

cut out the fat ( banners and uneeded that make an already messy site more cluttered)

use text instead of flash for navigation. flashing for the sake of flashing..no good

i'll tell u more later; i've got 2 go now
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Oct 14th, 2003, 19:39
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
ok, well I am free for the day so I will give you some tips.

first off, like everyone else said, frames are no good. They make it painful, and Flash navigation is a huge waste of time/navigation do to the fact that theres no point for it.

next thing, Way too much text. Add some more pictures to the white boring pages. (this is reffering to the How To tab and down)Seriously, the white page is so boring. If you want a banner on top and not have to redo it everytime, then please make a template. Also, the text all being centered makes it less interesting as well, the font doesnt fit your site, get rid of the Times New Roman style font.

Then.. Yes there is more, lol. Your How to/ FAQ sections; ok.. Dont put them in a drop down menu and then hit go. This isn't selecting a country. Instead, put them in a table, with the name and a much better/longer description of what you will learn, or what it is about in detail. You will help more people this way. Also, you pages are boring. Its the centered text all over the site. Do something else with it, change the font, change the size in some places. Make links to other pages using keywords, etc...

Now, there are probably other things people will find or tell you about. But if your friend doesnt fix anything this is what he needs to fix.

1. Give it some room to breathe. Everything is jam packed in there.
2. Give it some more color, pictures, or a font change.
3. Get rid of the Flash navigation, as for the rest, it is just a suggestion, but I think these are important.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old May 29th, 2004, 18:19
Junior Member
Join Date: Mar 2004
Location: United Kingdom
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Cannot connect to database

I am trying to build a database for my local bookshop's website.
I have built the MySql database from PHPMyAdmin.

I have 2 .php files one is called booklist2.php and bookRev.php
At the moment they are on my local machine and when I open my browser as http://localhost.booklist2.php or http://localhost.bookRev.php I get the following message:
Error, Could not connect to the system database. Sorry......

I have looked through the code and cannot find an error.

This is the code for booklist2.php
I have change my password here and put in password.
<?
include("dbConn.php");
mysql_select_db($sysDb) or die (mysql_error());

$query = "SELECT id, title, author, isbn, publisher, category, price from tbooks";
$result = mysql_query($query) or die (mysql_error());
$noOfRes = mysql_num_rows($result);
$theBooks="";
for($c=0; $bookList = mysql_fetch_array($result, MYSQL_ASSOC); $c++) // c is the number of results returned we loop through untill done
{
$theBooks .= "<tr><td><a href=\"bookRev.php?getbook=".$bookList['id']."\">".$bookList['id']."</a></td><td>".$bookList['title']."</td><td>".$bookList['author']."</td><td>".$bookList['isbn']."</td><td>"
.$bookList['publisher']."</td><td>".$bookList['category']."</td></tr>".$bookList['price']."</td></tr>\n";
}
mysql_close($DbConn);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<title>List my books</title>
</head>
<body>


You have <? echo $noOfRes; ?> books in your list.</p>
<table width="780" border="1" cellpadding="0" cellspacing="1">
<tr>
<td align="center"><h3>Book ID</h3></td>
<td align="center"><h3>Title</h3></td>
<td align="center"><h3>Author</h3></td>
<td align="center"><h3>ISBN</h3></td>
<td align="center"><h3>Publisher</h3></td>
<td align="center"><h3>Category</h3></td>
<td align="center"><h3>price</h3></td>
</tr>
<? echo $theBooks; ?>
</table>
</body>
</html>

Here's the code for bookRev.php:

<?
require("dbConn.php");
$bookID = $_GET['getbook'];
mysql_select_db($sysDb) or die (mysql_error());
$query = "SELECT tbooks.author, tbooks.title, treviews.review from tbooks,
treviews where tbooks.id='$bookID' AND tbooks.id=treviews.id";
$result = mysql_query($query) or die (mysql_error());
$noRes = mysql_num_rows($result);
if ($noRes > 0) {
$bookRev = mysql_fetch_array($result, MYSQL_ASSOC);
$title = $bookRev['title'];
$author = $bookRev['author'];
$review = $bookRev['review'];
}
else $error = "Sorry, there are no reviews for that book.";
mysql_close($DbConn);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>List my books</title>
</head>
<body>
<? echo $error; ?>
<table width="780" border="1" cellpadding="0" cellspacing="1">
<tr>
<td>Book Title</td>
<td><? echo $title; ?></td>
</tr>
<tr>
<td>Book Author</td>
<td><? echo $author; ?></td>
</tr>
<tr>
<td>Book Review</td>
<td valign="top"><? echo $review; ?></td>
</tr>
</table>
</body>
</html>

The MySql database is called pageturnersdb and there are 2 tables named tbooks and treviews.

Can any of you gurus please take a look at the codes to see what any errors are and how to correct them.
I have been trying to connect to the database for over a week now without success.
This is my first attempt with PHPmyAdmin to connect to MySql.
If started pulling my hair out and I need to resolve this before I end up bald.

I am also using Apache server locally and the files are located in the htdocs folder of the server.

All help much appreciated and stop someone prematurely going bald.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old May 30th, 2004, 00:10
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Try SELECT id instead of SELECTid
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old May 30th, 2004, 17:34
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Please post new messages rather than editing your original one.

We'll need to see the included file dbConn.php to see how your connection is being made.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old May 30th, 2004, 20:15
Junior Member
Join Date: Mar 2004
Location: United Kingdom
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Catalyst

Please post new messages rather than editing your original one.

We'll need to see the included file dbConn.php to see how your connection is being made.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

I'm sorry I edited instead of posting a new message as I thought it would save space. I'll remember in future.

Many thanks for mentioning the dbConn.php file which being new to PHP I had completely forgotten about this file.
Looking at this file it was pointing to a non-existant database, I have corrected this and things working correctly now.

Only one thing. If I have 2 different databases for different things How would I go about connecting to the database I want. Can I have 2 dbConn.php files and how would I name a second one?

Again Many Thanks All the help has been much appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old May 31st, 2004, 06:26
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
No problem. You can double the code in the first one using a different variable for the second connection name. The code that uses the second connection would have to reference that variable.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Jun 1st, 2004, 08:47
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by charter


I have 2 .php files one is called booklist2.php and bookRev.php
At the moment they are on my local machine and when I open my browser as http://localhost.booklist2.php or http://localhost.bookRev.php I get the following message:
Error, Could not connect to the system database. Sorry......
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

this should be:
http://localhost/booklist2.php and, http://localhost/bookRev.php

??:??:??:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #13  
Old Jun 13th, 2004, 12:23
Junior Member
Join Date: Mar 2004
Location: United Kingdom
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Catalyst

No problem. You can double the code in the first one using a different variable for the second connection name. The code that uses the second connection would have to reference that variable.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Thanks Catalyst, but could you tell me how to code this and how to select the correct connection each time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
cannot, connect, database

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to DVLA database? RudeYute PHP Forum 4 Feb 4th, 2008 21:15
Can't connect to my server... What do I do? JustinStudios Hosting & Domains 11 Jan 23rd, 2008 07:44
How to connect the microsoft access database using HTML page mazenbluee Databases 5 Nov 21st, 2007 06:49
How to connect to a MS Access Database DJB MASTER Databases 4 Aug 26th, 2006 20:04
How to connect flash form with Mysql database shenbagarajan Flash & Multimedia Forum 6 Jan 20th, 2006 19:59


All times are GMT. The time now is 05:13.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42