September 17, 201015 yr 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
September 18, 201015 yr 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);
September 18, 201015 yr 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); ?>
September 19, 201015 yr 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
September 19, 201015 yr 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
September 19, 201015 yr Hi this is the same code No, you have a closing bracket missing - if you look closely, it appears before the "or"
September 19, 201015 yr 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".
September 19, 201015 yr Author No, you have a closing bracket missing - if you look closely, it appears before the "or" 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); ?>
September 19, 201015 yr 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"
September 19, 201015 yr 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).
September 19, 201015 yr 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
September 20, 201015 yr 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