Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Database connects but no tables are shown

Featured Replies

Hello

 

I have connected to the database on my remote server in dreamweaver 8 and it says its connected successfully, but when I open the tree or try to make a recordset no tables are show and when I try it in advanced this error appears:

 

"Error calling GetTables:

 

MySQL Error#: 1064

 

You have an error in your SQL syntax; check the manual that

correponds to you MySQL server version for the right syntax to use

near '-maillist' at line1"

 

 

maillist being my database name

I'm not very good at dynamics yet so don't really understand the SQL syntax

This is what dreamweaver connection made me:

 

 

<?php

 

# FileName="Connection_php_mysql.htm"

 

# Type="MYSQL"

 

# HTTP="true"

 

$hostname_blog = "localhost";

 

$database_blog = "servername"

 

$username_blog ="servername"

 

$password_blog ="password"

 

$blog = mysql_pconnect ($hostname_blog, $username_blog, $password_blog or trigger_error (mysql_error (), E_USER_ERROR);

 

?>

 

 

Don't know if any of this makes sence to you.

Please Help

Well the syntax above is the connection to the database, which looks invalid, it should be...

 

$blog = mysql_pconnect($hostname_blog, $username_blog, $password_blog) or trigger_error (mysql_error(), E_USER_ERROR);

Hi!

 

That code doesn't look like it will run. Copy-paste the following and post back to the forum with your mileage:

 

<?php
// FileName="Connection_php_mysql.htm"
// Type="MYSQL"
// HTTP="true"
$hostname_blog = "localhost";
$database_blog = "servername";
$username_blog ="servername";
$password_blog ="password";
$blog = mysql_pconnect ($hostname_blog, $username_blog, $password_blog) or die (mysql_error ());
mysql_select($database_blog);
?>

  • Author

Well the syntax above is the connection to the database, which looks invalid, it should be...

 

$blog = mysql_pconnect($hostname_blog, $username_blog, $password_blog) or trigger_error (mysql_error(), E_USER_ERROR);

 

Hi this is the same code

  • Author

Hi!

 

That code doesn't look like it will run. Copy-paste the following and post back to the forum with your mileage:

 

<?php
// FileName="Connection_php_mysql.htm"
// Type="MYSQL"
// HTTP="true"
$hostname_blog = "localhost";
$database_blog = "servername";
$username_blog ="servername";
$password_blog ="password";
$blog = mysql_pconnect ($hostname_blog, $username_blog, $password_blog) or die (mysql_error ());
mysql_select($database_blog);
?>

 

Hi I tried the code it's still the same thou

Hi this is the same code

 

No, you have a closing bracket missing - if you look closely, it appears before the "or" :acute:

Hi I tried the code it's still the same thou

 

Hi!

 

What is the error that the script displays?

 

I know this may sound like I'm stating the obvious, but did you change the variables to accurately reflect your database name, location, and login credentials? "localhost" for the hostname_blog variable indicates that the database is on the same computer as the web server that is running the PHP script - some web hosting providers use a different database server, but not all of them. You've mentioned that it is a remote database so the host name should be set to a value other than "localhost".

  • Author

No, you have a closing bracket missing - if you look closely, it appears before the "or" :acute:

 

woops sorry thats just me copying it wrong it wouldn't let me copy and paste it for some reason here it is again copied and pasted:

 

<?php

# FileName="Connection_php_mysql.htm"

# Type="MYSQL"

# HTTP="true"

$hostname_blog = "localhost";

$database_blog = "servername";

$username_blog = "servername";

$password_blog = "password";

$blog = mysql_pconnect($hostname_blog, $username_blog, $password_blog) or trigger_error(mysql_error(),E_USER_ERROR);

?>

  • Author

Hi!

 

What is the error that the script displays?

 

I know this may sound like I'm stating the obvious, but did you change the variables to accurately reflect your database name, location, and login credentials? "localhost" for the hostname_blog variable indicates that the database is on the same computer as the web server that is running the PHP script - some web hosting providers use a different database server, but not all of them. You've mentioned that it is a remote database so the host name should be set to a value other than "localhost".

 

Yeah I changed the variables, but the localhost is what the hosting service said to put also if this wasn't correct would it still connect successfully to the database?

 

also there is no error message when i open the tree just don't display any table in the database. I get the error message when I try to make a recordset in the advance bit which is this:

 

"Error calling GetTables:

 

MySQL Error#: 1064

 

You have an error in your SQL syntax; check the manual that

correponds to you MySQL server version for the right syntax to use

near '-maillist' at line1"

Yeah I changed the variables, but the localhost is what the hosting service said to put also if this wasn't correct would it still connect successfully to the database?

 

Hi!

 

If the web hosting service says it is localhost, then localhost it is! If it were incorrect, you wouldn't be able to connect to the database server - the mysql_pconnect takes three parameters and all of them are required. The next statement - mysql_select - can take an incorrect parameter and the server would report an error indicating that the database does not exist or that you do not have the privileges to access the database.

 

EDIT:

 

I guess you've edited your post to include the error. That error indicates that there is a problem with an SQL statement that you are sending to the database, and not with the database connection.

 

Sorry, but we are barking up the wrong tree here. You have to look for the code that is selecting, inserting, updating, or deleting from the database (I'm assuming that the code isn't trying to create, alter, drop, grant, or revoke, as that isn't something that a PHP script would normally do, unless you are running an installation or performing an administrative task).

  • Author

Hi!

 

If the web hosting service says it is localhost, then localhost it is! If it were incorrect, you wouldn't be able to connect to the database server - the mysql_pconnect takes three parameters and all of them are required. The next statement - mysql_select - can take an incorrect parameter and the server would report an error indicating that the database does not exist or that you do not have the privileges to access the database.

 

EDIT:

 

I guess you've edited your post to include the error. That error indicates that there is a problem with an SQL statement that you are sending to the database, and not with the database connection.

 

Sorry, but we are barking up the wrong tree here. You have to look for the code that is selecting, inserting, updating, or deleting from the database (I'm assuming that the code isn't trying to create, alter, drop, grant, or revoke, as that isn't something that a PHP script would normally do, unless you are running an installation or performing an administrative task).

 

Yes that would be right if I could make a recordset but I can't even do that because it wont display any of the tables in the database it says no tables. When I click on the tables in the recordset box to display the tables to make the SQL code the error message appears and I haven't even selected anything. Do or have you used Dreamweaver? Thanks for trying to help I don't know if it's a dreamweaver problem or a hosting problem because the tables show up fine when i connect to phpmyadmin on my computer but my hosting company is saying everything is fine and it must be dreamweaver

Hi!

 

I've used Dreamweaver, but primarily as a text editor - the auto-complete that it provides for closing HTML tags, typing HTML attributes, and CSS helps speed up development. The WYSIWYG is pretty neat in that it is more accurate than other WYSIWYG editors at rendering CSS.

 

For a while, I used Dreamweaver for ASP.NET development because we worked on ASP.NET Web Site projects (edit the source code file in-place on the web server) as it was pretty quick and not as heavy-weight as Visual Studio, but when the projects I worked on moved to the ASP.NET Web Application model I had to move back to Visual Studio.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.