connecting a database using godaddy 
October 8th, 2008, 04:49 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | |
I have been tring to connect to my database using godaddy i keep getting an error#1064 you have an error in your SQL syntax check the manual that corresponds to your MYSQL server version for the right syntax to use near
[PHP]<?php
// connect to database
$hostname = 'h41mysql47'.secure.net';[/PHP]
How can I fix this?
Last edited by Atli; October 8th, 2008 at 11:21 PM.
Reason: Added [code] tags.
| 
October 8th, 2008, 11:24 PM
|  | Moderator | | Join Date: Nov 2006 Location: Iceland
Posts: 3,702
Provided Answers: 4 | | | re: connecting a database using godaddy
Hi.
We need more info to be able to help you at all.
To start with, we need to see the code you are using to connect to your database.
| 
October 9th, 2008, 01:46 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
sorry here is the code
[PHP]<?php
//connect to database
$hostname = 'h41mysql47.secureserver.net';
$username = ' username';
$password = 'userpass';
$dbname = 'dbname';
$usertable = 'usertable';
$yourfield = ' yourfield';
mysql_connect($hostname, $username, $password) OR DIE
(' unable to connect to database! please try again later.');
mysql_select_db ($databasename);
$query = 'select * from $usertable';
$result = mysql_query ($query);
if ($result) {
while ($row = mysql_fetch-array ($result)) {
$name = $row ['$parts'];
echo 'name:'. $name;
}
}
?>[/PHP]
When I use this code it gives me the error Quote:
#1064 you have an error in you r SQL Synax, check the manual that corresponds to you mySQL sever version for the right synax to use near '<?php
//connect to database
$hostname = 'h41mysql47.securesever.net at line1
| This is the code & the error that i'm getting & godaddy Tech. support gave me this code & would not help my out any futher. I'm at the point to were I'm ready to get rid of godaddy.
What do you think?
Last edited by Atli; October 9th, 2008 at 07:07 PM.
Reason: Added [code] tags.
| 
October 9th, 2008, 07:12 PM
|  | Moderator | | Join Date: Nov 2006 Location: Iceland
Posts: 3,702
Provided Answers: 4 | | | re: connecting a database using godaddy
What exactly are you doing with this code?
The error would suggest you are using it as a SQL query?
This is PHP code, meant to be executed as PHP code, not as a SQL query.
It would typically be placed in a .php file on a web-server and execute via a browser.
P.S.
Please use [code] tags when posting code examples.
[code] ...Code goes here.. [/code]
Thank you. Moderator | 
October 10th, 2008, 01:23 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy Quote: |
Originally Posted by Atli What exactly are you doing with this code?
The error would suggest you are using it as a SQL query?
This is PHP code, meant to be executed as PHP code, not as a SQL query.
It would typically be placed in a .php file on a web-server and execute via a browser.
P.S.
Please use [code] tags when posting code examples.
[code] ...Code goes here.. [/code]
Thank you. Moderator | How would you do that? As you can tell I have no clue about servers.
| 
October 10th, 2008, 05:09 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii How would you do that? As you can tell I have no clue about servers. | I'm using go daddy's database mysql & they are saying that you can use in conjuction with php & other scripting languages.
| 
October 10th, 2008, 06:16 PM
|  | Moderator | | Join Date: Nov 2006 Location: Iceland
Posts: 3,702
Provided Answers: 4 | | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii How would you do that? As you can tell I have no clue about servers. | Ok.
Firstly, why are you attempting this?
These sort of connections are usually used with PHP web-applications, and by the sounds of it, you are not developing such an application.
If this is just a test, something your trying to learn, I would recommend finding a tutorial about the basics of web-development first.
There is really no point in learning how this code works until you have learned that.
It shouldn't take long tho and there is no shortage of material on this subject online.
| 
October 13th, 2008, 01:26 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
I do have an associates degree in web development but I have never had such problems connecting to a database. c I used dreamweaver to create my site & go daddy for my hosting server & for some reason u can't use the database in dreamweaver in godaddy. So I created a database in godaddy and was trying to connect it to my web site that way. Do you have any solutions to this problem? I 'm was just going to change my hosting server. I've done alot of research and have not found a solution. When I called godaddy that is the code they told me to use that is why I was trying it. Really i have 2 web sites right now that don't have a database. What do you think I should do?
| 
October 15th, 2008, 04:49 AM
|  | Expert | | Join Date: Mar 2007 Location: CA.
Posts: 570
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii I do have an associates degree in web development but I have never had such problems connecting to a database. c I used dreamweaver to create my site & go daddy for my hosting server & for some reason u can't use the database in dreamweaver in godaddy. So I created a database in godaddy and was trying to connect it to my web site that way. Do you have any solutions to this problem? I 'm was just going to change my hosting server. I've done alot of research and have not found a solution. When I called godaddy that is the code they told me to use that is why I was trying it. Really i have 2 web sites right now that don't have a database. What do you think I should do? | have you enabled the gui script that will all your site to read php?
if not it should be in your host settings.
nomad
| 
October 15th, 2008, 06:44 AM
|  | Moderator | | Join Date: Nov 2006 Location: Iceland
Posts: 3,702
Provided Answers: 4 | | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii I do have an associates degree in web development but I have never had such problems connecting to a database. c I used dreamweaver to create my site & go daddy for my hosting server & for some reason u can't use the database in dreamweaver in godaddy. | I don't really know what Dreamweaver is doing behind the scenes so I can't really say what it's doing wrong, but I know that if you can actually edit the code itself it shouldn't be hard to fix.
I actually took a couple of "Web-Development" courses in school a few years back that were all about Dreamweaver. If that is anything like what you are doing, then I would strongly recommend trying to learn the actual code behind it, not just how to create it using Dreamweaver.
Being dependent on proprietary GUI tools and wizards, like Dreamweaver, to create your web-pages is very very bad, at least if you don't know what it is that is happening behind the scenes. You are basically limiting yourself to the features Adobe figures should be automated.
Making your code do whatever you want is easy. Making Dreamweaver do anything beyond the basics is next to impossible.
| 
October 16th, 2008, 02:26 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
Actually I do know alot about the coding so I do more coding then just creating. I really don't think the problem is with dreamweaver. I 'm really thinking that the problem is with my hosting server ( godaddy). Do you know anything about godaddy? See someone else within the company had the web site set on linux instead of windows. So I changed it back to windows & they give you 3 different was to create the database MySQL, Access and & SQL server so I was trying to create the database with one of them because godaddy told me that dreamweaver & godaddy don't work together to create the database in dreamweaver for some reason I can't remember & I had to use the database feature in godaddy. That is what I 'm trying to do. So if you have any ideas on which one to use that would be great I have tried all of them but have not got any of them to work so far. If you have any ideas or advice it would be great. The access one seemed to be the easiest, for the simple database I need but I have yet to get it to work, there something wrong within the dsn that it won't let me upload the database from my hard drive. MySQL I can't get the SQL coding right. I'm really thinking about just changing hosting server. Because then the database can be created in dreamweaver. Once I research about these issue alot of people have had the same issues with godaddy. Anyways if there is anything that you could help with that would be really great. Thank you for all the advice you have given already.
| 
October 16th, 2008, 04:23 PM
|  | Moderator | | Join Date: Jan 2007 Location: Colombo
Posts: 1,439
| | | re: connecting a database using godaddy
If you using Godaddy's shared hosting package you can't access the provided mysql server from your local machine. what you can do is install mysql server on your local machine and create your application on the same machine. Then you can move your application and the database back to the Godaddy server. On the hosting control panel you can find the "PhpMyAdmin" tool which you can use for maintaining mysql server databases.
| 
October 16th, 2008, 06:05 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
Can you use access to create the database? & use microsoft access? I have tried but can not upload it or get the dsn right. Do you know anything about that? What am I doing wroong? They also have SQL Server but i can not insert columns in it & really i'm lost with that.
| 
October 17th, 2008, 09:51 AM
|  | Moderator | | Join Date: Jan 2007 Location: Colombo
Posts: 1,439
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii Can you use access to create the database? & use microsoft access? I have tried but can not upload it or get the dsn right. Do you know anything about that? What am I doing wroong? They also have SQL Server but i can not insert columns in it & really i'm lost with that. | MS Access is a database file, so upload your ms access database file to the hosting server. you can create it LOCALLY and Then MOVE it to the server.
I think I asked you to use MySQL, not Ms Access. If you really need to use access read the documentation on http://php.net/odbc
And here is a Sample Source Code that you can get started. but I highly recommend you to stick with mysql instead of ms access.
| 
October 17th, 2008, 03:39 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
Sorry I already had the database created in Access that's why i asked. Were can I safely download mysql server to install it?
| 
October 17th, 2008, 04:52 PM
|  | Moderator | | Join Date: Jan 2007 Location: Colombo
Posts: 1,439
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii Sorry I already had the database created in Access that's why i asked. Were can I safely download mysql server to install it? | http://dev.mysql.com/downloads/ | 
October 17th, 2008, 05:26 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
Ok I had downloaded it but can't figure out how to install it.
| 
October 18th, 2008, 06:44 PM
|  | Moderator | | Join Date: Jan 2007 Location: Colombo
Posts: 1,439
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii Ok I had downloaded it but can't figure out how to install it. | Everything you need were there on the URL provided in my earlier post. make sure to use google or your favorite search engine application before asking more questions. http://dev.mysql.com/doc/refman/5.0/en/installing.html | 
October 20th, 2008, 07:35 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
Thank You for your help I downloaded the wrong one at first that was the problem.
| 
October 22nd, 2008, 05:08 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
I'm sorry to keep bothering you but i'm really having some issue with this database & godaddy after I get this working I will not use godaddy ever again. anyways what do I need to do to connect my database to my web site. The database is created but I tried to use a connection string that keeps tell me that there's something wrong with my server & when I called them (godaddy) they told me that 's it 's on my behalf. How do you connect your database to your web site?
| 
October 23rd, 2008, 01:22 PM
|  | Moderator | | Join Date: Jan 2007 Location: Colombo
Posts: 1,439
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii I'm sorry to keep bothering you but i'm really having some issue with this database & godaddy after I get this working I will not use godaddy ever again. anyways what do I need to do to connect my database to my web site. The database is created but I tried to use a connection string that keeps tell me that there's something wrong with my server & when I called them (godaddy) they told me that 's it 's on my behalf. How do you connect your database to your web site? | Please show us the source codes that you have used recently. and Tell us what is getting as the error message.
| 
October 23rd, 2008, 03:28 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
1.DRIVER={MySQL ODBC 3.51 Driver}; 2.SERVER=hxxmysqlxx.secureserver.net; PORT=3306; DATABASE='database name';
3.USER=tsiiinc; PASSWORD='your password'; OPTION=0;
with the right settings for my database
This is the code I was trying to use , but not matter what code I use no matter what I put it keeps giving me this error, I called godaddy too and they said that the server is working just fine. I just need to find a new hosting server.
ERROR
#1064 you have an error in your sql syntax; check tne manual that corresponds to your mysql server version for the right sytax to use near " driver = { mysql ODBC 3.51 Driver}' at line 1
| 
October 31st, 2008, 05:29 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii 1.DRIVER={MySQL ODBC 3.51 Driver}; 2.SERVER=hxxmysqlxx.secureserver.net; PORT=3306; DATABASE='database name';
3.USER=tsiiinc; PASSWORD='your password'; OPTION=0;
with the right settings for my database
This is the code I was trying to use , but not matter what code I use no matter what I put it keeps giving me this error, I called godaddy too and they said that the server is working just fine. I just need to find a new hosting server.
ERROR
#1064 you have an error in your sql syntax; check tne manual that corresponds to your mysql server version for the right sytax to use near " driver = { mysql ODBC 3.51 Driver}' at line 1 | I'm assuming no one know anything about this. Just to let everyone know i'm not the only one with these issues.
i'm
| 
November 4th, 2008, 08:49 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy Quote: |
Originally Posted by nicoletsii I'm assuming no one know anything about this. Just to let everyone know i'm not the only one with these issues.
i'm | 512 views within 1 month shows how many people really need help with godaddy's database services. i will help all as soon as i figure it out.
| 
November 24th, 2008, 08:59 PM
| | Newbie | | Join Date: Oct 2008 Location: ohio
Posts: 15
| | | re: connecting a database using godaddy
go daddy already has phpmyadmin install in the database
| 
November 30th, 2008, 07:36 PM
| | Newbie | | Join Date: Nov 2008
Posts: 1
| | | re: connecting a database using godaddy
Either get dedicated hosting from GoDaddy or get a better hosting provider. I would go with the latter, I currently have godaddy for both of my websites and I have been disappointed many times by their lack of customer support and the way they disable so many of the features you would expect from a hosting provider (E.g such as your problem, no remote database access).
Here is the solution I found for your problem (also the one I was having during development)
"Unfortunately, we do not allow external connections to our database servers. When connecting to a database in your Shared Hosting account, you must access it through the Database section of the Hosting Control Center." Can I connect to my database remotely? - Help Center—Knowledge Base and FAQ
Oh and you can use access as your development database (on your computer) and then just export the database to a file and then import it to mysql on your live server. There is no reason why you should have to download mysql and use that instead of whatever development database you want to use. Any database server will have these import/export features (even Excel has them).
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,720 network members.
|