473,513 Members | 6,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connecting a database using godaddy

15 New Member
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?
Oct 8 '08 #1
26 16570
Atli
5,058 Recognized Expert Expert
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.
Oct 8 '08 #2
nicoletsii
15 New Member
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
#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?
Oct 9 '08 #3
Atli
5,058 Recognized Expert Expert
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
Oct 9 '08 #4
nicoletsii
15 New Member
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.
Oct 10 '08 #5
nicoletsii
15 New Member
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.
Oct 10 '08 #6
Atli
5,058 Recognized Expert Expert
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.
Oct 10 '08 #7
nicoletsii
15 New Member
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?
Oct 13 '08 #8
nomad
664 Recognized Expert Contributor
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
Oct 15 '08 #9
Atli
5,058 Recognized Expert Expert
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.
Oct 15 '08 #10
nicoletsii
15 New Member
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.
Oct 16 '08 #11
ak1dnar
1,584 Recognized Expert Top Contributor
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.
Oct 16 '08 #12
nicoletsii
15 New Member
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.
Oct 16 '08 #13
ak1dnar
1,584 Recognized Expert Top Contributor
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.
Oct 17 '08 #14
nicoletsii
15 New Member
Sorry I already had the database created in Access that's why i asked. Were can I safely download mysql server to install it?
Oct 17 '08 #15
ak1dnar
1,584 Recognized Expert Top Contributor
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/
Oct 17 '08 #16
nicoletsii
15 New Member
Ok I had downloaded it but can't figure out how to install it.
Oct 17 '08 #17
ak1dnar
1,584 Recognized Expert Top Contributor
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
Oct 18 '08 #18
nicoletsii
15 New Member
Thank You for your help I downloaded the wrong one at first that was the problem.
Oct 20 '08 #19
nicoletsii
15 New Member
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?
Oct 22 '08 #20
ak1dnar
1,584 Recognized Expert Top Contributor
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.
Oct 23 '08 #21
nicoletsii
15 New Member
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
Oct 23 '08 #22
nicoletsii
15 New Member
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
Oct 31 '08 #23
nicoletsii
15 New Member
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.
Nov 4 '08 #24
nicoletsii
15 New Member
go daddy already has phpmyadmin install in the database
Nov 24 '08 #25
fury
1 New Member
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&mdash;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).
Nov 30 '08 #26
bwtharp
1 New Member
Actually, GoDaddy does allow remote access to the databases. When creating the database be sure to check the box "allow remote access". Things will work fine. The default is no access.

Bruce
Dec 5 '09 #27

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1842
by: Steve Richter | last post by:
I have an sql script that I ran on my local system using osql. It created all the tables, views, and even inserted sample data into the tables. Now I need to create that same database on a...
12
2753
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
0
5845
by: nfhm2k | last post by:
I've been trying to find a solution to this for quite some time now... I even took a look at existing scripts... Including this one......
0
1299
by: sarjenwd | last post by:
I have recently found that I have to send information from a web form on a clients web site to their SBS exchange server. The web site is being hosted on Godaddy which is fine but the SBS...
4
4055
by: Bootstrap Bill | last post by:
I'm looking for a PHP program to backup and restore a mysql database. I'm using Godaddy to host a forum. Their mysql control panel will only restore a database of two megabytes or less. My...
2
1449
by: NavyPsych | last post by:
I have a website that I would like to add a pharmacology 'database' (for lack of a better word) of about 50-75 drugs. Basically I want users to be able to click on any drug and quickly have a page...
6
3664
by: priyakollu | last post by:
hi guyz!, im using win xp, xampp version 2.5 Requirement: Upload resume from form and store in database and this would be "register.html" file later i want to retrieve that resume from database...
1
2622
by: cs_in_va | last post by:
I currently have a database with tables and data hosted with GoDaddy and now I want to add ASP.NET membership to restrict access and have people login etc. I have watched several videos on this...
1
3027
by: lee2732 | last post by:
I am running a website at GoDaddy where I have their least expensive plan that supports Linux/ColdFusion/mySQL. Apparently this plan supports a small number of active database connections (50). I...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.