473,587 Members | 2,413 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'.se cure.net';[/PHP]
How can I fix this?
Oct 8 '08 #1
26 16599
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.sec ureserver.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.sec uresever.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

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

Similar topics

4
1848
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 shared hoster site. Only the hoster does not allow the running of osql. How can I create my sql server database on my shared hoster site? Can I save...
12
2765
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 both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new...
0
5847
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... http://groups.google.co.uk/group/comp.lang.php/browse_thread/thread/2e052386da903425/b03ec83ac55273a2?lnk=st&q=&rnum=1#b03ec83ac55273a2 Everyone on that post seems to say its to do with the cookie's, yet...
0
1303
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 exchange is in the clients office (mail.company.com), using CDONTs and ASPMail to create the mail object isn't going to cut it if I don't use Godaddy's...
4
4059
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 database is over 13 megabytes in size.
2
1459
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 refreshed with that drug's data, with all pages having the exact same format, i.e. drug indications, contraindications, side effects, etc. all...
6
3678
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 n display it in "registerdisplay.php" cud u plz guide me how to acheive this........ i have hosted this site in godaddy.com problem is ...
1
2634
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 from ASP.NET, but they are always working with a local installation not a remote hosted installation. Will I need another database? I don't know where...
1
3032
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 wrote my ColdFusion code in Dreamweaver and just assumed it would take care of issues like this, but I guess it doesn't. If I have a few windows open...
0
7920
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3844
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.