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.
|
|
|
|
|
![]() |
||
Cannot connect to database
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Drop the frameset first...
Oh and the page transitions... |
|
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
Here is a site, posted recently in another thread, that has a great deal of information and presents it well:
http://www.myie2.com/ |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
Try SELECT id instead of SELECTid
|
|
#9
|
|||
|
|||
|
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. |
|
#10
|
|||
|
|||
|
<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. |
|
#11
|
|||
|
|||
|
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.
|
|
#12
|
|||
|
|||
|
<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 |
|
#13
|
|||
|
|||
|
<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. |
![]() |
| Tags |
| cannot, connect, database |
| Thread Tools | |
|
|
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 |